liquity / V2-gov

MIT License
3 stars 4 forks source link

Feat simplify `onAfterAllocateLQTY` hook #12

Closed GalloDaSballo closed 3 days ago

GalloDaSballo commented 4 days ago

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 
GalloDaSballo commented 4 days ago

I fixed the tests

I believe we should add invariant tests here:

GalloDaSballo commented 3 days ago

Closing in favour of #13 See my comment there