mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 20:31:13 +00:00
Add benchmark tests for pallet bags list (#10593)
* Add benchmark tests for pallet bags list * Make sure to set active balance for new ledgers * fmt * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_bags_list --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/bags-list/src/weights.rs --template=./.maintain/frame-weight-template.hbs Co-authored-by: Parity Bot <admin@parity.io> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -1245,13 +1245,12 @@ impl<T: Config> VoteWeightProvider<T::AccountId> for Pallet<T> {
|
||||
// this will clearly results in an inconsistent state, but it should not matter for a
|
||||
// benchmark.
|
||||
let active: BalanceOf<T> = weight.try_into().map_err(|_| ()).unwrap();
|
||||
let ledger = match Self::ledger(who) {
|
||||
let mut ledger = match Self::ledger(who) {
|
||||
None => StakingLedger::default_from(who.clone()),
|
||||
Some(mut l) => {
|
||||
l.active = active;
|
||||
l
|
||||
},
|
||||
Some(l) => l,
|
||||
};
|
||||
ledger.active = active;
|
||||
|
||||
<Ledger<T>>::insert(who, ledger);
|
||||
<Bonded<T>>::insert(who, who);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user