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

Refactor Nomination Pool to support multiple staking strategies #3905

Merged
merged 314 commits into from
May 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
314 commits
Select commit Hold shift + click to select a range
77193e5
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 3, 2024
65693d1
fix doc link
Ank4n Apr 3, 2024
ff36302
taplo fix
Ank4n Apr 3, 2024
23c65c4
doc updates
Ank4n Apr 4, 2024
4f441d5
doc updates
Ank4n Apr 4, 2024
58b50c9
test for bonders cannot virtual bond
Ank4n Apr 4, 2024
b946c4a
virtual nominators receive rewards
Ank4n Apr 4, 2024
0aa9006
virtual nominator slashing test
Ank4n Apr 4, 2024
d242356
fmt
Ank4n Apr 4, 2024
4fcafd0
Merge branch 'ankan/01-prep-staking-for-delegation' into ankan/02-pal…
Ank4n Apr 4, 2024
6bd5e2c
fmt
Ank4n Apr 4, 2024
2fb04c5
found a bug while unbonding
Ank4n Apr 4, 2024
7962aac
test for unclaimed withdrawals
Ank4n Apr 4, 2024
83e417d
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 4, 2024
69fddff
fix stake adapter
Ank4n Apr 4, 2024
8bd3bc3
fix clippy error
Ank4n Apr 4, 2024
11da089
Merge branch 'ankan/01-prep-staking-for-delegation' into ankan/02-pal…
Ank4n Apr 4, 2024
15a9fc6
fix clippy
Ank4n Apr 4, 2024
1a34d28
fix compile
Ank4n Apr 4, 2024
2a75dc5
fix defensive trigger
Ank4n Apr 4, 2024
21828f3
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 4, 2024
c3c274d
doc
Ank4n Apr 4, 2024
0c85dde
wip migration test
Ank4n Apr 4, 2024
8f2d412
migration test
Ank4n Apr 4, 2024
0bf4dba
pool does not have to transfer ed to proxy delegator
Ank4n Apr 4, 2024
c311332
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 4, 2024
4bd35fe
finish migration test
Ank4n Apr 4, 2024
5879b71
test for withdrawing before migrating delegation
Ank4n Apr 5, 2024
e7a3002
fmt
Ank4n Apr 5, 2024
7800446
don't check for min balance when delegating to agent. pool should che…
Ank4n Apr 9, 2024
1d86812
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 9, 2024
84fb918
don't check for min balance
Ank4n Apr 9, 2024
0248cad
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 9, 2024
1a7446e
no check for minm while delegating to agent
Ank4n Apr 9, 2024
e55cea3
fix imports
Ank4n Apr 9, 2024
fbccd0f
Merge branch 'master' into ankan/01-prep-staking-for-delegation
Ank4n Apr 9, 2024
0c83496
Merge branch 'ankan/01-prep-staking-for-delegation' into ankan/02-pal…
Ank4n Apr 9, 2024
a48b651
fix imports
Ank4n Apr 9, 2024
8df0f0f
Revert log level changes (#3913)
bkchr Mar 31, 2024
8cd50d0
Fix two typos (#3812)
gemini132 Mar 31, 2024
398eb18
Removed `pallet::getter` usage from `pallet-alliance` (#3738)
muraca Apr 1, 2024
140b0f5
network:bridge: fix peer_count metric (#3711)
alexggh Apr 1, 2024
01d0b52
[parachain-template] pallet configurations into `mod configs` (#3809)
asiniscalchi Apr 1, 2024
c861b78
Improve `HostConfiguration` consistency check (#3897)
sandreim Apr 1, 2024
2d82d2b
Pools: Make `PermissionlessWithdraw` the default claim permission (#3…
Apr 1, 2024
780e29d
Fix 0007-dispute-freshly-finalized.zndsl failing (#3893)
alexggh Apr 1, 2024
5a8f14b
primitives: Move out of staging released APIs (#3925)
alexggh Apr 1, 2024
b4cb8d1
Fix links (#3928)
serban300 Apr 1, 2024
be8bd2d
pallet-scheduler: fix test (#3923)
sandreim Apr 1, 2024
5e3d97e
`im-online` removal final cleanup (#3902)
s0me0ne-unkn0wn Apr 1, 2024
8f2e654
Update derive syn parse 0.2.0 (+ docify) (#3920)
sam0x17 Apr 2, 2024
00529bc
pallet-xcm: fix weights for all XTs and deprecate unlimited weight on…
acatangiu Apr 2, 2024
14603f2
Fix parachain upgrade scheduling when done by the owner/root (#3341)
bkchr Apr 2, 2024
e43f54f
chore(zombienet): bump version (#3933)
pepoviola Apr 2, 2024
ff1007e
Update bridges subtree (#3938)
serban300 Apr 2, 2024
3021cbc
beefy: error logs for validators with dummy keys (#3939)
acatangiu Apr 2, 2024
a1e6f04
chainHead: Allow methods to be called from within a single connection…
lexnv Apr 2, 2024
8164280
Align dependencies with `parity-bridges-common` (#3937)
serban300 Apr 2, 2024
b659b7d
migrations: prevent accidentally using unversioned migrations instead…
dastansam Apr 2, 2024
0a98610
Snowbridge: Synchronize from Snowfork repository (#3761)
claravanstaden Apr 2, 2024
7d6679e
sp_runtime: TryFrom<RuntimeString> for &str (#3942)
michalkucharczyk Apr 2, 2024
67de6ed
SortedMembers::add for pallet-membership benchmarks (#3729)
Dinonard Apr 2, 2024
c47d5f4
Remove nextest filtration (#3885)
AndreiEres Apr 2, 2024
e4cd533
statement-distribution: fix filtering of statements for elastic parac…
sandreim Apr 3, 2024
5536d86
sp-wasm-interface: `wasmtime` should not be enabled by `std` (#3954)
bkchr Apr 3, 2024
7e437ad
Added tests for XCM barriers: `AllowSubscriptions`, `WithUniqueTopic`…
bkontur Apr 3, 2024
743cfee
chainHead: Ensure reasonable distance between leaf and finalized bloc…
lexnv Apr 3, 2024
c5a043f
Enable pov-reclaim on rococo and westend parachains (#3858)
skunert Apr 3, 2024
5a1b92d
Add ClaimQueue wrapper (#3950)
sandreim Apr 3, 2024
8518593
Renames `frame` crate to `polkadot-sdk-frame` (#3813)
codekitz Apr 4, 2024
23860fc
Convince GitLab not to crop collapsed multiline strings (#3971)
rcny Apr 4, 2024
73fdff8
Use 0.1.0 as minimum version for crates (#3941)
Morganamilo Apr 4, 2024
63064e6
Fix Mermaid diagram rendering (#3875)
liamaharon Apr 4, 2024
2f49bf6
[doc] Example MBM pallet (#2119)
juangirini Apr 4, 2024
fa02ada
XCM builder pattern improvement - Accept `impl Into<T>` instead of ju…
franciscoaguirre Apr 4, 2024
d199fd3
Migrate fee payment from `Currency` to `fungible` (#2292)
liamaharon Apr 4, 2024
e8db4e2
Added support for coretime-kusama/polkadot and people-kusama/polkadot…
bkontur Apr 4, 2024
569a318
Make `BlockNumberProvider::set_block_number` available in tests / std…
shawntabrizi Apr 4, 2024
b159df1
`GenesisConfig` presets for runtime (#2714)
michalkucharczyk Apr 4, 2024
bb373ea
Add Helikon boot nodes for Coretime Westend and People Westend. (#3922)
kukabi Apr 4, 2024
1ae6ec0
Update pr_3844.prdoc (#3988)
ermalkaleci Apr 4, 2024
bfd7ae2
Elastic scaling: add e2e test (#3929)
sandreim Apr 5, 2024
04119b3
Revert "[prdoc] Require SemVer bump level" (#3987)
ggwpez Apr 5, 2024
76f0ce7
Update pr_3302.prdoc (#3985)
ordian Apr 5, 2024
047cfa8
[prdoc] Support multiple audiences (#3990)
ggwpez Apr 5, 2024
a961eb0
[pallet-broker] Fix claim revenue behaviour for zero timeslices (#3997)
seadanda Apr 5, 2024
9d0a455
[parachain-template] benchmarks into `mod benchmarks` (#3818)
asiniscalchi Apr 5, 2024
03ca23d
Rococo/Westend: publish `claim_queue` Runtime API (#4005)
sandreim Apr 5, 2024
a03040f
chore: fix some comments (#4004)
divdeploy Apr 5, 2024
ac4cd56
Bump h2 from 0.3.24 to 0.3.26 (#4008)
dependabot[bot] Apr 5, 2024
65d1bb5
Broker: sale price runtime api (#3485)
Szegoo Apr 5, 2024
d9d4250
`pallet-uniques`: decrement `total_deposit` when clearing collection …
liamaharon Apr 6, 2024
c405c93
Improve frame umbrella crate doc experience (#4007)
liamaharon Apr 6, 2024
b7342b3
Major bump of tracing-subscriber version (#3891)
gilescope Apr 6, 2024
b95e605
Fix some typos (#4018)
HongKuang Apr 8, 2024
7daeaca
Deprecate `para_id()` from `CoreState` in polkadot primitives (#3979)
tdimitrov Apr 8, 2024
70fc335
sc-beefy-consensus: Remove unneeded stream. (#4015)
bkchr Apr 8, 2024
7f2a59b
adder-collator: add velocity measurement and make elastic scaling tes…
sandreim Apr 8, 2024
4db2dca
Add best block indicator to informant message + print parent block on…
skunert Apr 8, 2024
561bfdd
Github workflow to automate release draft creation (#3978)
EgorPopelyaev Apr 8, 2024
65a5d7b
[FRAME] Runtime Omni Bencher (#3512)
ggwpez Apr 8, 2024
527e039
Integrate litep2p into Polkadot SDK (#2944)
altonen Apr 8, 2024
0cc0af3
Adapt `RemoteExternalities` and its related types to be used with gen…
lean-apple Apr 8, 2024
6284289
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 9, 2024
d0d7977
add prdoc
Ank4n Apr 9, 2024
765278a
prdoc
Ank4n Apr 9, 2024
e46b01b
prdoc
Ank4n Apr 9, 2024
0376db7
mark strategy migration in storage
Ank4n Apr 9, 2024
3ee339a
pre post upgrade checks for strategy adapter migration
Ank4n Apr 9, 2024
0e41b01
Merge branch 'master' into ankan/01-prep-staking-for-delegation
Ank4n Apr 10, 2024
67a541c
Merge branch 'ankan/01-prep-staking-for-delegation' into ankan/02-pal…
Ank4n Apr 10, 2024
5457c40
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 10, 2024
17a4cf1
bench apply slash
Ank4n Apr 10, 2024
4d48232
weights
Ank4n Apr 10, 2024
b9bd68a
fmt
Ank4n Apr 10, 2024
09b85b3
apply slash pass with transfer stake strategy
Ank4n Apr 10, 2024
6bf7432
fmt
Ank4n Apr 10, 2024
92c9ef4
switch back to DelegateStake for bench
Ank4n Apr 10, 2024
5886704
fix delegated staking
Ank4n Apr 10, 2024
b8d9739
add dummy weights
Ank4n Apr 10, 2024
82f4a00
todo test
Ank4n Apr 10, 2024
49fb272
fix bench
Ank4n Apr 11, 2024
87d0bce
bench pool migration
Ank4n Apr 11, 2024
749b729
claim delegation bench
Ank4n Apr 11, 2024
c6771ab
update weights for migration of pool
Ank4n Apr 11, 2024
444dc76
add migrate to direct staker for testing
Ank4n Apr 11, 2024
9e5bdfa
Merge branch 'ankan/01-prep-staking-for-delegation' into ankan/02-pal…
Ank4n Apr 11, 2024
b1312d7
minor refactor
Ank4n Apr 11, 2024
49cfce1
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 11, 2024
9079d82
add migrate to direct staker for testing
Ank4n Apr 11, 2024
616dfa7
doc comment
Ank4n Apr 11, 2024
6bcf0ab
Merge branch 'ankan/01-prep-staking-for-delegation' into ankan/02-pal…
Ank4n Apr 11, 2024
c07a473
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 11, 2024
3579a88
fix import
Ank4n Apr 11, 2024
84dd24f
move drop agent to stake adapter
Ank4n Apr 11, 2024
99d34a2
fix compile
Ank4n Apr 11, 2024
afe8c87
pr feedback
Ank4n Apr 11, 2024
e7d65e2
add try state checks for virtual ledger
Ank4n Apr 11, 2024
474c1de
fmt
Ank4n Apr 11, 2024
6a019d6
Update substrate/frame/delegated-staking/src/lib.rs
kianenigma Apr 12, 2024
8d481a6
Apply suggestions from code review
Ank4n Apr 16, 2024
6940f88
Merge branch 'master' into ankan/01-prep-staking-for-delegation
Ank4n Apr 17, 2024
a884846
safe maths
Ank4n Apr 17, 2024
d4633c2
fix docs based on feedback
Ank4n Apr 17, 2024
c013cde
rename StakingUnsafe to StakingUnchecked
Ank4n Apr 17, 2024
b2588a5
Merge branch 'ankan/01-prep-staking-for-delegation' into ankan/02-pal…
Ank4n Apr 17, 2024
22594af
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 17, 2024
ac3cadf
use static mutate
Ank4n Apr 17, 2024
8cee25c
Merge branch 'ankan/01-prep-staking-for-delegation' into ankan/02-pal…
Ank4n Apr 17, 2024
0537e9c
Rename StakingUnsafe to StakingUnchecked
Ank4n Apr 17, 2024
fb5d64c
pr feedbacks
Ank4n Apr 17, 2024
bb93c8c
pr feedbacks
Ank4n Apr 17, 2024
cba250e
feedbacks
Ank4n Apr 17, 2024
9897437
feedback
Ank4n Apr 17, 2024
43d06b0
use static mutate
Ank4n Apr 17, 2024
abbc24d
Rename StakingUnsafe to StakingUnchecked
Ank4n Apr 17, 2024
b5fcc2f
pr feedbacks
Ank4n Apr 17, 2024
839e294
pr feedbacks
Ank4n Apr 17, 2024
53fab5b
feedbacks
Ank4n Apr 17, 2024
3bb99b2
feedback
Ank4n Apr 17, 2024
b430f63
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 17, 2024
5895afb
fix tests
Ank4n Apr 18, 2024
09d3359
Merge branch 'master' into ankan/01-prep-staking-for-delegation
Ank4n Apr 18, 2024
e75c2e6
Merge branch 'ankan/01-prep-staking-for-delegation' into ankan/02-pal…
Ank4n Apr 18, 2024
383593c
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 18, 2024
9bcfb17
add license to inner
Ank4n Apr 18, 2024
8fe83ca
adapters tested separately
Ank4n Apr 19, 2024
9409c74
add migration for westend
Ank4n Apr 19, 2024
5a3b8b2
add apply slash test to NP
Ank4n Apr 19, 2024
e31866e
inline locking
Ank4n Apr 19, 2024
078cf5f
optimize stash kill
Ank4n Apr 19, 2024
3790a40
Merge branch 'master' into ankan/01-prep-staking-for-delegation
Ank4n Apr 19, 2024
796c848
Merge branch 'ankan/01-prep-staking-for-delegation' into ankan/02-pal…
Ank4n Apr 19, 2024
666be52
Merge branch 'master' into ankan/02-pallet-delegated-staking
Ank4n Apr 20, 2024
ca232cd
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 20, 2024
be76a6b
pr feedbacks
Ank4n Apr 22, 2024
c6070d8
check stash is killed before cleaning up agent
Ank4n Apr 22, 2024
886a1a7
Merge branch 'master' into ankan/02-pallet-delegated-staking
Ank4n Apr 22, 2024
7ca660d
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 22, 2024
a69d620
Merge branch 'master' into ankan/02-pallet-delegated-staking
Ank4n Apr 24, 2024
b511a30
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 24, 2024
4b2daa2
withdraw delegation requires num slashing spans
Ank4n Apr 24, 2024
0e17037
separate trait for migration
Ank4n Apr 24, 2024
4e3b8cd
add a separate slash reward fraction for agent slashing
Ank4n Apr 24, 2024
ef10f48
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 24, 2024
804fa95
fix compile
Ank4n Apr 24, 2024
d3cf1b8
store only migration status
Ank4n Apr 25, 2024
a12f4c3
remove default strategy type
Ank4n Apr 25, 2024
b444c0e
rename claim_delegation to migrate_delegation
Ank4n Apr 25, 2024
a4ddc76
additional check for account destroy
Ank4n Apr 25, 2024
b09f8fb
less retricted trait bounds for bench balance conversion
Ank4n Apr 25, 2024
e848d8d
pr feedbacks
Ank4n Apr 25, 2024
2a0b5c2
fix pool weight westend
Ank4n Apr 25, 2024
b1b1e1d
better docs pr feedback
Ank4n Apr 25, 2024
1e6cdad
rename claim delegation to migrate delegation
Ank4n Apr 25, 2024
3cef018
Merge branch 'master' into ankan/02-pallet-delegated-staking
Ank4n Apr 25, 2024
44503ba
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Apr 25, 2024
619858d
Merge branch 'ankan/02-pallet-delegated-staking' of https://github.co…
Apr 25, 2024
2f65014
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Apr 25, 2024
24d05ad
fix docs
Ank4n Apr 25, 2024
72b50da
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n Apr 25, 2024
495aa24
not allow reap stash for virtual stakers
Ank4n Apr 26, 2024
732569a
fix test
Ank4n Apr 26, 2024
142e3c7
full slash test
Ank4n Apr 26, 2024
7dacae3
not passing yet
Ank4n Apr 26, 2024
bd56eb3
Merge branch 'master' into ankan/02-pallet-delegated-staking
Ank4n May 2, 2024
a988ec8
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n May 2, 2024
d4ef271
Merge branch 'master' into ankan/02-pallet-delegated-staking
Ank4n May 7, 2024
fe0b657
fix migration, move free funds as well when migrating a nominator to …
Ank4n May 7, 2024
ca77189
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n May 7, 2024
0f6a3a0
fix migration errors, make it idempotent
Ank4n May 7, 2024
36e9972
fix imports
Ank4n May 7, 2024
6bf808a
remove slash test that will be fixed as a separate PR
Ank4n May 7, 2024
a1c5698
assert against right err
Ank4n May 7, 2024
464cea0
Merge branch 'master' into ankan/02-pallet-delegated-staking
Ank4n May 13, 2024
7782cab
pr feedbacks
Ank4n May 13, 2024
6e3045f
use system events for pallet
Ank4n May 13, 2024
0ff52fd
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n May 13, 2024
70e9b1f
fix mock config
Ank4n May 13, 2024
159d1bf
run try state for staking
Ank4n May 13, 2024
4b5e4fe
Merge branch 'ankan/02-pallet-delegated-staking' into ankan/03-np-del…
Ank4n May 13, 2024
7323dd6
Merge branch 'master' into ankan/03-np-delegation-integration
Ank4n May 15, 2024
587a2f1
restore Cargo.lock
Ank4n May 15, 2024
978c02c
Merge branch 'master' into ankan/03-np-delegation-integration
Ank4n May 15, 2024
31d4c6a
bump parity scale codec in delegate stake integration test
Ank4n May 15, 2024
2d5fd2e
pr feedbacks
Ank4n May 16, 2024
c6d6f0f
fmt
Ank4n May 16, 2024
f9db499
update prdoc withh all crates changed
Ank4n May 16, 2024
d2ee1e9
Merge branch 'master' into ankan/03-np-delegation-integration
Ank4n May 17, 2024
1634110
fix test
Ank4n May 17, 2024
62df281
Contracts: Remove topics for internal events (#4510)
pgherveou May 17, 2024
a1a6c2e
chore: fix typos (#4515)
jimwfs May 19, 2024
ead90d1
`remote-externalities`: `rpc_child_get_keys` to use paged scraping (#…
liamaharon May 19, 2024
c7e9b9b
Remove usage of the pallet::getter macro from pallet-fast-unstake (#4…
PolkadotDom May 20, 2024
a771851
Remove the prospective-parachains subsystem from collators (#4471)
alindima May 21, 2024
bd35913
Merge branch 'master' into ankan/03-np-delegation-integration
Ank4n May 21, 2024
a2f984e
add fully unbonding and partially unbonding scenarios to pool migrati…
Ank4n May 21, 2024
7a06567
fmt
Ank4n May 21, 2024
9e89aa0
ensure migrate delegation is only called once
Ank4n May 21, 2024
318d1a7
add new api to check if staker is virtual
Ank4n May 21, 2024
d0a9393
add extrinsic to migrate pool
Ank4n May 21, 2024
20bbf18
fix compile and gate delegation related dispatchables
Ank4n May 21, 2024
a66beff
add test to ensure delegate stake dispatchables are gated
Ank4n May 21, 2024
5eb6cfb
some more gate tests
Ank4n May 21, 2024
7efdbf7
fix bench
Ank4n May 22, 2024
b9a7236
update migration with max pool bound
Ank4n May 22, 2024
7c90e09
fix clippy
Ank4n May 22, 2024
adc4fa5
pass pool bound from runtime
Ank4n May 22, 2024
e2dbad9
read total stake instead of total balance
Ank4n May 22, 2024
be081dd
fix try state problem
Ank4n May 22, 2024
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
Prev Previous commit
Next Next commit
virtual nominators receive rewards
  • Loading branch information
Ank4n committed Apr 4, 2024
commit b946c4a042f2152f68b4a05d91f8bfc780fe2c1a
15 changes: 5 additions & 10 deletions substrate/frame/staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,12 +623,8 @@ fn nominating_and_rewards_should_work() {
));
assert_ok!(Staking::nominate(RuntimeOrigin::signed(1), vec![11, 21, 31]));

assert_ok!(Staking::bond(
RuntimeOrigin::signed(3),
1000,
RewardDestination::Account(3)
));
assert_ok!(Staking::nominate(RuntimeOrigin::signed(3), vec![11, 21, 41]));
// the second nominator is virtual.
bond_virtual_nominator(3, 333, 1000, vec![11, 21, 41]);

// the total reward for era 0
let total_payout_0 = current_total_payout_for_duration(reward_time_per_era());
Expand Down Expand Up @@ -694,11 +690,10 @@ fn nominating_and_rewards_should_work() {
);
// Nominator 3: has [400/1800 ~ 2/9 from 10] + [600/2200 ~ 3/11 from 21]'s reward. ==>
// 2/9 + 3/11
assert_eq!(Balances::total_balance(&3), initial_balance);
/// 333 is the reward destination for 3.
assert_eq_error_rate!(
Balances::total_balance(&3),
initial_balance + (2 * payout_for_11 / 9 + 3 * payout_for_21 / 11),
2,
);
Balances::total_balance(&333), 2 * payout_for_11 / 9 + 3 * payout_for_21 / 11, 2);

// Validator 11: got 800 / 1800 external stake => 8/18 =? 4/9 => Validator's share = 5/9
assert_eq_error_rate!(
Expand Down