Skip to content

Commit ae7c6a5

Browse files
committed
test: ✅ assert specific error type
1 parent 0d04fd0 commit ae7c6a5

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

runtime/moonbase/tests/integration_test.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,15 @@ fn root_can_change_default_xcm_vers() {
16401640
0,
16411641
WeightLimit::Unlimited,
16421642
);
1643-
assert!(matches!(result, Err(sp_runtime::DispatchError::Module(_))));
1643+
1644+
assert!(matches!(
1645+
result,
1646+
Err(sp_runtime::DispatchError::Module(sp_runtime::ModuleError {
1647+
index: 28,
1648+
error: [28, 2, 13, 0],
1649+
message: Some("LocalExecutionIncompleteWithError"),
1650+
}))
1651+
));
16441652

16451653
// Root sets the defaultXcm
16461654
assert_ok!(PolkadotXcm::force_default_xcm_version(

runtime/moonbeam/tests/integration_test.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,15 @@ fn root_can_change_default_xcm_vers() {
11601160
0,
11611161
WeightLimit::Unlimited,
11621162
);
1163-
assert!(matches!(result, Err(sp_runtime::DispatchError::Module(_))));
1163+
1164+
assert!(matches!(
1165+
result,
1166+
Err(sp_runtime::DispatchError::Module(sp_runtime::ModuleError {
1167+
index: 103,
1168+
error: [28, 2, 13, 0],
1169+
message: Some("LocalExecutionIncompleteWithError"),
1170+
}))
1171+
));
11641172

11651173
// Root sets the defaultXcm
11661174
assert_ok!(PolkadotXcm::force_default_xcm_version(

runtime/moonriver/tests/integration_test.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,15 @@ fn root_can_change_default_xcm_vers() {
11541154
0,
11551155
WeightLimit::Unlimited,
11561156
);
1157-
assert!(matches!(result, Err(sp_runtime::DispatchError::Module(_))));
1157+
1158+
assert!(matches!(
1159+
result,
1160+
Err(sp_runtime::DispatchError::Module(sp_runtime::ModuleError {
1161+
index: 103,
1162+
error: [28, 2, 13, 0],
1163+
message: Some("LocalExecutionIncompleteWithError"),
1164+
}))
1165+
));
11581166

11591167
// Root sets the defaultXcm
11601168
assert_ok!(PolkadotXcm::force_default_xcm_version(

0 commit comments

Comments
 (0)