diff --git a/examples/src/2_fees/mod.rs b/examples/src/2_fees/mod.rs index 50fbbff..ba7e447 100644 --- a/examples/src/2_fees/mod.rs +++ b/examples/src/2_fees/mod.rs @@ -1,16 +1,16 @@ #[cfg(test)] mod tests { - use crate::simple_test_net::{*, parachain::estimate_message_fee}; + use crate::simple_test_net::{parachain::estimate_message_fee, *}; use frame_support::assert_ok; use xcm::latest::prelude::*; use xcm_simulator::TestExt; /// Scenario: - /// Relay chain sends a XCM to Parachain A. - /// Enough execution is bought for the full message. + /// Relay chain sends a XCM to Parachain A. + /// Enough execution is bought for the full message. /// However, the message errors at the Trap(1) instruction (simulates error in other instructions). - /// The last three instructions are not executed - /// and the weight surplus of these instructions is refunded to the relay chain account. + /// The last three instructions are not executed + /// and the weight surplus of these instructions is refunded to the relay chain account. #[test] fn refund_surplus() { MockNet::reset(); @@ -33,9 +33,9 @@ mod tests { }, ])), Trap(1), - ClearOrigin, - ClearOrigin, - ClearOrigin, + ClearOrigin, + ClearOrigin, + ClearOrigin, ]); Relay::execute_with(|| { diff --git a/examples/src/lib.rs b/examples/src/lib.rs index f3d0caa..1ac862b 100644 --- a/examples/src/lib.rs +++ b/examples/src/lib.rs @@ -1,23 +1,23 @@ -mod simple_test_net; -#[path ="0_first_look/mod.rs"] -mod first_look; -#[path="1_transfers/mod.rs"] -mod transfers; -#[path ="2_fees/mod.rs"] +#[path = "7_expects/mod.rs"] +mod expects; +#[path = "2_fees/mod.rs"] mod fees; -#[path ="3_transact/mod.rs"] -mod transact; -#[path ="4_origins/mod.rs"] -mod origins; -#[path ="5_holding_modifiers/mod.rs"] +#[path = "0_first_look/mod.rs"] +mod first_look; +#[path = "5_holding_modifiers/mod.rs"] mod holding_modifiers; -#[path ="6_trap_and_claim/mod.rs"] -mod trap_and_claim; -#[path="7_expects/mod.rs"] -mod expects; -#[path ="8_queries/mod.rs"] +#[path = "10_locks/mod.rs"] +mod locks; +#[path = "4_origins/mod.rs"] +mod origins; +#[path = "8_queries/mod.rs"] mod queries; -#[path ="9_version_subscription/mod.rs"] +mod simple_test_net; +#[path = "3_transact/mod.rs"] +mod transact; +#[path = "1_transfers/mod.rs"] +mod transfers; +#[path = "6_trap_and_claim/mod.rs"] +mod trap_and_claim; +#[path = "9_version_subscription/mod.rs"] mod version_subscription; -#[path ="10_locks/mod.rs"] -mod locks; \ No newline at end of file diff --git a/src/testing/README.md b/src/testing/README.md index 9a25358..c8364de 100644 --- a/src/testing/README.md +++ b/src/testing/README.md @@ -11,7 +11,7 @@ We'll discuss tools and best practices for each of these levels. The [xcm-simulator](/~https://github.com/paritytech/polkadot/tree/master/xcm/xcm-simulator) is a tool to quickly test the execution of various XCM instructions against the `xcm-executor`. The examples in this documentation use the xcm-simulator. The simulator mocks the Downward Message Passing pallet, enabling us to get the XCMs that a parachain receives from the relay chain using the `received_dmp` getter. -The simulator should be used as a XCM playground. For testing the configuration of your parachain and the integration with other chains, you can use the xcm-emulator. +The simulator should be used as a XCM playground. For testing the XCM configuration of your parachain and the integration with other chains, you can use the xcm-emulator. ## XCM Emulator The [xcm-emulator](/~https://github.com/paritytech/cumulus/tree/master/xcm/xcm-emulator) is a tool to emulate XCM program execution using pre-configured runtimes, including those used to run on live networks, such as Kusama, Polkadot, Statemine, etc. This allows for testing cross-chain message passing and verifying outcomes, weights, and side-effects.