Skip to content

Commit af052c7

Browse files
authored
deps!: use cosmos-sdk v47-lsm and ics 3.3.x-lsm (#2920)
* deps!: use cosmos-sdk v47-lsm and ics 3.3.x-lsm * fix: correctly use submit-proposal tx in gov e2e
1 parent 650e9e1 commit af052c7

File tree

5 files changed

+36
-33
lines changed

5 files changed

+36
-33
lines changed

go.mod

+3-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ replace (
219219
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
220220

221221
// Use special SDK v0.47.x release with support for both ICS and LSM
222-
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.47.7-0.20240131111736-17d5f73db4ab
222+
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.47.7-0.20240202092001-7a03edbbb4fb
223223

224224
// TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134
225225
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2
@@ -234,3 +234,5 @@ replace (
234234
// the following version across all dependencies.
235235
google.golang.org/grpc => google.golang.org/grpc v1.54.0
236236
)
237+
238+
replace github.com/cosmos/interchain-security/v3 => github.com/cosmos/interchain-security/v3 v3.3.1-0.20240201164551-bde0df5adfef

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,8 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk=
600600
github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis=
601601
github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8=
602602
github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0=
603-
github.com/cosmos/cosmos-sdk v0.47.7-0.20240131111736-17d5f73db4ab h1:RayaSUazD63ZBcvw7DQ3RZ247ao7jwp6SWkiinUqnhQ=
604-
github.com/cosmos/cosmos-sdk v0.47.7-0.20240131111736-17d5f73db4ab/go.mod h1:Rx0pFb7vaFKsgRjFpBzUB+1HT4sQm11MHADdkpJlvuc=
603+
github.com/cosmos/cosmos-sdk v0.47.7-0.20240202092001-7a03edbbb4fb h1:DkGuGNs3PIndGvPysqME2QsEsz5JFeNsg9hmNSM8YEk=
604+
github.com/cosmos/cosmos-sdk v0.47.7-0.20240202092001-7a03edbbb4fb/go.mod h1:Rx0pFb7vaFKsgRjFpBzUB+1HT4sQm11MHADdkpJlvuc=
605605
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
606606
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
607607
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
@@ -618,8 +618,8 @@ github.com/cosmos/ibc-go/v7 v7.3.1 h1:bil1IjnHdyWDASFYKfwdRiNtFP6WK3osW7QFEAgU4I
618618
github.com/cosmos/ibc-go/v7 v7.3.1/go.mod h1:wvx4pPBofe5ZdMNV3OFRxSI4auEP5Qfqf8JXLLNV04g=
619619
github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM=
620620
github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0=
621-
github.com/cosmos/interchain-security/v3 v3.3.0 h1:bY+C7kV/A3ZTSxrl9ObPVC2c3uq0i+RaCSkNiLW+3i4=
622-
github.com/cosmos/interchain-security/v3 v3.3.0/go.mod h1:oeYBia11vnQ+45Hv/Ti3TkjJQcrmB2Ob0qD+FB7Qt2A=
621+
github.com/cosmos/interchain-security/v3 v3.3.1-0.20240201164551-bde0df5adfef h1:OF0aInyyWvt2Tf7gOh9+osMaWf24NbAztmJ8CVaiKRk=
622+
github.com/cosmos/interchain-security/v3 v3.3.1-0.20240201164551-bde0df5adfef/go.mod h1:Q89a787cM5Ag+lw7diP/HCqfQnZMpnDKfWLdUNyuRFM=
623623
github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo=
624624
github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA=
625625
github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw=

tests/e2e/e2e_gov_test.go

+6-7
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ func (s *IntegrationTestSuite) GovCommunityPoolSpend() {
131131
submitGovFlags := []string{configFile(proposalCommunitySpendFilename)}
132132
depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()}
133133
voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"}
134-
// TODO: replace proposal type by distrtypes.ProposalTypeCommunityPoolSpend equivalent in SDK v0.47
135-
s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "CommunityPoolSpend", submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)
134+
s.submitGovProposal(chainAAPIEndpoint, sender, proposalCounter, "CommunityPoolSpend", submitGovFlags, depositGovFlags, voteGovFlags, "vote")
136135

137136
s.Require().Eventually(
138137
func() bool {
@@ -160,13 +159,13 @@ func (s *IntegrationTestSuite) submitLegacyGovProposal(chainAAPIEndpoint, sender
160159
s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, voteCommand, voteFlags, govtypesv1beta1.StatusPassed)
161160
}
162161

163-
func (s *IntegrationTestSuite) submitGovProposal(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, withDeposit bool) {
162+
// NOTE: in SDK >= v0.47 the submit-proposal does not have a --deposit flag
163+
// Instead, the depoist is added to the "deposit" field of the proposal JSON (usually stored as a file)
164+
// you can use `gaiad tx gov draft-proposal` to create a proposal file that you can use
165+
// min initial deposit of 100uatom is required in e2e tests, otherwise the proposal would be dropped
166+
func (s *IntegrationTestSuite) submitGovProposal(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string) {
164167
s.T().Logf("Submitting Gov Proposal: %s", proposalType)
165-
// min deposit of 1000uatom is required in e2e tests, otherwise the gov antehandler causes the proposal to be dropped
166168
sflags := submitFlags
167-
if withDeposit {
168-
sflags = append(sflags, "--deposit=1000uatom")
169-
}
170169
s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "submit-proposal", sflags, govtypesv1beta1.StatusDepositPeriod)
171170
s.T().Logf("Depositing Gov Proposal: %s", proposalType)
172171
s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "deposit", depositFlags, govtypesv1beta1.StatusVotingPeriod)

tests/e2e/e2e_lsm_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (s *IntegrationTestSuite) testLSM() {
3030
// gov proposing LSM parameters (global liquid staking cap, validator liquid staking cap, validator bond factor)
3131
s.T().Logf("Proposal number: %d", proposalCounter)
3232
s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: Set parameters (global liquid staking cap, validator liquid staking cap, validator bond factor)")
33-
s.submitGovProposal(chainEndpoint, validatorAAddr.String(), proposalCounter, "stakingtypes.MsgUpdateProposal", submitGovFlags, depositGovFlags, voteGovFlags, "vote", false)
33+
s.submitGovProposal(chainEndpoint, validatorAAddr.String(), proposalCounter, "stakingtypes.MsgUpdateProposal", submitGovFlags, depositGovFlags, voteGovFlags, "vote")
3434

3535
// query the proposal status and new fee
3636
s.Require().Eventually(

tests/e2e/e2e_setup_test.go

+22-20
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import (
4141
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
4242
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
4343
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
44-
govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
4544
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
4645
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
4746
)
@@ -874,25 +873,28 @@ func (s *IntegrationTestSuite) writeGovParamChangeProposalMaxTotalBypass(c *chai
874873
}
875874

876875
func (s *IntegrationTestSuite) writeGovCommunitySpendProposal(c *chain, amount sdk.Coin, recipient string) {
877-
msg := &distrtypes.MsgCommunityPoolSpend{
878-
Authority: govModuleAddress,
879-
Recipient: recipient,
880-
Amount: sdk.Coins{amount},
876+
template := `
877+
{
878+
"messages":[
879+
{
880+
"@type": "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend",
881+
"authority": "%s",
882+
"recipient": "%s",
883+
"amount": [{
884+
"denom": "%s",
885+
"amount": "%s"
886+
}]
887+
}
888+
],
889+
"deposit": "100uatom",
890+
"proposer": "Proposing validator address",
891+
"metadata": "Community Pool Spend",
892+
"title": "Fund Team!",
893+
"summary": "summary"
881894
}
882-
883-
proposalCommSpend, err := govv1.NewMsgSubmitProposal(
884-
[]sdk.Msg{msg},
885-
sdk.Coins{sdk.NewCoin(uatomDenom, sdk.NewInt(100))},
886-
"JohnGalt",
887-
"Community Pool Spend",
888-
"Fund Team!",
889-
"summary",
890-
)
891-
s.Require().NoError(err)
892-
res, err := cdc.MarshalInterfaceJSON(proposalCommSpend)
893-
s.Require().NoError(err)
894-
895-
err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalCommunitySpendFilename), res)
895+
`
896+
propMsgBody := fmt.Sprintf(template, govModuleAddress, recipient, amount.Denom, amount.Amount.String())
897+
err := writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalCommunitySpendFilename), []byte(propMsgBody))
896898
s.Require().NoError(err)
897899
}
898900

@@ -931,7 +933,7 @@ func (s *IntegrationTestSuite) writeLiquidStakingParamsUpdateProposal(c *chain,
931933
}
932934
],
933935
"metadata": "ipfs://CID",
934-
"deposit": "0uatom",
936+
"deposit": "100uatom",
935937
"title": "Update LSM Params",
936938
"summary": "e2e-test updating LSM staking params"
937939
}`

0 commit comments

Comments
 (0)