Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
Fix suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoaguirre committed Jun 6, 2023
1 parent 1ec3644 commit 4a2b1a0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
16 changes: 8 additions & 8 deletions examples/src/2_fees/mod.rs
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -33,9 +33,9 @@ mod tests {
},
])),
Trap(1),
ClearOrigin,
ClearOrigin,
ClearOrigin,
ClearOrigin,
ClearOrigin,
ClearOrigin,
]);

Relay::execute_with(|| {
Expand Down
38 changes: 19 additions & 19 deletions examples/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion src/testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4a2b1a0

Please sign in to comment.