You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(torus0/stake): refund stake before clearing map (#113)
This patch fixes the de-registration code to clear the map after the
stake has been refunded to the accounts. A previous test case ensure the
_wrong_ behavior, which is now fixed.
An agent this week deregistered and got its tokens locked because of
order of operations. Luckly, because the TotalStake storage is still
wrong, the imbalance represents the amount needed to be refunded without
minting new tokens.
Closes CHAIN-103.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Bug Fixes**
- Resolved an issue in staking logic to ensure proper refunding of stake
during agent unregistration and runtime upgrades.
- Updated migration logic to correct stake imbalances from previous
versions.
- **Refactor**
- Improved clarity and maintainability of stake removal logic.
- Enhanced parameter naming for better readability.
- Modified operation order in agent unregistration for consistency.
- **Tests**
- Revised and renamed tests to better reflect updated agent
unregistration and staking behaviors.
- **Chores**
- Updated runtime and storage version numbers to reflect the latest
changes.
- Introduced workspace-wide linting configurations for consistent code
quality.
- Enforced stricter Clippy lint rules across the workspace.
- Applied saturating arithmetic in various runtime and pallet modules to
prevent overflow issues.
- Improved arithmetic safety and robustness in emission and governance
modules.
- Refined author identification and gas limit calculations with safer
arithmetic operations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
0 commit comments