| 
14 | 14 | // You should have received a copy of the GNU General Public License  | 
15 | 15 | // along with Cumulus.  If not, see <http://www.gnu.org/licenses/>.  | 
16 | 16 | 
 
  | 
 | 17 | +use crate::*;  | 
 | 18 | + | 
17 | 19 | #[test]  | 
18 |  | -#[ignore]  | 
19 | 20 | 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;  | 
26 | 27 | 
 
  | 
27 |  | -	// let remote_xcm = Xcm(vec![ClearOrigin]);  | 
 | 28 | +	let remote_xcm = Xcm(vec![ClearOrigin]);  | 
28 | 29 | 
 
  | 
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 | +	]));  | 
37 | 38 | 
 
  | 
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 | +		));  | 
46 | 47 | 
 
  | 
47 |  | -	// 	type RuntimeEvent = <Rococo as Chain>::RuntimeEvent;  | 
 | 48 | +		type RuntimeEvent = <Rococo as Chain>::RuntimeEvent;  | 
48 | 49 | 
 
  | 
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;  | 
59 | 60 | 
 
  | 
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 | +	});  | 
74 | 75 | 
 
  | 
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;  | 
79 | 80 | 
 
  | 
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;  | 
90 | 91 | 
 
  | 
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 | +	});  | 
98 | 99 | }  | 
0 commit comments