Skip to content

Commit

Permalink
Backport style changes from P<>K bridge to R<>W bridge (paritytech#4732)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkontur authored and TarekkMA committed Aug 2, 2024
1 parent 7a2e8ce commit 7385bac
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ fn register_weth_token_from_ethereum_to_asset_hub() {

// Construct RegisterToken message and sent to inbound queue
let register_token_message = make_register_token_message();
send_inbound_message(register_token_message.clone()).unwrap();
assert_ok!(send_inbound_message(register_token_message.clone()));

assert_expected_events!(
BridgeHubRococo,
Expand Down Expand Up @@ -250,10 +250,10 @@ fn send_token_from_ethereum_to_asset_hub() {
type RuntimeEvent = <BridgeHubRococo as Chain>::RuntimeEvent;

// Construct RegisterToken message and sent to inbound queue
send_inbound_message(make_register_token_message()).unwrap();
assert_ok!(send_inbound_message(make_register_token_message()));

// Construct SendToken message and sent to inbound queue
send_inbound_message(make_send_token_message()).unwrap();
assert_ok!(send_inbound_message(make_send_token_message()));

// Check that the message was sent
assert_expected_events!(
Expand Down Expand Up @@ -332,14 +332,14 @@ fn send_token_from_ethereum_to_penpal() {
type RuntimeEvent = <BridgeHubRococo as Chain>::RuntimeEvent;

// Construct RegisterToken message and sent to inbound queue
send_inbound_message(make_register_token_message()).unwrap();
assert_ok!(send_inbound_message(make_register_token_message()));

// Construct SendToken message to AssetHub(only for increase the nonce as the same order in
// smoke test)
send_inbound_message(make_send_token_message()).unwrap();
assert_ok!(send_inbound_message(make_send_token_message()));

// Construct SendToken message and sent to inbound queue
send_inbound_message(make_send_token_to_penpal_message()).unwrap();
assert_ok!(send_inbound_message(make_send_token_to_penpal_message()));

assert_expected_events!(
BridgeHubRococo,
Expand Down Expand Up @@ -399,7 +399,7 @@ fn send_weth_asset_from_asset_hub_to_ethereum() {
type RuntimeEvent = <BridgeHubRococo as Chain>::RuntimeEvent;

// Construct RegisterToken message and sent to inbound queue
send_inbound_message(make_register_token_message()).unwrap();
assert_ok!(send_inbound_message(make_register_token_message()));

// Check that the register token message was sent using xcm
assert_expected_events!(
Expand All @@ -410,7 +410,7 @@ fn send_weth_asset_from_asset_hub_to_ethereum() {
);

// Construct SendToken message and sent to inbound queue
send_inbound_message(make_send_token_message()).unwrap();
assert_ok!(send_inbound_message(make_send_token_message()));

// Check that the send token message was sent using xcm
assert_expected_events!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1644,10 +1644,8 @@ impl_runtime_apis! {
}

fn universal_alias() -> Result<(Location, Junction), BenchmarkError> {
match xcm_config::bridging::BridgingBenchmarksHelper::prepare_universal_alias() {
Some(alias) => Ok(alias),
None => Err(BenchmarkError::Skip)
}
xcm_config::bridging::BridgingBenchmarksHelper::prepare_universal_alias()
.ok_or(BenchmarkError::Skip)
}

fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,7 @@ pub mod bridging {
false => None,
}
});
assert!(alias.is_some(), "we expect here BridgeHubRococo to Westend mapping at least");
Some(alias.unwrap())
Some(alias.expect("we expect here BridgeHubRococo to Westend mapping at least"))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1735,10 +1735,8 @@ impl_runtime_apis! {
}

fn universal_alias() -> Result<(Location, Junction), BenchmarkError> {
match xcm_config::bridging::BridgingBenchmarksHelper::prepare_universal_alias() {
Some(alias) => Ok(alias),
None => Err(BenchmarkError::Skip)
}
xcm_config::bridging::BridgingBenchmarksHelper::prepare_universal_alias()
.ok_or(BenchmarkError::Skip)
}

fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,7 @@ pub mod bridging {
false => None,
}
});
assert!(alias.is_some(), "we expect here BridgeHubWestend to Rococo mapping at least");
Some(alias.unwrap())
Some(alias.expect("we expect here BridgeHubWestend to Rococo mapping at least"))
}
}
}

0 comments on commit 7385bac

Please sign in to comment.