Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport style changes from P<>K bridge to R<>W bridge #4732

Merged
merged 3 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"))
}
}
}
Loading