Skip to content

Commit 2c35bc3

Browse files
NachoPalgilescope
andauthored
[xcm-emulator] Redo Parachain init (#1356)
* bring back proper init * refactor block cycle * ".git/.scripts/commands/fmt/fmt.sh" * Update cumulus/xcm/xcm-emulator/src/lib.rs Co-authored-by: Squirrel <[email protected]> --------- Co-authored-by: command-bot <> Co-authored-by: Giles Cope <[email protected]>
1 parent a30092a commit 2c35bc3

File tree

7 files changed

+142
-138
lines changed

7 files changed

+142
-138
lines changed

cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/send.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,6 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
174174
PenpalKusamaA::assert_xcm_pallet_sent();
175175
});
176176

177-
PenpalKusamaA::execute_with(|| {});
178-
179177
AssetHubKusama::execute_with(|| {
180178
type RuntimeEvent = <AssetHubKusama as Chain>::RuntimeEvent;
181179

cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/send.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,6 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
177177
PenpalPolkadotA::assert_xcm_pallet_sent();
178178
});
179179

180-
PenpalPolkadotA::execute_with(|| {});
181-
182180
AssetHubPolkadot::execute_with(|| {
183181
type RuntimeEvent = <AssetHubPolkadot as Chain>::RuntimeEvent;
184182

cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/teleport.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ fn limited_teleport_native_assets_from_relay_to_system_para_works() {
187187
/// Limited Teleport of native asset from System Parachain to Relay Chain
188188
/// should work when there is enough balance in Relay Chain's `CheckAccount`
189189
#[test]
190-
#[cfg(feature = "FIXME-IGNORED")] // <https://github.com/paritytech/cumulus/issues/3027>
191190
fn limited_teleport_native_assets_back_from_system_para_to_relay_works() {
192191
// Dependency - Relay Chain's `CheckAccount` should have enough balance
193192
limited_teleport_native_assets_from_relay_to_system_para_works();
@@ -226,7 +225,6 @@ fn limited_teleport_native_assets_back_from_system_para_to_relay_works() {
226225
/// Limited Teleport of native asset from System Parachain to Relay Chain
227226
/// should't work when there is not enough balance in Relay Chain's `CheckAccount`
228227
#[test]
229-
#[cfg(feature = "FIXME-IGNORED")] // <https://github.com/paritytech/cumulus/issues/3027>
230228
fn limited_teleport_native_assets_from_system_para_to_relay_fails() {
231229
// Init values for Relay Chain
232230
let amount_to_send: Balance = ASSET_HUB_POLKADOT_ED * 1000;

cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/send.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ fn send_xcm_from_para_to_system_para_paying_fee_with_assets_works() {
116116
PenpalWestendA::assert_xcm_pallet_sent();
117117
});
118118

119-
PenpalWestendA::execute_with(|| {});
120-
121119
AssetHubWestend::execute_with(|| {
122120
type RuntimeEvent = <AssetHubWestend as Chain>::RuntimeEvent;
123121

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

Lines changed: 71 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -14,85 +14,86 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
1616

17+
use crate::*;
18+
1719
#[test]
18-
#[ignore]
1920
fn example() {
20-
// // Init tests variables
21-
// // XcmPallet send arguments
22-
// let sudo_origin = <Rococo as Chain>::RuntimeOrigin::root();
23-
// let destination = Rococo::child_location_of(BridgeHubRococo::para_id()).into();
24-
// let weight_limit = WeightLimit::Unlimited;
25-
// let check_origin = None;
21+
// Init tests variables
22+
// XcmPallet send arguments
23+
let sudo_origin = <Rococo as Chain>::RuntimeOrigin::root();
24+
let destination = Rococo::child_location_of(BridgeHubRococo::para_id()).into();
25+
let weight_limit = WeightLimit::Unlimited;
26+
let check_origin = None;
2627

27-
// let remote_xcm = Xcm(vec![ClearOrigin]);
28+
let remote_xcm = Xcm(vec![ClearOrigin]);
2829

29-
// let xcm = VersionedXcm::from(Xcm(vec![
30-
// UnpaidExecution { weight_limit, check_origin },
31-
// ExportMessage {
32-
// network: WococoId,
33-
// destination: X1(Parachain(AssetHubWococo::para_id().into())),
34-
// xcm: remote_xcm,
35-
// },
36-
// ]));
30+
let xcm = VersionedXcm::from(Xcm(vec![
31+
UnpaidExecution { weight_limit, check_origin },
32+
ExportMessage {
33+
network: WococoId,
34+
destination: X1(Parachain(AssetHubWococo::para_id().into())),
35+
xcm: remote_xcm,
36+
},
37+
]));
3738

38-
// //Rococo Global Consensus
39-
// // Send XCM message from Relay Chain to Bridge Hub source Parachain
40-
// Rococo::execute_with(|| {
41-
// assert_ok!(<Rococo as RococoPallet>::XcmPallet::send(
42-
// sudo_origin,
43-
// bx!(destination),
44-
// bx!(xcm),
45-
// ));
39+
//Rococo Global Consensus
40+
// Send XCM message from Relay Chain to Bridge Hub source Parachain
41+
Rococo::execute_with(|| {
42+
assert_ok!(<Rococo as RococoPallet>::XcmPallet::send(
43+
sudo_origin,
44+
bx!(destination),
45+
bx!(xcm),
46+
));
4647

47-
// type RuntimeEvent = <Rococo as Chain>::RuntimeEvent;
48+
type RuntimeEvent = <Rococo as Chain>::RuntimeEvent;
4849

49-
// assert_expected_events!(
50-
// Rococo,
51-
// vec![
52-
// RuntimeEvent::XcmPallet(pallet_xcm::Event::Sent { .. }) => {},
53-
// ]
54-
// );
55-
// });
56-
// // Receive XCM message in Bridge Hub source Parachain
57-
// BridgeHubRococo::execute_with(|| {
58-
// type RuntimeEvent = <BridgeHubRococo as Chain>::RuntimeEvent;
50+
assert_expected_events!(
51+
Rococo,
52+
vec![
53+
RuntimeEvent::XcmPallet(pallet_xcm::Event::Sent { .. }) => {},
54+
]
55+
);
56+
});
57+
// Receive XCM message in Bridge Hub source Parachain
58+
BridgeHubRococo::execute_with(|| {
59+
type RuntimeEvent = <BridgeHubRococo as Chain>::RuntimeEvent;
5960

60-
// assert_expected_events!(
61-
// BridgeHubRococo,
62-
// vec![
63-
// RuntimeEvent::DmpQueue(cumulus_pallet_dmp_queue::Event::ExecutedDownward {
64-
// outcome: Outcome::Complete(_),
65-
// ..
66-
// }) => {},
67-
// RuntimeEvent::BridgeWococoMessages(pallet_bridge_messages::Event::MessageAccepted {
68-
// lane_id: LaneId([0, 0, 0, 1]),
69-
// nonce: 1,
70-
// }) => {},
71-
// ]
72-
// );
73-
// });
61+
assert_expected_events!(
62+
BridgeHubRococo,
63+
vec![
64+
RuntimeEvent::DmpQueue(cumulus_pallet_dmp_queue::Event::ExecutedDownward {
65+
outcome: Outcome::Complete(_),
66+
..
67+
}) => {},
68+
RuntimeEvent::BridgeWococoMessages(pallet_bridge_messages::Event::MessageAccepted {
69+
lane_id: LaneId([0, 0, 0, 1]),
70+
nonce: 1,
71+
}) => {},
72+
]
73+
);
74+
});
7475

75-
// // Wococo GLobal Consensus
76-
// // Receive XCM message in Bridge Hub target Parachain
77-
// BridgeHubWococo::execute_with(|| {
78-
// type RuntimeEvent = <BridgeHubWococo as Chain>::RuntimeEvent;
76+
// Wococo GLobal Consensus
77+
// Receive XCM message in Bridge Hub target Parachain
78+
BridgeHubWococo::execute_with(|| {
79+
type RuntimeEvent = <BridgeHubWococo as Chain>::RuntimeEvent;
7980

80-
// assert_expected_events!(
81-
// BridgeHubWococo,
82-
// vec![
83-
// RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }) => {},
84-
// ]
85-
// );
86-
// });
87-
// // Receive embeded XCM message within `ExportMessage` in Parachain destination
88-
// AssetHubWococo::execute_with(|| {
89-
// type RuntimeEvent = <AssetHubWococo as Chain>::RuntimeEvent;
81+
assert_expected_events!(
82+
BridgeHubWococo,
83+
vec![
84+
RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }) => {},
85+
]
86+
);
87+
});
88+
// Receive embeded XCM message within `ExportMessage` in Parachain destination
89+
AssetHubWococo::execute_with(|| {
90+
type RuntimeEvent = <AssetHubWococo as Chain>::RuntimeEvent;
9091

91-
// assert_expected_events!(
92-
// AssetHubWococo,
93-
// vec![
94-
// RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::Fail { .. }) => {},
95-
// ]
96-
// );
97-
// });
92+
assert_expected_events!(
93+
AssetHubWococo,
94+
vec![
95+
RuntimeEvent::XcmpQueue(cumulus_pallet_xcmp_queue::Event::Fail { .. }) => {},
96+
]
97+
);
98+
});
9899
}

cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/tests/fellowship.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,8 @@ fn pay_salary() {
5858
);
5959
});
6060

61-
Collectives::execute_with(|| {});
62-
6361
AssetHubPolkadot::execute_with(|| {
6462
type RuntimeEvent = <AssetHubPolkadot as Chain>::RuntimeEvent;
65-
6663
assert_expected_events!(
6764
AssetHubPolkadot,
6865
vec![

0 commit comments

Comments
 (0)