Skip to content

Commit c7697ea

Browse files
authored
Backport style changes from P<>K bridge to R<>W bridge (#4732)
Closes: paritytech/parity-bridges-common#2734
1 parent d783ca9 commit c7697ea

5 files changed

Lines changed: 14 additions & 20 deletions

File tree

cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ fn register_weth_token_from_ethereum_to_asset_hub() {
215215

216216
// Construct RegisterToken message and sent to inbound queue
217217
let register_token_message = make_register_token_message();
218-
send_inbound_message(register_token_message.clone()).unwrap();
218+
assert_ok!(send_inbound_message(register_token_message.clone()));
219219

220220
assert_expected_events!(
221221
BridgeHubRococo,
@@ -250,10 +250,10 @@ fn send_token_from_ethereum_to_asset_hub() {
250250
type RuntimeEvent = <BridgeHubRococo as Chain>::RuntimeEvent;
251251

252252
// Construct RegisterToken message and sent to inbound queue
253-
send_inbound_message(make_register_token_message()).unwrap();
253+
assert_ok!(send_inbound_message(make_register_token_message()));
254254

255255
// Construct SendToken message and sent to inbound queue
256-
send_inbound_message(make_send_token_message()).unwrap();
256+
assert_ok!(send_inbound_message(make_send_token_message()));
257257

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

334334
// Construct RegisterToken message and sent to inbound queue
335-
send_inbound_message(make_register_token_message()).unwrap();
335+
assert_ok!(send_inbound_message(make_register_token_message()));
336336

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

341341
// Construct SendToken message and sent to inbound queue
342-
send_inbound_message(make_send_token_to_penpal_message()).unwrap();
342+
assert_ok!(send_inbound_message(make_send_token_to_penpal_message()));
343343

344344
assert_expected_events!(
345345
BridgeHubRococo,
@@ -399,7 +399,7 @@ fn send_weth_asset_from_asset_hub_to_ethereum() {
399399
type RuntimeEvent = <BridgeHubRococo as Chain>::RuntimeEvent;
400400

401401
// Construct RegisterToken message and sent to inbound queue
402-
send_inbound_message(make_register_token_message()).unwrap();
402+
assert_ok!(send_inbound_message(make_register_token_message()));
403403

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

412412
// Construct SendToken message and sent to inbound queue
413-
send_inbound_message(make_send_token_message()).unwrap();
413+
assert_ok!(send_inbound_message(make_send_token_message()));
414414

415415
// Check that the send token message was sent using xcm
416416
assert_expected_events!(

cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,10 +1644,8 @@ impl_runtime_apis! {
16441644
}
16451645

16461646
fn universal_alias() -> Result<(Location, Junction), BenchmarkError> {
1647-
match xcm_config::bridging::BridgingBenchmarksHelper::prepare_universal_alias() {
1648-
Some(alias) => Ok(alias),
1649-
None => Err(BenchmarkError::Skip)
1650-
}
1647+
xcm_config::bridging::BridgingBenchmarksHelper::prepare_universal_alias()
1648+
.ok_or(BenchmarkError::Skip)
16511649
}
16521650

16531651
fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> {

cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,7 @@ pub mod bridging {
699699
false => None,
700700
}
701701
});
702-
assert!(alias.is_some(), "we expect here BridgeHubRococo to Westend mapping at least");
703-
Some(alias.unwrap())
702+
Some(alias.expect("we expect here BridgeHubRococo to Westend mapping at least"))
704703
}
705704
}
706705
}

cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,10 +1735,8 @@ impl_runtime_apis! {
17351735
}
17361736

17371737
fn universal_alias() -> Result<(Location, Junction), BenchmarkError> {
1738-
match xcm_config::bridging::BridgingBenchmarksHelper::prepare_universal_alias() {
1739-
Some(alias) => Ok(alias),
1740-
None => Err(BenchmarkError::Skip)
1741-
}
1738+
xcm_config::bridging::BridgingBenchmarksHelper::prepare_universal_alias()
1739+
.ok_or(BenchmarkError::Skip)
17421740
}
17431741

17441742
fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> {

cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,7 @@ pub mod bridging {
648648
false => None,
649649
}
650650
});
651-
assert!(alias.is_some(), "we expect here BridgeHubWestend to Rococo mapping at least");
652-
Some(alias.unwrap())
651+
Some(alias.expect("we expect here BridgeHubWestend to Rococo mapping at least"))
653652
}
654653
}
655654
}

0 commit comments

Comments
 (0)