Astar
Astar copied to clipboard
Stake/unstake fix
Pull Request Summary
Fixes an issue where it's possible to end up with inconsistent staked amount for the ongoing era for some smart contract.
TODO
- [x] issue reproduced via tests
- [x] (init) solution implemented & tested
- [x] improved types test
- [x] previous_staked tests
- [x] unstake return values test
- [x] unstake with different tuples test
- [x] change approach for unstake to return multiple tuples
- [x] remove redundant subperiod argument
- [x] implement & test migration logic
@ashutoshvarma thanks!
I was postponing to push the conflict resolution not to mess up the review, but sure, here it goes 🙂
Package | Line Rate | Branch Rate | Health |
---|---|---|---|
chain-extensions/xvm/src | 0% | 0% | ❌ |
pallets/block-rewards-hybrid/src | 91% | 0% | ✔ |
pallets/dapps-staking/src/pallet | 86% | 0% | ✔ |
precompiles/dapp-staking-v3/src | 90% | 0% | ✔ |
precompiles/dispatch-lockdrop/src | 86% | 0% | ✔ |
precompiles/xvm/src | 74% | 0% | ➖ |
chain-extensions/pallet-assets/src | 56% | 0% | ➖ |
precompiles/dapps-staking/src | 93% | 0% | ✔ |
primitives/src | 29% | 0% | ❌ |
precompiles/assets-erc20/src | 81% | 0% | ✔ |
primitives/src/migrations | 0% | 0% | ❌ |
chain-extensions/types/assets/src | 0% | 0% | ❌ |
pallets/dapp-staking-v3/src | 91% | 0% | ✔ |
pallets/unified-accounts/src | 85% | 0% | ✔ |
primitives/src/xcm | 65% | 0% | ➖ |
precompiles/unified-accounts/src | 100% | 0% | ✔ |
precompiles/sr25519/src | 64% | 0% | ➖ |
pallets/dapps-staking/src | 89% | 0% | ✔ |
pallets/dapp-staking-v3/src/benchmarking | 99% | 0% | ✔ |
pallets/astar-xcm-benchmarks/src | 87% | 0% | ✔ |
chain-extensions/types/unified-accounts/src | 0% | 0% | ❌ |
precompiles/substrate-ecdsa/src | 74% | 0% | ➖ |
precompiles/xcm/src | 73% | 0% | ➖ |
pallets/dapp-staking-migration/src | 0% | 0% | ❌ |
pallets/xc-asset-config/src | 64% | 0% | ➖ |
pallets/dapp-staking-v3/src/test | 0% | 0% | ❌ |
pallets/astar-xcm-benchmarks/src/fungible | 100% | 0% | ✔ |
chain-extensions/types/xvm/src | 0% | 0% | ❌ |
chain-extensions/unified-accounts/src | 0% | 0% | ❌ |
pallets/static-price-provider/src | 58% | 0% | ➖ |
pallets/ethereum-checked/src | 79% | 0% | ➖ |
pallets/xvm/src | 51% | 0% | ➖ |
pallets/astar-xcm-benchmarks/src/generic | 100% | 0% | ✔ |
pallets/dapp-staking-v3/rpc/runtime-api/src | 0% | 0% | ❌ |
pallets/dynamic-evm-base-fee/src | 92% | 0% | ✔ |
pallets/inflation/src | 83% | 0% | ✔ |
precompiles/dapp-staking-v3/src/test | 0% | 0% | ❌ |
pallets/collator-selection/src | 91% | 0% | ✔ |
Summary | 76% (4305 / 5687) | 0% (0 / 0) | ➖ |
Minimum allowed line rate is 50%