flexible-voting icon indicating copy to clipboard operation
flexible-voting copied to clipboard

Add Invariant Testing

Open apbendi opened this issue 3 years ago • 2 comments

Set up invariant testing and add invariant tests where appropriate.

For example, testing that the total weight being voted with never exceeds the voting weight delegated by the gov token (would revert if so).

apbendi avatar Dec 20 '22 21:12 apbendi

References for invariant testing patterns, lmk if you have any questions when implementing:

  • https://github.com/foundry-rs/book/issues/497#issuecomment-1208473205
  • https://github.com/mds1/solidity-sandbox/blob/main/test/4_InvariantNonceGoUp.t.sol

mds1 avatar Dec 20 '22 23:12 mds1

This should also help - https://github.com/foundry-rs/foundry/tree/master/testdata/fuzz/invariant

Perelyn-sama avatar Jan 06 '23 11:01 Perelyn-sama