Skip to content

Commit dabfea0

Browse files
committed
fix xcm dry run tests
1 parent 3818e3f commit dabfea0

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/integration/src/xcm_api.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818

1919
use crate::setup::*;
2020

21-
use cumulus_primitives_core::Parent;
2221
use cumulus_primitives_core::Unlimited;
23-
use sp_runtime::traits::Zero;
22+
use sp_runtime::traits::{BlakeTwo256, Hash, Zero};
2423
use xcm::{
2524
v4::{
2625
Asset as XcmAsset, AssetId as XcmAssetId, Fungibility, Junction, Junctions::*, Location,
@@ -203,16 +202,20 @@ fn query_delivery_fees_is_ok() {
203202
#[test]
204203
fn dry_run_call_is_ok() {
205204
new_test_ext().execute_with(|| {
206-
let origin = OriginCaller::system(frame_system::RawOrigin::Root.into());
205+
let origin = OriginCaller::system(frame_system::RawOrigin::Signed(ALICE.clone()).into());
207206
// TODO: Improve this test using an XCM call with more side effects and compare local_xcm with recorded one to get ride of `xcm_recorder_configuration_is_ok` test
208-
let call = RuntimeCall::System(frame_system::Call::remark {
207+
let call = RuntimeCall::System(frame_system::Call::remark_with_event {
209208
remark: vec![0u8; 32],
210209
});
211210

212211
let result = Runtime::dry_run_call(origin, call).expect("Must return some effects.");
212+
assert_eq!(result.forwarded_xcms, vec![]);
213213
assert_eq!(
214-
result.forwarded_xcms,
215-
vec![(VersionedLocation::from((Parent, Here)), vec![],),]
214+
result.emitted_events[0],
215+
RuntimeEvent::System(frame_system::Event::Remarked {
216+
sender: ALICE.into(),
217+
hash: BlakeTwo256::hash_of(&[0u8; 32]).into(),
218+
}),
216219
);
217220
})
218221
}
@@ -253,10 +256,7 @@ fn dry_run_xcm_is_ok() {
253256
let result = Runtime::dry_run_xcm(origin_location, versioned_xcm)
254257
.expect("Must return some effects.");
255258

256-
assert_eq!(
257-
result.forwarded_xcms,
258-
vec![(VersionedLocation::from((Parent, Here)), vec![],),]
259-
);
259+
assert_eq!(result.forwarded_xcms, vec![]);
260260

261261
assert_eq!(
262262
result.emitted_events[0],

0 commit comments

Comments
 (0)