diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs index 1c1c51404aa4..8196b27cfe02 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs @@ -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, @@ -250,10 +250,10 @@ fn send_token_from_ethereum_to_asset_hub() { type RuntimeEvent = ::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!( @@ -332,14 +332,14 @@ fn send_token_from_ethereum_to_penpal() { type RuntimeEvent = ::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, @@ -399,7 +399,7 @@ fn send_weth_asset_from_asset_hub_to_ethereum() { type RuntimeEvent = ::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!( @@ -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!( diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs index 2bf09e6a7843..d75b07bd2b9f 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs @@ -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> { diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs index 664d2b9c9dd5..cf5a3905e581 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs @@ -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")) } } } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index d9249cdfc482..e9c2b10f719d 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -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> { diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs index 35a42627ad71..ff1fc99cba8a 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs @@ -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")) } } }