Unverified Commit 4800c2be authored by Roman's avatar Roman Committed by GitHub
Browse files

chore(deps): upgrade sdk with min proposer deposit and update e2e (#2245)


* chore(deps): upgrade sdk with min proposer deposit and update e2e

* changelog

* remove extra deposit for e2e

* correct the min deposit var

* fix depositProposal

* bump sdk to correct tag

Co-authored-by: default avatarAdam Tucker <adam@osmosis.team>
parent a54777b5
Showing with 28 additions and 15 deletions
+28 -15
......@@ -40,6 +40,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## v11
#### SDK Upgrades
* [#2245](https://github.com/osmosis-labs/osmosis/pull/2245) Upgrade SDK for to v0.45.0x-osmo-v9.2. Major changes:
* Minimum deposit on proposer at submission time: https://github.com/osmosis-labs/cosmos-sdk/pull/302
## v10.1.1
#### Improvements
......
......@@ -270,8 +270,8 @@ require (
replace (
// branch: v0.27.0.rc3-osmo, current tag: v0.27.0.rc3-osmo
github.com/CosmWasm/wasmd => github.com/osmosis-labs/wasmd v0.27.0-rc2.0.20220517191021-59051aa18d58
// Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk v0.45.0x-osmo-v9
github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220709005907-f37e34d99505
// Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk v0.45.0x-osmo-v9, tag v0.45.0x-osmo-v9.2
github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220728141005-f09814c9e23f
// Use Osmosis fast iavl
github.com/cosmos/iavl => github.com/osmosis-labs/iavl v0.17.3-osmo-v7
// use cosmos-compatible protobufs
......
......@@ -14,12 +14,14 @@ import (
"testing"
"time"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ory/dockertest/v3"
"github.com/ory/dockertest/v3/docker"
"github.com/stretchr/testify/suite"
rpchttp "github.com/tendermint/tendermint/rpc/client/http"
appparams "github.com/osmosis-labs/osmosis/v10/app/params"
dockerconfig "github.com/osmosis-labs/osmosis/v10/tests/e2e/docker"
"github.com/osmosis-labs/osmosis/v10/tests/e2e/initialization"
"github.com/osmosis-labs/osmosis/v10/tests/e2e/util"
......@@ -66,6 +68,10 @@ const (
propBufferBlocks float32 = 5
// max retries for json unmarshalling
maxRetries = 60
// minimum deposit value for a proposal to enter a voting period.
minDepositValue = 10000000
// minimum deposit value for proposal to be submitted.
initialMinDeposit = minDepositValue / 4
)
var (
......@@ -507,7 +513,7 @@ func (s *IntegrationTestSuite) upgrade() {
for _, chainConfig := range s.chainConfigs {
currentHeight := s.getCurrentChainHeight(chainConfig, 0)
chainConfig.propHeight = currentHeight + int(chainConfig.votingPeriod) + int(propSubmitBlocks) + int(propBufferBlocks)
s.submitUpgradeProposal(chainConfig)
s.submitUpgradeProposal(chainConfig, sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(initialMinDeposit)))
s.depositProposal(chainConfig)
s.voteProposal(chainConfig)
}
......
......@@ -5,6 +5,9 @@ import (
"strconv"
"time"
sdk "github.com/cosmos/cosmos-sdk/types"
appparams "github.com/osmosis-labs/osmosis/v10/app/params"
"github.com/osmosis-labs/osmosis/v10/tests/e2e/initialization"
)
......@@ -19,7 +22,7 @@ func (s *IntegrationTestSuite) TestIBCTokenTransfer() {
func (s *IntegrationTestSuite) TestSuperfluidVoting() {
const walletName = "wallet"
chainA := s.chainConfigs[0]
s.submitSuperfluidProposal(chainA, "gamm/pool/1")
s.submitSuperfluidProposal(chainA, "gamm/pool/1", sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(initialMinDeposit)))
s.depositProposal(chainA)
s.voteProposal(chainA)
walletAddr := s.createWallet(chainA, 0, walletName)
......@@ -30,7 +33,7 @@ func (s *IntegrationTestSuite) TestSuperfluidVoting() {
// superfluid delegate from validator 0 non self-delegation wallet to validator 1 on chain A
s.superfluidDelegate(chainA, chainA.validators[1].operatorAddress, walletName)
// create a text prop, deposit and vote yes
s.submitTextProposal(chainA, "superfluid vote overwrite test")
s.submitTextProposal(chainA, "superfluid vote overwrite test", sdk.NewCoin(appparams.BaseCoinUnit, sdk.NewInt(initialMinDeposit)))
s.depositProposal(chainA)
s.voteProposal(chainA)
// set delegator vote to no
......
......@@ -18,10 +18,9 @@ import (
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/ory/dockertest/v3/docker"
superfluidtypes "github.com/osmosis-labs/osmosis/v10/x/superfluid/types"
"github.com/osmosis-labs/osmosis/v10/tests/e2e/initialization"
"github.com/osmosis-labs/osmosis/v10/tests/e2e/util"
superfluidtypes "github.com/osmosis-labs/osmosis/v10/x/superfluid/types"
)
func (s *IntegrationTestSuite) ExecTx(chainId string, validatorIndex int, command []string, success string) (bytes.Buffer, bytes.Buffer, error) {
......@@ -144,26 +143,26 @@ func (s *IntegrationTestSuite) sendIBC(srcChain *chainConfig, dstChain *chainCon
s.T().Log("successfully sent IBC tokens")
}
func (s *IntegrationTestSuite) submitUpgradeProposal(c *chainConfig) {
func (s *IntegrationTestSuite) submitUpgradeProposal(c *chainConfig, initialDeposit sdk.Coin) {
upgradeHeightStr := strconv.Itoa(c.propHeight)
s.T().Logf("submitting upgrade proposal on %s container: %s", s.valResources[c.meta.Id][0].Container.Name[1:], s.valResources[c.meta.Id][0].Container.ID)
cmd := []string{"osmosisd", "tx", "gov", "submit-proposal", "software-upgrade", upgradeVersion, fmt.Sprintf("--title=\"%s upgrade\"", upgradeVersion), "--description=\"upgrade proposal submission\"", fmt.Sprintf("--upgrade-height=%s", upgradeHeightStr), "--upgrade-info=\"\"", fmt.Sprintf("--chain-id=%s", c.meta.Id), "--from=val", "-b=block", "--yes", "--keyring-backend=test", "--log_format=json"}
cmd := []string{"osmosisd", "tx", "gov", "submit-proposal", "software-upgrade", upgradeVersion, fmt.Sprintf("--title=\"%s upgrade\"", upgradeVersion), "--description=\"upgrade proposal submission\"", fmt.Sprintf("--upgrade-height=%s", upgradeHeightStr), "--upgrade-info=\"\"", fmt.Sprintf("--chain-id=%s", c.meta.Id), "--from=val", "-b=block", "--yes", "--keyring-backend=test", "--log_format=json", fmt.Sprintf("--deposit=%s", initialDeposit)}
s.ExecTx(c.meta.Id, 0, cmd, "code: 0")
s.T().Log("successfully submitted upgrade proposal")
c.latestProposalNumber = c.latestProposalNumber + 1
}
func (s *IntegrationTestSuite) submitSuperfluidProposal(c *chainConfig, asset string) {
func (s *IntegrationTestSuite) submitSuperfluidProposal(c *chainConfig, asset string, initialDeposit sdk.Coin) {
s.T().Logf("submitting superfluid proposal for asset %s on %s container: %s", asset, s.valResources[c.meta.Id][0].Container.Name[1:], s.valResources[c.meta.Id][0].Container.ID)
cmd := []string{"osmosisd", "tx", "gov", "submit-proposal", "set-superfluid-assets-proposal", fmt.Sprintf("--superfluid-assets=%s", asset), fmt.Sprintf("--title=\"%s superfluid asset\"", asset), fmt.Sprintf("--description=\"%s superfluid asset\"", asset), "--from=val", "-b=block", "--yes", "--keyring-backend=test", "--log_format=json", fmt.Sprintf("--chain-id=%s", c.meta.Id)}
cmd := []string{"osmosisd", "tx", "gov", "submit-proposal", "set-superfluid-assets-proposal", fmt.Sprintf("--superfluid-assets=%s", asset), fmt.Sprintf("--title=\"%s superfluid asset\"", asset), fmt.Sprintf("--description=\"%s superfluid asset\"", asset), "--from=val", "-b=block", "--yes", "--keyring-backend=test", "--log_format=json", fmt.Sprintf("--chain-id=%s", c.meta.Id), fmt.Sprintf("--deposit=%s", initialDeposit)}
s.ExecTx(c.meta.Id, 0, cmd, "code: 0")
s.T().Log("successfully submitted superfluid proposal")
c.latestProposalNumber = c.latestProposalNumber + 1
}
func (s *IntegrationTestSuite) submitTextProposal(c *chainConfig, text string) {
func (s *IntegrationTestSuite) submitTextProposal(c *chainConfig, text string, initialDeposit sdk.Coin) {
s.T().Logf("submitting text proposal on %s container: %s", s.valResources[c.meta.Id][0].Container.Name[1:], s.valResources[c.meta.Id][0].Container.ID)
cmd := []string{"osmosisd", "tx", "gov", "submit-proposal", "--type=text", fmt.Sprintf("--title=\"%s\"", text), "--description=\"test text proposal\"", "--from=val", "-b=block", "--yes", "--keyring-backend=test", "--log_format=json", fmt.Sprintf("--chain-id=%s", c.meta.Id)}
cmd := []string{"osmosisd", "tx", "gov", "submit-proposal", "--type=text", fmt.Sprintf("--title=\"%s\"", text), "--description=\"test text proposal\"", "--from=val", "-b=block", "--yes", "--keyring-backend=test", "--log_format=json", fmt.Sprintf("--chain-id=%s", c.meta.Id), fmt.Sprintf("--deposit=%s", initialDeposit)}
s.ExecTx(c.meta.Id, 0, cmd, "code: 0")
s.T().Log("successfully submitted text proposal")
c.latestProposalNumber = c.latestProposalNumber + 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment