diff --git a/chains/orchestrator-relays/runtime/dancelight/src/tests/common/xcm/mod.rs b/chains/orchestrator-relays/runtime/dancelight/src/tests/common/xcm/mod.rs index f19b25444..f8329d03c 100644 --- a/chains/orchestrator-relays/runtime/dancelight/src/tests/common/xcm/mod.rs +++ b/chains/orchestrator-relays/runtime/dancelight/src/tests/common/xcm/mod.rs @@ -17,4 +17,5 @@ mod constants; mod mocknets; mod reserver_transfers_polkadot_xcm; +mod xcm_message_exporter; pub use xcm_emulator::{bx, TestExt}; diff --git a/chains/orchestrator-relays/runtime/dancelight/src/tests/common/xcm/xcm_message_exporter.rs b/chains/orchestrator-relays/runtime/dancelight/src/tests/common/xcm/xcm_message_exporter.rs new file mode 100644 index 000000000..bab6ddb59 --- /dev/null +++ b/chains/orchestrator-relays/runtime/dancelight/src/tests/common/xcm/xcm_message_exporter.rs @@ -0,0 +1,36 @@ +use { + super::{ + super::{AccountId, ExtBuilder, ALICE}, + mocknets::{DancelightRelay as Dancelight, DancelightRelayPallet}, + }, + frame_support::weights::Weight, + pallet_xcm::Error, + sp_runtime::DispatchError, + xcm::{latest::prelude::*, VersionedXcm}, + xcm_emulator::Chain, +}; + +#[test] +fn test_message_export_disabled() { + ExtBuilder::default().build().execute_with(|| { + // The only test we can do is with signed runtime origins since we are ensuring local origin in xcm config + let origin = ::RuntimeOrigin::signed(AccountId::from(ALICE)); + + let message = Xcm(vec![Instruction::ExportMessage { + network: NetworkId::Ethereum { chain_id: 1 }, + destination: Junctions::Here.into(), + xcm: Xcm(vec![]), + }]); + + assert_eq!( + ::XcmPallet::execute( + origin, + Box::new(VersionedXcm::V4(message)), + Weight::from_parts(0, 0) + ) + .unwrap_err() + .error, + DispatchError::from(Error::<::Runtime>::LocalExecutionIncomplete) + ); + }); +}