gossamer
gossamer copied to clipboard
chore(pkg/finality-grandpa): Implement `saturating_add` and `saturating_sub` on `VoteWeight`
Issue summary
- The rust code has some macros which generate the
saturating_add
andsaturating_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
- [x] Implement
saturating_add
andsaturating_sub
(https://github.com/ChainSafe/gossamer/pull/3519) - [ ] Use
saturating_add
andsaturating_sub
onVoteWeight