Skip to content

Commit

Permalink
chore: remove legacy proposal types. (#6782)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisJim authored Jul 9, 2024
1 parent d2a579e commit e76766a
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 1,052 deletions.
29 changes: 0 additions & 29 deletions e2e/tests/core/02-client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func (s *ClientTestSuite) TestScheduleIBCUpgrade_Succeeds() {
chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount)

const planHeight = int64(300)
const legacyPlanHeight = planHeight * 2
var newChainID string

t.Run("execute proposal for MsgIBCSoftwareUpgrade", func(t *testing.T) {
Expand Down Expand Up @@ -130,34 +129,6 @@ func (s *ClientTestSuite) TestScheduleIBCUpgrade_Succeeds() {
s.Require().Equal("upgrade-client", plan.Name)
s.Require().Equal(planHeight, plan.Height)
})

t.Run("ensure legacy proposal does not succeed", func(t *testing.T) {
authority, err := query.ModuleAccountAddress(ctx, govtypes.ModuleName, chainA)
s.Require().NoError(err)
s.Require().NotNil(authority)

clientState, err := query.ClientState(ctx, chainB, ibctesting.FirstClientID)
s.Require().NoError(err)

originalChainID := clientState.(*ibctm.ClientState).ChainId
revisionNumber := clienttypes.ParseChainID(originalChainID)
// increment revision number even with new chain ID to prevent loss of misbehaviour detection support
newChainID, err = clienttypes.SetRevisionNumber(originalChainID, revisionNumber+1)
s.Require().NoError(err)
s.Require().NotEqual(originalChainID, newChainID)

upgradedClientState := clientState.(*ibctm.ClientState).ZeroCustomFields()
upgradedClientState.ChainId = newChainID

legacyUpgradeProposal, err := clienttypes.NewUpgradeProposal(ibctesting.Title, ibctesting.Description, upgradetypes.Plan{
Name: "upgrade-client-legacy",
Height: legacyPlanHeight,
}, upgradedClientState)

s.Require().NoError(err)
txResp := s.ExecuteGovV1Beta1Proposal(ctx, chainA, chainAWallet, legacyUpgradeProposal)
s.AssertTxFailure(txResp, govtypes.ErrInvalidProposalContent)
})
}

// TestRecoverClient_Succeeds tests that a governance proposal to recover a client using a MsgRecoverClient is successful.
Expand Down
4 changes: 0 additions & 4 deletions e2e/tests/wasm/feature_releases.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ package wasm

import "github.com/cosmos/ibc-go/e2e/semverutil"

var govV1FeatureReleases = semverutil.FeatureReleases{
MajorVersion: "v8",
}

var govV1FailedReasonFeatureReleases = semverutil.FeatureReleases{
MajorVersion: "v8",
}
19 changes: 6 additions & 13 deletions e2e/tests/wasm/grandpa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
ibctesting "github.com/cosmos/ibc-go/v8/testing"
)

const (
Expand Down Expand Up @@ -548,19 +547,13 @@ func (s *GrandpaTestSuite) TestRecoverClient_Succeeds_GrandpaContract() {
s.Require().NoError(err)
s.Require().Equal(ibcexported.Active.String(), status, "unexpected substitute client status")

version := cosmosChain.Nodes()[0].Image.Version
if govV1FeatureReleases.IsSupported(version) {
// create and execute a client recovery proposal
authority, err := query.ModuleAccountAddress(ctx, govtypes.ModuleName, cosmosChain)
s.Require().NoError(err)
// create and execute a client recovery proposal
authority, err := query.ModuleAccountAddress(ctx, govtypes.ModuleName, cosmosChain)
s.Require().NoError(err)

msgRecoverClient := clienttypes.NewMsgRecoverClient(authority.String(), subjectClientID, substituteClientID)
s.Require().NotNil(msgRecoverClient)
s.ExecuteAndPassGovV1Proposal(ctx, msgRecoverClient, cosmosChain, cosmosUser)
} else {
proposal := clienttypes.NewClientUpdateProposal(ibctesting.Title, ibctesting.Description, subjectClientID, substituteClientID)
s.ExecuteAndPassGovV1Beta1Proposal(ctx, cosmosChain, cosmosWallet, proposal)
}
msgRecoverClient := clienttypes.NewMsgRecoverClient(authority.String(), subjectClientID, substituteClientID)
s.Require().NotNil(msgRecoverClient)
s.ExecuteAndPassGovV1Proposal(ctx, msgRecoverClient, cosmosChain, cosmosUser)

// ensure subject client is active
status, err = query.ClientStatus(ctx, cosmosChain, subjectClientID)
Expand Down
Loading

0 comments on commit e76766a

Please sign in to comment.