Skip to content

Commit

Permalink
Revert "feat!(x/gov): implement a minimum amount per deposit (backport
Browse files Browse the repository at this point in the history
…cosmos#19312) (#510)"

This reverts commit 106ba23.
  • Loading branch information
czarcas7ic committed Mar 25, 2024
1 parent 332b8c1 commit 86fcdf0
Show file tree
Hide file tree
Showing 23 changed files with 189 additions and 578 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (slashing) [#543](https://github.com/osmosis-labs/cosmos-sdk/pull/543) Make slashing not write sign info every block
* (authz) [#513](https://github.com/osmosis-labs/cosmos-sdk/pull/513) Limit expired authz grant pruning to 200 per block
* (gov) [#514](https://github.com/osmosis-labs/cosmos-sdk/pull/514) Let gov hooks return an error
* (gov) [#510](https://github.com/osmosis-labs/cosmos-sdk/pull/510) Implement a minimum amount per deposit
* (slashing) [#580](https://github.com/osmosis-labs/cosmos-sdk/pull/580) Less time intensive slashing migration

## IAVL v23 v1 Releases
Expand Down
151 changes: 34 additions & 117 deletions api/cosmos/gov/v1/gov.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions proto/cosmos/gov/v1/gov.proto
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,4 @@ message Params {

// burn deposits if quorum with vote type no_veto is met
bool burn_vote_veto = 15;

// The ratio representing the proportion of the deposit value minimum that must be met when making a deposit.
// Default value: 0.01. Meaning that for a chain with a min_deposit of 100stake, a deposit of 1stake would be
// required.
//
// Since: cosmos-sdk 0.50
// NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/18146)
string min_deposit_ratio = 16 [(cosmos_proto.scalar) = "cosmos.Dec"];
}
29 changes: 28 additions & 1 deletion tests/e2e/gov/deposits.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,33 @@ func (s *DepositTestSuite) TearDownSuite() {
s.network.Cleanup()
}

func (s *DepositTestSuite) TestQueryDepositsWithoutInitialDeposit() {
val := s.network.Validators[0]
clientCtx := val.ClientCtx

// submit proposal without initial deposit
id := s.submitProposal(val, sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(0)), "TestQueryDepositsWithoutInitialDeposit")
proposalID := strconv.FormatUint(id, 10)

// deposit amount
depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens.Add(sdk.NewInt(50))).String()
_, err := govclitestutil.MsgDeposit(clientCtx, val.Address.String(), proposalID, depositAmount)
s.Require().NoError(err)
s.Require().NoError(s.network.WaitForNextBlock())

// query deposit
deposit := s.queryDeposit(val, proposalID, false, "")
s.Require().NotNil(deposit)
s.Require().Equal(sdk.Coins(deposit.Amount).String(), depositAmount)

// query deposits
deposits := s.queryDeposits(val, proposalID, false, "")
s.Require().NotNil(deposits)
s.Require().Len(deposits.Deposits, 1)
// verify initial deposit
s.Require().Equal(sdk.Coins(deposits.Deposits[0].Amount).String(), depositAmount)
}

func (s *DepositTestSuite) TestQueryDepositsWithInitialDeposit() {
val := s.network.Validators[0]
depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens)
Expand Down Expand Up @@ -122,7 +149,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, fmt.Sprintf("proposal %s doesn't exist", proposalID))
deposits := s.queryDeposits(val, proposalID, true, "proposal 3 doesn't exist")
s.Require().Nil(deposits)
}

Expand Down
Loading

0 comments on commit 86fcdf0

Please sign in to comment.