mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 04:41:03 +00:00
make use of matches (#8211)
This commit is contained in:
committed by
GitHub
parent
62ef739faf
commit
9af70e93b7
@@ -2427,17 +2427,14 @@ mod tests {
|
|||||||
|
|
||||||
// no replacement yet.
|
// no replacement yet.
|
||||||
let unwrapped_error = Elections::remove_member(Origin::root(), 4, true).unwrap_err();
|
let unwrapped_error = Elections::remove_member(Origin::root(), 4, true).unwrap_err();
|
||||||
matches!(
|
assert!(matches!(
|
||||||
unwrapped_error.error,
|
unwrapped_error.error,
|
||||||
DispatchError::Module {
|
DispatchError::Module {
|
||||||
message: Some("InvalidReplacement"),
|
message: Some("InvalidReplacement"),
|
||||||
..
|
..
|
||||||
}
|
}
|
||||||
);
|
));
|
||||||
matches!(
|
assert!(unwrapped_error.post_info.actual_weight.is_some());
|
||||||
unwrapped_error.post_info.actual_weight,
|
|
||||||
Some(x) if x < <Test as frame_system::Config>::BlockWeights::get().max_block
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ExtBuilder::default().desired_runners_up(1).build_and_execute(|| {
|
ExtBuilder::default().desired_runners_up(1).build_and_execute(|| {
|
||||||
@@ -2456,17 +2453,14 @@ mod tests {
|
|||||||
|
|
||||||
// there is a replacement! and this one needs a weight refund.
|
// there is a replacement! and this one needs a weight refund.
|
||||||
let unwrapped_error = Elections::remove_member(Origin::root(), 4, false).unwrap_err();
|
let unwrapped_error = Elections::remove_member(Origin::root(), 4, false).unwrap_err();
|
||||||
matches!(
|
assert!(matches!(
|
||||||
unwrapped_error.error,
|
unwrapped_error.error,
|
||||||
DispatchError::Module {
|
DispatchError::Module {
|
||||||
message: Some("InvalidReplacement"),
|
message: Some("InvalidReplacement"),
|
||||||
..
|
..
|
||||||
}
|
}
|
||||||
);
|
));
|
||||||
matches!(
|
assert!(unwrapped_error.post_info.actual_weight.is_some());
|
||||||
unwrapped_error.post_info.actual_weight,
|
|
||||||
Some(x) if x < <Test as frame_system::Config>::BlockWeights::get().max_block
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user