chore: centralise weight calculation and reduce writes to storage#1210
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release/hayabusa #1210 +/- ##
====================================================
- Coverage 58.21% 58.15% -0.07%
====================================================
Files 275 277 +2
Lines 28987 29014 +27
====================================================
- Hits 16876 16872 -4
- Misses 10675 10706 +31
Partials 1436 1436 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9fc882d to
ce94c3d
Compare
otherview
left a comment
There was a problem hiding this comment.
I think this is on the right path.
It seems like the goal is to abstract away the concept of Stake (big.Int) and replace it with Weighted Stake (struct).
This avoids any miscalculation or misuse of the stake vs weight.
What about making the Stake a private field and only allowing the access of the WeightedStake ?
My concern is that the Stake can be changed directly wrongfully.
Perhaps, as an example, if the delegation moved from delegation.Stake + delegation.Multiplier to delegation.WeightedStake then it should be impossible to mess that up.
…ore/centralise-weight-calculations
otherview
left a comment
There was a problem hiding this comment.
Perhaps worth making the SetDelegation to a private method. Not a block imo
Description
stakespackageChecklist: