Skip to content

Commit

Permalink
test(x/gov): fix breaking test and add new one
Browse files Browse the repository at this point in the history
  • Loading branch information
tbruyelle committed Dec 20, 2024
1 parent 67a57ea commit 8580329
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions x/gov/keeper/min_deposit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ import (
v1 "github.com/atomone-hub/atomone/x/gov/types/v1"
)

func TestActiveProposalNumber(t *testing.T) {
assert := assert.New(t)
k, _, _, ctx := setupGovKeeper(t)

assert.EqualValues(0, k.GetActiveProposalsNumber(ctx))

k.IncrementActiveProposalsNumber(ctx)
k.IncrementActiveProposalsNumber(ctx)
assert.EqualValues(2, k.GetActiveProposalsNumber(ctx))

k.DecrementActiveProposalsNumber(ctx)
assert.EqualValues(1, k.GetActiveProposalsNumber(ctx))

k.SetActiveProposalsNumber(ctx, 42)
assert.EqualValues(42, k.GetActiveProposalsNumber(ctx))
}

func TestGetMinDeposit(t *testing.T) {
var (
minDepositFloor = v1.DefaultMinDepositFloor
Expand Down
4 changes: 2 additions & 2 deletions x/gov/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ func (suite *KeeperTestSuite) TestMsgUpdateParams() {
}
},
expErr: true,
expErrMsg: "quorum timeout must not be nil: 0",
expErrMsg: "quorum timeout must not be nil",
},
{
name: "negative quorum timeout",
Expand Down Expand Up @@ -1168,7 +1168,7 @@ func (suite *KeeperTestSuite) TestMsgUpdateParams() {
}
},
expErr: true,
expErrMsg: "max voting period extension must not be nil: 0",
expErrMsg: "max voting period extension must not be nil",
},
{
name: "voting period extension below voting period - quorum timeout",
Expand Down

0 comments on commit 8580329

Please sign in to comment.