Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NPoS] Fix for Reward Deficit in the pool #1255

Merged
merged 116 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
7429f0b
make total reward payout counter never decrease
Ank4n Aug 29, 2023
fc135d7
improve comments
Ank4n Aug 29, 2023
a580bc1
new call to top up the pool
Ank4n Aug 29, 2023
aace388
format
Ank4n Aug 29, 2023
66b593d
topped up funds are not rewardeable to delegators
Ank4n Aug 29, 2023
56cafc4
test for top up function
Ank4n Aug 29, 2023
767cc3a
check user has enough balance and limit max transfer to their free ba…
Ank4n Aug 29, 2023
626f544
Merge branch 'master' into ankan/fix-np-reward-deficit
Ank4n Sep 2, 2023
c4c7e96
contracts: Update to wasmi 0.31 (#1350)
athei Sep 2, 2023
a1a6d3e
substrate: chain-spec paths corrected in zombienet tests (#1362)
michalkucharczyk Sep 2, 2023
bda10a8
Ensure cumulus/bridges is ignored by formatter and run it (#1369)
gavofyork Sep 3, 2023
60895d0
feat: add futures api to `TransactionPool` (#1348)
yjhmelody Sep 3, 2023
86f0cc1
Bump proc-macro-warning from 0.4.1 to 0.4.2 (#1376)
dependabot[bot] Sep 4, 2023
0423b0d
Bump the known_good_semver group with 1 update (#1375)
dependabot[bot] Sep 4, 2023
2b89df6
Update `fmt` file and some authors (#1379)
ggwpez Sep 4, 2023
d3ba197
Markdown linter (#1309)
chevdor Sep 4, 2023
b14a908
[xcm-emulator] Redo Parachain init (#1356)
NachoPal Sep 4, 2023
5d37b81
add Treasurer to SchedulerOrigin (#1325)
xlc Sep 4, 2023
3d4089c
Cleanup repo (a tiny bit) (#1382)
ggwpez Sep 4, 2023
79edd91
approval-voting: use proper hash when querying session info (#1387)
ordian Sep 4, 2023
daf6141
[ci] Remove runtime-benchmarks from tests (#1335)
alvicsam Sep 4, 2023
c08d14d
Extract block announce validation from `ChainSync` (#1170)
dmitry-markin Sep 4, 2023
8e484a8
Contracts: Update read_sandbox (#1390)
pgherveou Sep 4, 2023
b5433ff
rust docs: add simple analytics (#1377)
liamaharon Sep 5, 2023
b1a3223
Move Relay-Specific Shared Code to One Place (#1193)
joepetrowski Sep 5, 2023
5bec497
Bump thiserror from 1.0.47 to 1.0.48 (#1396)
dependabot[bot] Sep 5, 2023
25f30b8
Bump actions/checkout from 3 to 4 (#1398)
dependabot[bot] Sep 5, 2023
d5565d3
Get rid of polling in `WarpSync` (#1265)
dmitry-markin Sep 5, 2023
23926b7
Remove redundant calls to `borrow()` (#1393)
mrcnski Sep 5, 2023
c292021
Remove dynamic dispatch using `Ext` (#1399)
athei Sep 5, 2023
d129363
Enforce a decoding limit in MultiAssets (#1395)
franciscoaguirre Sep 5, 2023
3e4576f
fmt fixes (#1413)
chevdor Sep 6, 2023
37161ee
Add PRdoc check (#1408)
chevdor Sep 6, 2023
a27e24e
RFC 14: Improve locking mechanism for parachains (#1290)
xlc Sep 6, 2023
425a72d
Bump enumn from 0.1.11 to 0.1.12 (#1412)
dependabot[bot] Sep 6, 2023
7520e04
Fix the wasm runtime substitute caching bug (#1416)
Sep 6, 2023
a317ef9
Fix PRdoc check (#1419)
chevdor Sep 6, 2023
c725bbe
Remove deprecated `pallet_balances`'s `set_balance_deprecated` and `t…
juangirini Sep 6, 2023
5e56b1a
pallet asset-conversion additional quote tests (#1371)
gilescope Sep 6, 2023
1be427e
GHW for building and publishing docker images (#1391)
EgorPopelyaev Sep 6, 2023
2f31a4c
Fix nothing scheduled on session boundary (#1403)
eskimor Sep 6, 2023
43d7a8c
Prevent a fail prdoc check to block (#1433)
chevdor Sep 6, 2023
433bc9d
zombienet: use another collator image for the slashing test (#1386)
ordian Sep 6, 2023
c6f1b9f
Adds base benchmark for do_tick in broker pallet (#1235)
gupnik Sep 7, 2023
7f2ae6e
Forgotten `polkadot-core-primitives/std` (#1440)
bkontur Sep 7, 2023
024210b
remove unused `keystore_uri` (#1421)
yjhmelody Sep 7, 2023
3ff561f
[ci] Enable flacky collector for tests (#1439)
alvicsam Sep 7, 2023
329df04
polkadot: pin one block per session (#1220)
ordian Sep 7, 2023
5fb02e7
[ci] Return publish-rustdoc (#1402)
alvicsam Sep 7, 2023
301c438
[ci] change image for prdoc gha (#1452)
alvicsam Sep 7, 2023
cbc1d0d
Update Chrono to 0.4.30 (#1451)
chevdor Sep 8, 2023
1089fe8
Bump actions/cache from 3.3.1 to 3.3.2 (#1456)
dependabot[bot] Sep 8, 2023
15898c3
Bump hex-literal from 0.3.4 to 0.4.1 (#1438)
dependabot[bot] Sep 8, 2023
eae53d5
Update ed25519-dalek to v2 (#1446)
chevdor Sep 8, 2023
f5d911a
Switch prdoc to the latest image (#1460)
chevdor Sep 8, 2023
675e7da
does not compile as balance is not serializable and used in genesis c…
Ank4n Sep 8, 2023
f3e8a4f
remove balance dependency in genesis config altogether
Ank4n Sep 8, 2023
8a3891e
compiles
Ank4n Sep 13, 2023
5848428
allow 1 holds
Ank4n Sep 13, 2023
84b6246
freezing currency is more appropriate here
Ank4n Sep 13, 2023
4d34b59
all tests pass
Ank4n Sep 13, 2023
c5fc61d
use Currency trait to read free balance
Ank4n Sep 13, 2023
22fd5de
verify ed is frozen
Ank4n Sep 13, 2023
b535954
format
Ank4n Sep 13, 2023
4a3387b
impl for adjusting ED
Ank4n Sep 13, 2023
36a87a4
use Runtime Freeze Reason
Ank4n Sep 14, 2023
de12c8f
add tests for adjusting ED
Ank4n Sep 14, 2023
138ecb2
fmt
Ank4n Sep 14, 2023
6a3bfc3
Merge branch 'master' into ankan/fix-np-reward-deficit
Ank4n Sep 14, 2023
a1c4970
added by mistake while merging, reverting
Ank4n Sep 14, 2023
29465b1
basic migration
Ank4n Sep 14, 2023
05592c7
migrations
Ank4n Sep 15, 2023
b147cfe
add weights to new call
Ank4n Sep 15, 2023
8bfef28
use fungible traits in np bench
Ank4n Sep 15, 2023
e705898
bench for new instruction
Ank4n Sep 15, 2023
b0202e2
allow fn with runtime benchmarks
Ank4n Sep 15, 2023
05f4bd8
Merge branch 'master' into ankan/fix-np-reward-deficit
Ank4n Sep 15, 2023
b0c00fe
Merge branch 'master' into ankan/fix-np-reward-deficit
Ank4n Sep 15, 2023
d432fba
pending rewards for pools
Ank4n Sep 16, 2023
d960582
add missing features
Ank4n Sep 16, 2023
d3d8ef4
add a note about using Currency::balance()
Ank4n Sep 16, 2023
bb00d8d
rename misspelling in the function
Ank4n Sep 16, 2023
d4cd942
fix staking np integration test
Ank4n Sep 16, 2023
51a44c7
fix unused warning
Ank4n Sep 16, 2023
9b1042e
fix kitchensink runtime
Ank4n Sep 16, 2023
d54f029
use default config for node cli np chain spec
Ank4n Sep 16, 2023
14d4530
fmt
Ank4n Sep 16, 2023
ca17f83
remove unused imports
Ank4n Sep 16, 2023
88c8959
fix feature scopes
Ank4n Sep 16, 2023
3af90e9
minor
Ank4n Sep 16, 2023
4303bb5
make balances serde for genesis config
Ank4n Sep 16, 2023
809236e
add migration for pools to all runtimes
Ank4n Sep 16, 2023
e538a0f
Merge branch 'master' into ankan/fix-np-reward-deficit
Ank4n Sep 16, 2023
ba9e53c
use balance everywhere in benchmark
Ank4n Sep 16, 2023
caac4e1
allow freezes in the kitchensink runtime
Ank4n Sep 16, 2023
d939a82
Merge branch 'master' into ankan/fix-np-reward-deficit
Ank4n Sep 17, 2023
c138e17
add docs and minor refactor
Ank4n Sep 18, 2023
34541b2
comment
Ank4n Sep 18, 2023
5628881
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
Sep 19, 2023
d20138a
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Sep 19, 2023
7de37d3
PR comments
Ank4n Sep 21, 2023
7969fdf
defensive assert while dissolving pool
Ank4n Sep 21, 2023
1e993eb
make unversioned migration private
Ank4n Sep 21, 2023
a15af2b
fix migrations in runtime
Ank4n Sep 21, 2023
58612c3
migration fix and name the new call better
Ank4n Sep 21, 2023
04f89b7
rename freeze unfreeze functions
Ank4n Sep 21, 2023
be4a86c
fmt
Ank4n Sep 21, 2023
f1425c3
Merge branch 'master' into ankan/fix-np-reward-deficit
Ank4n Sep 21, 2023
dd1ad02
Merge branch 'master' into ankan/fix-np-reward-deficit
Ank4n Sep 22, 2023
0395a4c
".git/.scripts/commands/bench/bench.sh" --subcommand=runtime --runtim…
Sep 22, 2023
7b40492
Merge branch 'master' into ankan/fix-np-reward-deficit
Ank4n Sep 22, 2023
9eee4f6
add pr doc
Ank4n Sep 22, 2023
7ea6b34
make adjust ed permissionless
Ank4n Sep 26, 2023
6bb9425
Merge branch 'master' into ankan/fix-np-reward-deficit
Ank4n Sep 26, 2023
8d4361a
Merge branch 'master' into ankan/fix-np-reward-deficit
Ank4n Sep 27, 2023
5f072c5
Merge branch 'master' into ankan/fix-np-reward-deficit
Ank4n Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions polkadot/runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ impl pallet_balances::Config for Runtime {
type ReserveIdentifier = [u8; 8];
type WeightInfo = weights::pallet_balances::WeightInfo<Runtime>;
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type FreezeIdentifier = RuntimeFreezeReason;
type MaxFreezes = ConstU32<1>;
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<0>;
}

parameter_types! {
Expand Down Expand Up @@ -1311,6 +1311,7 @@ impl pallet_nomination_pools::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_nomination_pools::WeightInfo<Self>;
type Currency = Balances;
type RuntimeFreezeReason = RuntimeFreezeReason;
type RewardCounter = FixedU128;
type BalanceToU256 = BalanceToU256;
type U256ToBalance = U256ToBalance;
Expand Down Expand Up @@ -1398,7 +1399,7 @@ construct_runtime! {
VoterList: pallet_bags_list::<Instance1>::{Pallet, Call, Storage, Event<T>} = 25,

// Nomination pools for staking.
NominationPools: pallet_nomination_pools::{Pallet, Call, Storage, Event<T>, Config<T>} = 29,
NominationPools: pallet_nomination_pools::{Pallet, Call, Storage, Event<T>, Config<T>, FreezeReason} = 29,

// Fast unstake pallet: extension to staking.
FastUnstake: pallet_fast_unstake = 30,
Expand Down Expand Up @@ -1505,6 +1506,7 @@ pub mod migrations {
UpgradeSessionKeys,
parachains_configuration::migration::v9::MigrateToV9<Runtime>,
paras_registrar::migration::VersionCheckedMigrateToV1<Runtime, ()>,
pallet_nomination_pools::migration::versioned_migrations::V5toV6<Runtime>,
pallet_referenda::migration::v1::MigrateV0ToV1<Runtime, ()>,
);
}
Expand Down
842 changes: 431 additions & 411 deletions polkadot/runtime/westend/src/weights/pallet_nomination_pools.rs

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions prdoc/pr_1255.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Schema: Parity PR Documentation Schema (prdoc)
# See doc at https://github.com/paritytech/prdoc

title: Fix for Reward Deficit in the pool

doc:
- audience: Core Dev
description: Instead of fragile calculation of current balance by looking at free balance - ED, Nomination Pool now freezes ED in the pool reward account to restrict an account from going below minimum balance. This also has a nice side effect that if ED changes, we know how much is the imbalance in ED frozen in the pool and the current required ED. A pool operator can diligently top up the pool with the deficit in ED or vice versa, withdraw the excess they transferred to the pool.
notes:
- Introduces new call `adjust_pool_deposit` that allows to top up the deficit or withdraw the excess deposit for the pool.
- Switch to using Fungible trait from Currency trait.

migrations:
db: []

runtime:
- { pallet: "pallet-nomination-pools", description: "One time migration of freezing ED from each of the existing pools."}

crates:
- name: pallet-nomination-pools

host_functions: []
5 changes: 3 additions & 2 deletions substrate/bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ impl pallet_balances::Config for Runtime {
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = frame_system::Pallet<Runtime>;
type WeightInfo = pallet_balances::weights::SubstrateWeight<Runtime>;
type FreezeIdentifier = ();
type MaxFreezes = ();
type FreezeIdentifier = RuntimeFreezeReason;
type MaxFreezes = ConstU32<1>;
type RuntimeHoldReason = RuntimeHoldReason;
type MaxHolds = ConstU32<2>;
}
Expand Down Expand Up @@ -882,6 +882,7 @@ impl pallet_nomination_pools::Config for Runtime {
type WeightInfo = ();
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type RuntimeFreezeReason = RuntimeFreezeReason;
type RewardCounter = FixedU128;
type BalanceToU256 = BalanceToU256;
type U256ToBalance = U256ToBalance;
Expand Down
59 changes: 37 additions & 22 deletions substrate/frame/nomination-pools/benchmarking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ use frame_benchmarking::v1::{account, whitelist_account};
use frame_election_provider_support::SortedListProvider;
use frame_support::{
assert_ok, ensure,
traits::{Currency, Get},
traits::{
fungible::{Inspect, Mutate, Unbalanced},
Get,
},
};
use frame_system::RawOrigin as RuntimeOrigin;
use pallet_nomination_pools::{
Expand Down Expand Up @@ -67,7 +70,7 @@ fn create_funded_user_with_balance<T: pallet_nomination_pools::Config>(
balance: BalanceOf<T>,
) -> T::AccountId {
let user = account(string, n, USER_SEED);
T::Currency::make_free_balance_be(&user, balance);
T::Currency::set_balance(&user, balance);
user
}

Expand Down Expand Up @@ -148,8 +151,7 @@ impl<T: Config> ListScenario<T> {
);

// Burn the entire issuance.
let i = CurrencyOf::<T>::burn(CurrencyOf::<T>::total_issuance());
sp_std::mem::forget(i);
Ank4n marked this conversation as resolved.
Show resolved Hide resolved
CurrencyOf::<T>::set_total_issuance(Zero::zero());

// Create accounts with the origin weight
let (pool_creator1, pool_origin1) =
Expand Down Expand Up @@ -206,7 +208,7 @@ impl<T: Config> ListScenario<T> {

let joiner: T::AccountId = account("joiner", USER_SEED, 0);
self.origin1_member = Some(joiner.clone());
CurrencyOf::<T>::make_free_balance_be(&joiner, amount * 2u32.into());
CurrencyOf::<T>::set_balance(&joiner, amount * 2u32.into());

let original_bonded = T::Staking::active_stake(&self.origin1).unwrap();

Expand Down Expand Up @@ -254,7 +256,7 @@ frame_benchmarking::benchmarks! {
whitelist_account!(joiner);
}: _(RuntimeOrigin::Signed(joiner.clone()), max_additional, 1)
verify {
assert_eq!(CurrencyOf::<T>::free_balance(&joiner), joiner_free - max_additional);
assert_eq!(CurrencyOf::<T>::balance(&joiner), joiner_free - max_additional);
assert_eq!(
T::Staking::active_stake(&scenario.origin1).unwrap(),
scenario.dest_weight
Expand Down Expand Up @@ -289,7 +291,7 @@ frame_benchmarking::benchmarks! {
// transfer exactly `extra` to the depositor of the src pool (1),
let reward_account1 = Pools::<T>::create_reward_account(1);
assert!(extra >= CurrencyOf::<T>::minimum_balance());
CurrencyOf::<T>::deposit_creating(&reward_account1, extra);
let _ = CurrencyOf::<T>::mint_into(&reward_account1, extra);

}: _(RuntimeOrigin::Signed(claimer), T::Lookup::unlookup(scenario.creator1.clone()), BondExtra::Rewards)
verify {
Expand All @@ -309,27 +311,27 @@ frame_benchmarking::benchmarks! {
let reward_account = Pools::<T>::create_reward_account(1);

// Send funds to the reward account of the pool
CurrencyOf::<T>::make_free_balance_be(&reward_account, ed + origin_weight);
CurrencyOf::<T>::set_balance(&reward_account, ed + origin_weight);

// set claim preferences to `PermissionlessAll` so any account can claim rewards on member's
// behalf.
let _ = Pools::<T>::set_claim_permission(RuntimeOrigin::Signed(depositor.clone()).into(), ClaimPermission::PermissionlessAll);

// Sanity check
assert_eq!(
CurrencyOf::<T>::free_balance(&depositor),
CurrencyOf::<T>::balance(&depositor),
origin_weight
);

whitelist_account!(depositor);
}:claim_payout_other(RuntimeOrigin::Signed(claimer), depositor.clone())
verify {
assert_eq!(
CurrencyOf::<T>::free_balance(&depositor),
CurrencyOf::<T>::balance(&depositor),
origin_weight + commission * origin_weight
);
assert_eq!(
CurrencyOf::<T>::free_balance(&reward_account),
CurrencyOf::<T>::balance(&reward_account),
ed + commission * origin_weight
);
}
Expand Down Expand Up @@ -383,7 +385,7 @@ frame_benchmarking::benchmarks! {
T::Staking::active_stake(&pool_account).unwrap(),
min_create_bond + min_join_bond
);
assert_eq!(CurrencyOf::<T>::free_balance(&joiner), min_join_bond);
assert_eq!(CurrencyOf::<T>::balance(&joiner), min_join_bond);

// Unbond the new member
Pools::<T>::fully_unbond(RuntimeOrigin::Signed(joiner.clone()).into(), joiner.clone()).unwrap();
Expand All @@ -403,7 +405,7 @@ frame_benchmarking::benchmarks! {
}: _(RuntimeOrigin::Signed(pool_account.clone()), 1, s)
verify {
// The joiners funds didn't change
assert_eq!(CurrencyOf::<T>::free_balance(&joiner), min_join_bond);
assert_eq!(CurrencyOf::<T>::balance(&joiner), min_join_bond);
// The unlocking chunk was removed
assert_eq!(pallet_staking::Ledger::<T>::get(pool_account).unwrap().unlocking.len(), 0);
}
Expand All @@ -426,7 +428,7 @@ frame_benchmarking::benchmarks! {
T::Staking::active_stake(&pool_account).unwrap(),
min_create_bond + min_join_bond
);
assert_eq!(CurrencyOf::<T>::free_balance(&joiner), min_join_bond);
assert_eq!(CurrencyOf::<T>::balance(&joiner), min_join_bond);

// Unbond the new member
pallet_staking::CurrentEra::<T>::put(0);
Expand All @@ -447,8 +449,7 @@ frame_benchmarking::benchmarks! {
}: withdraw_unbonded(RuntimeOrigin::Signed(joiner.clone()), joiner_lookup, s)
verify {
assert_eq!(
CurrencyOf::<T>::free_balance(&joiner),
min_join_bond * 2u32.into()
CurrencyOf::<T>::balance(&joiner), min_join_bond * 2u32.into()
);
// The unlocking chunk was removed
assert_eq!(pallet_staking::Ledger::<T>::get(&pool_account).unwrap().unlocking.len(), 0);
Expand Down Expand Up @@ -485,7 +486,7 @@ frame_benchmarking::benchmarks! {
Zero::zero()
);
assert_eq!(
CurrencyOf::<T>::free_balance(&pool_account),
CurrencyOf::<T>::balance(&pool_account),
min_create_bond
);
assert_eq!(pallet_staking::Ledger::<T>::get(&pool_account).unwrap().unlocking.len(), 1);
Expand Down Expand Up @@ -515,7 +516,7 @@ frame_benchmarking::benchmarks! {

// Funds where transferred back correctly
assert_eq!(
CurrencyOf::<T>::free_balance(&depositor),
CurrencyOf::<T>::balance(&depositor),
// gets bond back + rewards collecting when unbonding
min_create_bond * 2u32.into() + CurrencyOf::<T>::minimum_balance()
);
Expand All @@ -527,7 +528,7 @@ frame_benchmarking::benchmarks! {
let depositor_lookup = T::Lookup::unlookup(depositor.clone());

// Give the depositor some balance to bond
CurrencyOf::<T>::make_free_balance_be(&depositor, min_create_bond * 2u32.into());
CurrencyOf::<T>::set_balance(&depositor, min_create_bond * 2u32.into());

// Make sure no Pools exist at a pre-condition for our verify checks
assert_eq!(RewardPools::<T>::count(), 0);
Expand Down Expand Up @@ -782,7 +783,7 @@ frame_benchmarking::benchmarks! {
let ed = CurrencyOf::<T>::minimum_balance();
let (depositor, pool_account) = create_pool_account::<T>(0, origin_weight, Some(commission));
let reward_account = Pools::<T>::create_reward_account(1);
CurrencyOf::<T>::make_free_balance_be(&reward_account, ed + origin_weight);
CurrencyOf::<T>::set_balance(&reward_account, ed + origin_weight);

// member claims a payout to make some commission available.
let _ = Pools::<T>::claim_payout(RuntimeOrigin::Signed(claimer).into());
Expand All @@ -791,15 +792,29 @@ frame_benchmarking::benchmarks! {
}:_(RuntimeOrigin::Signed(depositor.clone()), 1u32.into())
verify {
assert_eq!(
CurrencyOf::<T>::free_balance(&depositor),
CurrencyOf::<T>::balance(&depositor),
origin_weight + commission * origin_weight
);
assert_eq!(
CurrencyOf::<T>::free_balance(&reward_account),
CurrencyOf::<T>::balance(&reward_account),
ed + commission * origin_weight
);
}

adjust_pool_deposit {
// Create a pool
let (depositor, _) = create_pool_account::<T>(0, Pools::<T>::depositor_min_bond() * 2u32.into(), None);

// Remove ed freeze to create a scenario where the ed deposit needs to be adjusted.
let _ = Pools::<T>::unfreeze_pool_deposit(&Pools::<T>::create_reward_account(1));
assert!(&Pools::<T>::check_ed_imbalance().is_err());

whitelist_account!(depositor);
}:_(RuntimeOrigin::Signed(depositor), 1)
verify {
assert!(&Pools::<T>::check_ed_imbalance().is_ok());
}

impl_benchmark_test_suite!(
Pallet,
crate::mock::new_test_ext(),
Expand Down
7 changes: 4 additions & 3 deletions substrate/frame/nomination-pools/benchmarking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ impl pallet_balances::Config for Runtime {
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type WeightInfo = ();
type FreezeIdentifier = ();
type MaxFreezes = ();
type FreezeIdentifier = RuntimeFreezeReason;
type MaxFreezes = ConstU32<1>;
type RuntimeHoldReason = ();
type MaxHolds = ();
}
Expand Down Expand Up @@ -160,6 +160,7 @@ impl pallet_nomination_pools::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = ();
type Currency = Balances;
type RuntimeFreezeReason = RuntimeFreezeReason;
type RewardCounter = FixedU128;
type BalanceToU256 = BalanceToU256;
type U256ToBalance = U256ToBalance;
Expand All @@ -183,7 +184,7 @@ frame_support::construct_runtime!(
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
Staking: pallet_staking::{Pallet, Call, Config<T>, Storage, Event<T>},
VoterList: pallet_bags_list::<Instance1>::{Pallet, Call, Storage, Event<T>},
Pools: pallet_nomination_pools::{Pallet, Call, Storage, Event<T>},
Pools: pallet_nomination_pools::{Pallet, Call, Storage, Event<T>, FreezeReason},
}
);

Expand Down
Loading
Loading