Skip to content

Commit

Permalink
tests: adapt e2e gov tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MSalopek committed Jan 31, 2024
1 parent c6b3507 commit 76768d5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/gov/deposits.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (s *DepositTestSuite) TestQueryProposalAfterVotingPeriod() {
s.Require().Contains(err.Error(), fmt.Sprintf("proposal %s doesn't exist", proposalID))

// query deposits
deposits := s.queryDeposits(val, proposalID, true, "proposal 3 doesn't exist")
deposits := s.queryDeposits(val, proposalID, true, fmt.Sprintf("proposal %s doesn't exist", proposalID))
s.Require().Nil(deposits)
}

Expand Down
3 changes: 2 additions & 1 deletion tests/e2e/gov/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (s *E2ETestSuite) TestCmdParams() {
{
"json output",
[]string{fmt.Sprintf("--%s=json", flags.FlagOutput)},
`{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000","burn_vote_quorum":false,"burn_proposal_deposit_prevote":false,"burn_vote_veto":true}}`,
`{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000","burn_vote_quorum":false,"burn_proposal_deposit_prevote":false,"burn_vote_veto":true,"min_deposit_ratio":"0.010000000000000000"}}`,
},
{
"text output",
Expand All @@ -42,6 +42,7 @@ params:
min_deposit:
- amount: "10000000"
denom: stake
min_deposit_ratio: "0.010000000000000000"
min_initial_deposit_ratio: "0.000000000000000000"
quorum: "0.334000000000000000"
threshold: "0.500000000000000000"
Expand Down
14 changes: 13 additions & 1 deletion tests/e2e/gov/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,23 @@ func (s *E2ETestSuite) TestNewCmdDeposit() {
},
false, 2,
},
{
"fail deposit on existing proposal",
[]string{
"1",
sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)).String(), // 10stake -> insufficient min deposit amount
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
},
false, 16,
},
{
"deposit on existing proposal",
[]string{
"1",
sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)).String(), // 10stake
sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens.Sub(sdk.NewInt(50))).String(), // slighty less than min initial deposit
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
Expand Down

0 comments on commit 76768d5

Please sign in to comment.