core-rs-albatross
core-rs-albatross copied to clipboard
Changing add stake operation
What's in this pull request?
- Adds the Minimum stake to the
add_stake
operation. Add stake transactions have an intrinsic check for itsvalue => min_stake
and thus are rejected before they can break the invariant.
- The idea is that this minimum prevents indefinite small value add_stake transactions from hindering the retirement or withdrawal.
-
add_stake
assumes that the staker wants to have auto-staking as long as there is active stake. Once no active stake exists, the funds are added to whatever is the biggest balance between inactive and retired.
- The idea is to prevent residual amounts of funds on the staking contract.
- Adapts and adds more unit tests
Pull request checklist
- [x] All tests pass. The project builds and runs.
- [x] I have resolved any merge conflicts.
- [x] I have resolved all
clippy
andrustfmt
warnings.