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>
This commit is contained in:
Shawn Tabrizi
2021-01-07 13:42:37 -04:00
committed by GitHub
parent 779c4f8616
commit 93ecff9b7c
4 changed files with 59 additions and 30 deletions
+15
View File
@@ -499,6 +499,21 @@ macro_rules! assert_noop {
}
}
/// Evaluate any expression and assert that runtime storage has not been mutated
/// (i.e. expression is a storage no-operation).
///
/// Used as `assert_storage_noop(expression_to_assert)`.
#[macro_export]
macro_rules! assert_storage_noop {
(
$x:expr
) => {
let h = $crate::storage_root();
$x;
assert_eq!(h, $crate::storage_root());
}
}
/// Assert an expression returns an error specified.
///
/// Used as `assert_err!(expression_to_assert, expected_error_expression)`