gossamer icon indicating copy to clipboard operation
gossamer copied to clipboard

chore(pkg/finality-grandpa): Implement `saturating_add` and `saturating_sub` on `VoteWeight`

Open timwu20 opened this issue 1 year ago • 1 comments

Issue summary

  • The rust code has some macros which generate the saturating_add and saturating_sub methods for certain types to avoid overflows.
  • We should implement this as well for VoteWeight in the go package

Other information and links

  • https://github.com/paritytech/finality-grandpa/blob/a5bd965782216a95f017a65527a0a4fe28203e4d/src/weights.rs#L38

timwu20 avatar Oct 03 '23 15:10 timwu20

  • [x] Implement saturating_add and saturating_sub (https://github.com/ChainSafe/gossamer/pull/3519)
  • [ ] Use saturating_add and saturating_sub on VoteWeight

EclesioMeloJunior avatar Oct 04 '23 20:10 EclesioMeloJunior