mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-25 13:01:09 +00:00
Change assert(is_err()) to assert_noop to check state consistency on errors (#8587)
* Change is_err() asserts in tests to assert_noop to check state consistency fixes #8545 * Update frame/transaction-payment/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/contracts/src/exec.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Update frame/democracy/src/benchmarking.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Update frame/transaction-payment/src/lib.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Don't assert no-changing state. see: https://github.com/paritytech/substrate/pull/8587#issuecomment-817137906 * fix expected error * Fix non-extrinsic-call asserts Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
committed by
GitHub
parent
b9ed6e01b3
commit
24311eee3e
@@ -80,12 +80,12 @@ fn single_proposal_should_work() {
|
||||
fast_forward_to(3);
|
||||
|
||||
// referendum still running
|
||||
assert!(Democracy::referendum_status(0).is_ok());
|
||||
assert_ok!(Democracy::referendum_status(0));
|
||||
|
||||
// referendum runs during 2 and 3, ends @ start of 4.
|
||||
fast_forward_to(4);
|
||||
|
||||
assert!(Democracy::referendum_status(0).is_err());
|
||||
assert_noop!(Democracy::referendum_status(0), Error::<Test>::ReferendumInvalid);
|
||||
assert!(pallet_scheduler::Agenda::<Test>::get(6)[0].is_some());
|
||||
|
||||
// referendum passes and wait another two blocks for enactment.
|
||||
|
||||
Reference in New Issue
Block a user