Closed GalloDaSballo closed 3 days ago
[x] Add assert for onAfterAllocateLQTY to ensure the code works as the spec
assert
onAfterAllocateLQTY
[x] Rewrite the code to be easier to read
[x] Simplify the code
[X] Implement tests for it
[ ] E2E / Fuzz for reverts
[ ] Invariant Tests for accounting and reverts
[x] Fix Tests These tests are currently broken:
Ran 8 test suites in 2.22s (2.21s CPU time): 37 tests passed, 6 failed, 0 skipped (43 total tests)
Failing tests: Encountered 6 failing tests in test/BribeInitiativeAllocate.t.sol:BribeInitiativeAllocateTest [FAIL. Reason: assertion failed: 2001000000000000000000 != 1000000000000000000] test_onAfterAllocateLQTY_newEpoch_NoVetoToVeto() (gas: 403990) [FAIL. Reason: assertion failed: 2001000000000000000000 != 1000000000000000000] test_onAfterAllocateLQTY_newEpoch_VetoToNoVeto() (gas: 252067) [FAIL. Reason: assertion failed: 2001000000000000000000 != 1000000000000000000] test_onAfterAllocateLQTY_newEpoch_VetoToVeto() (gas: 252110) [FAIL. Reason: assertion failed: 2001000000000000000000 != 1000000000000000000] test_onAfterAllocateLQTY_sameEpoch_NoVetoToVeto() (gas: 355481) [FAIL. Reason: assertion failed: 2001000000000000000000 != 1000000000000000000] test_onAfterAllocateLQTY_sameEpoch_VetoToNoVeto() (gas: 355460) [FAIL. Reason: assertion failed: 2001000000000000000000 != 1000000000000000000] test_onAfterAllocateLQTY_sameEpoch_VetoToVeto() (gas: 204028)
I believe they were implemented incorrectly as they were allowing one caller to both vote and veto, but I wanted to make sure. CC: @jltqy @ColinPlatt
I fixed the tests
I believe we should add invariant tests here:
Closing in favour of #13 See my comment there
[x] Add
assert
foronAfterAllocateLQTY
to ensure the code works as the spec[x] Rewrite the code to be easier to read
[x] Simplify the code
[X] Implement tests for it
[ ] E2E / Fuzz for reverts
[ ] Invariant Tests for accounting and reverts
[x] Fix Tests These tests are currently broken:
Failing tests: Encountered 6 failing tests in test/BribeInitiativeAllocate.t.sol:BribeInitiativeAllocateTest [FAIL. Reason: assertion failed: 2001000000000000000000 != 1000000000000000000] test_onAfterAllocateLQTY_newEpoch_NoVetoToVeto() (gas: 403990) [FAIL. Reason: assertion failed: 2001000000000000000000 != 1000000000000000000] test_onAfterAllocateLQTY_newEpoch_VetoToNoVeto() (gas: 252067) [FAIL. Reason: assertion failed: 2001000000000000000000 != 1000000000000000000] test_onAfterAllocateLQTY_newEpoch_VetoToVeto() (gas: 252110) [FAIL. Reason: assertion failed: 2001000000000000000000 != 1000000000000000000] test_onAfterAllocateLQTY_sameEpoch_NoVetoToVeto() (gas: 355481) [FAIL. Reason: assertion failed: 2001000000000000000000 != 1000000000000000000] test_onAfterAllocateLQTY_sameEpoch_VetoToNoVeto() (gas: 355460) [FAIL. Reason: assertion failed: 2001000000000000000000 != 1000000000000000000] test_onAfterAllocateLQTY_sameEpoch_VetoToVeto() (gas: 204028)