Skip to content

Commit 02e6f93

Browse files
shawntabriziParity Benchmarking Bot
andauthored
Better Handle Dead Accounts in Balances (#7843)
* Don't mutate storage when account is dead and should stay dead * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs * more concrete storage noop Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
1 parent 33f9300 commit 02e6f93

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,21 @@ macro_rules! assert_noop {
499499
}
500500
}
501501

502+
/// Evaluate any expression and assert that runtime storage has not been mutated
503+
/// (i.e. expression is a storage no-operation).
504+
///
505+
/// Used as `assert_storage_noop(expression_to_assert)`.
506+
#[macro_export]
507+
macro_rules! assert_storage_noop {
508+
(
509+
$x:expr
510+
) => {
511+
let h = $crate::storage_root();
512+
$x;
513+
assert_eq!(h, $crate::storage_root());
514+
}
515+
}
516+
502517
/// Assert an expression returns an error specified.
503518
///
504519
/// Used as `assert_err!(expression_to_assert, expected_error_expression)`

0 commit comments

Comments
 (0)