Skip to content

Commit

Permalink
MX-15031: add extra check
Browse files Browse the repository at this point in the history
  • Loading branch information
dragos-rebegea committed Sep 25, 2024
1 parent f5da2c9 commit 1a2a505
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions vm/systemSmartContracts/governance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1705,13 +1705,15 @@ func TestGovernanceContract_CannotClose(t *testing.T) {
gsc, _ := NewGovernanceContract(args)

currentEpoch := uint64(10)
startVoteEpoch := currentEpoch + 1
endVoteEpoch := currentEpoch + 10
closedBeforeStart := &GeneralProposal{
Yes: big.NewInt(20),
No: big.NewInt(0),
Veto: big.NewInt(0),
Abstain: big.NewInt(10),
StartVoteEpoch: currentEpoch + 1,
EndVoteEpoch: currentEpoch + 10,
StartVoteEpoch: startVoteEpoch,
EndVoteEpoch: endVoteEpoch,
}

cannotClose := gsc.cannotClose(currentEpoch, closedBeforeStart)
Expand All @@ -1720,6 +1722,9 @@ func TestGovernanceContract_CannotClose(t *testing.T) {
gsc.enableEpochsHandler = enableEpochsHandlerMock.NewEnableEpochsHandlerStub(common.GovernanceFixesFlag)
cannotClose = gsc.cannotClose(currentEpoch, closedBeforeStart)
require.False(t, cannotClose)

cannotClose = gsc.cannotClose(endVoteEpoch+1, closedBeforeStart)
require.True(t, cannotClose)
}

func TestGovernanceContract_ClearEndedProposalsCallValue(t *testing.T) {
Expand Down

0 comments on commit 1a2a505

Please sign in to comment.