Closed yondonfu closed 4 years ago
Totals | |
---|---|
Change from base Build 1192: | 0.0% |
Covered Lines: | 686 |
Relevant Lines: | 686 |
Perhaps we could add an integration test for the withHint functions?
Added an integration test file in 51662fa
Changes and integration test look good to me. For completeness, could we add a transcoderWithHint though? That one seems to be missing.
Fixed in 6307dfd and 60e908a
Rebased!
This PR allows users of
BondingManager
to provide hints for staking actions. A hint consists of the address of the previous transcoder intranscoderPool
and the address of the next transcoder intranscoderPool
. A hint can be calculated by a client off-chain in order to reduce the gas costs for a staking action when the delegate/caller is already in the pool or is about to join the pool - if the hint is the correct insertion position then no linear search is required and if the hint is incorrect (i.e. because the pool ordering changed in between the time of hint calculation and tx inclusion) the contract will start the linear search from the hint.No functions are removed, but the following functions are added:
transcoderWithHint()
bondWithHint()
unbondWithHint()
rebondWithHint()
rebondFromUnbondedWithHint()
rewardWithHint()
Each of these functions correspond to an existing external function that does not allow hints to be passed.
I included the gas report additions from the nv/gas-report branch with a few tweaks (speed up tests, clearer flow, etc.).
Fixes #348