Skip to content

Commit 1aef157

Browse files
Revert "deps(e2e): upgrade sdk to 0.52 (#206)"
This reverts commit f639c91.
1 parent 0e1a8d1 commit 1aef157

File tree

19 files changed

+755
-568
lines changed

19 files changed

+755
-568
lines changed

e2e/interchaintestv8/chainconfig/chain_config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package chainconfig
22

33
import (
4-
interchaintest "github.com/strangelove-ventures/interchaintest/v9"
5-
"github.com/strangelove-ventures/interchaintest/v9/ibc"
4+
interchaintest "github.com/strangelove-ventures/interchaintest/v8"
5+
"github.com/strangelove-ventures/interchaintest/v8/ibc"
66
)
77

88
var DefaultChainSpecs = []*interchaintest.ChainSpec{
@@ -28,7 +28,7 @@ func IbcGoChainSpec(name, chainId string) *interchaintest.ChainSpec {
2828
Denom: "stake",
2929
GasPrices: "0.00stake",
3030
GasAdjustment: 1.3,
31-
EncodingConfig: SDKEncodingConfig(),
31+
EncodingConfig: CosmosEncodingConfig(),
3232
ModifyGenesis: defaultModifyGenesis(),
3333
TrustingPeriod: "508h",
3434
NoHostMount: false,
Lines changed: 81 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
11
package chainconfig
22

33
import (
4-
"cosmossdk.io/x/authz"
5-
banktypes "cosmossdk.io/x/bank/types"
6-
govv1 "cosmossdk.io/x/gov/types/v1"
7-
govv1beta1 "cosmossdk.io/x/gov/types/v1beta1"
8-
grouptypes "cosmossdk.io/x/group"
9-
proposaltypes "cosmossdk.io/x/params/types/proposal"
4+
"github.com/cosmos/gogoproto/proto"
5+
6+
txsigning "cosmossdk.io/x/tx/signing"
107
upgradetypes "cosmossdk.io/x/upgrade/types"
118

129
"github.com/cosmos/cosmos-sdk/codec"
13-
codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil"
10+
"github.com/cosmos/cosmos-sdk/codec/address"
11+
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
1412
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
13+
sdk "github.com/cosmos/cosmos-sdk/types"
1514
sdktestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
1615
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
16+
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
1717
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
18+
"github.com/cosmos/cosmos-sdk/x/authz"
19+
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
20+
consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
21+
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
22+
govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
23+
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
24+
grouptypes "github.com/cosmos/cosmos-sdk/x/group"
25+
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
26+
proposaltypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
27+
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
28+
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
1829

19-
wasmtypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"
30+
ibcwasmtypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"
2031
icacontrollertypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/controller/types"
2132
icahosttypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/host/types"
2233
feetypes "github.com/cosmos/ibc-go/v9/modules/apps/29-fee/types"
@@ -30,53 +41,72 @@ import (
3041
ibctmtypes "github.com/cosmos/ibc-go/v9/modules/light-clients/07-tendermint"
3142
)
3243

33-
// Codec returns the global E2E protobuf codec.
34-
func Codec() *codec.ProtoCodec {
35-
cdc, _ := codecAndEncodingConfig()
36-
return cdc
44+
// CosmosEncodingConfig returns the global E2E encoding config for simd.
45+
func CosmosEncodingConfig() *sdktestutil.TestEncodingConfig {
46+
return encodingConfig("cosmos")
3747
}
3848

39-
// SDKEncodingConfig returns the global E2E encoding config.
40-
func SDKEncodingConfig() *sdktestutil.TestEncodingConfig {
41-
_, cfg := codecAndEncodingConfig()
42-
return &sdktestutil.TestEncodingConfig{
43-
InterfaceRegistry: cfg.InterfaceRegistry,
44-
Codec: cfg.Codec,
45-
TxConfig: cfg.TxConfig,
46-
Amino: cfg.Amino,
49+
// EncodingConfig returns the global E2E encoding config.
50+
// It includes CosmosSDK, IBC, and Wasm messages
51+
func encodingConfig(bech32Prefix string) *sdktestutil.TestEncodingConfig {
52+
amino := codec.NewLegacyAmino()
53+
interfaceRegistry, err := codectypes.NewInterfaceRegistryWithOptions(codectypes.InterfaceRegistryOptions{
54+
ProtoFiles: proto.HybridResolver,
55+
SigningOptions: txsigning.Options{
56+
AddressCodec: address.Bech32Codec{
57+
Bech32Prefix: bech32Prefix,
58+
},
59+
ValidatorAddressCodec: address.Bech32Codec{
60+
Bech32Prefix: bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator,
61+
},
62+
},
63+
})
64+
if err != nil {
65+
panic(err)
4766
}
48-
}
49-
50-
// codecAndEncodingConfig returns the codec and encoding config used in the E2E tests.
51-
// Note: any new types added to the codec must be added here.
52-
func codecAndEncodingConfig() (*codec.ProtoCodec, sdktestutil.TestEncodingConfig) {
53-
cfg := sdktestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{})
5467

5568
// ibc types
56-
icacontrollertypes.RegisterInterfaces(cfg.InterfaceRegistry)
57-
icahosttypes.RegisterInterfaces(cfg.InterfaceRegistry)
58-
feetypes.RegisterInterfaces(cfg.InterfaceRegistry)
59-
solomachine.RegisterInterfaces(cfg.InterfaceRegistry)
60-
v7migrations.RegisterInterfaces(cfg.InterfaceRegistry)
61-
transfertypes.RegisterInterfaces(cfg.InterfaceRegistry)
62-
clienttypes.RegisterInterfaces(cfg.InterfaceRegistry)
63-
channeltypes.RegisterInterfaces(cfg.InterfaceRegistry)
64-
connectiontypes.RegisterInterfaces(cfg.InterfaceRegistry)
65-
ibctmtypes.RegisterInterfaces(cfg.InterfaceRegistry)
66-
wasmtypes.RegisterInterfaces(cfg.InterfaceRegistry)
67-
channeltypesv2.RegisterInterfaces(cfg.InterfaceRegistry)
69+
icacontrollertypes.RegisterInterfaces(interfaceRegistry)
70+
icahosttypes.RegisterInterfaces(interfaceRegistry)
71+
feetypes.RegisterInterfaces(interfaceRegistry)
72+
transfertypes.RegisterInterfaces(interfaceRegistry)
73+
v7migrations.RegisterInterfaces(interfaceRegistry)
74+
clienttypes.RegisterInterfaces(interfaceRegistry)
75+
connectiontypes.RegisterInterfaces(interfaceRegistry)
76+
channeltypes.RegisterInterfaces(interfaceRegistry)
77+
channeltypesv2.RegisterInterfaces(interfaceRegistry)
78+
solomachine.RegisterInterfaces(interfaceRegistry)
79+
ibctmtypes.RegisterInterfaces(interfaceRegistry)
80+
ibcwasmtypes.RegisterInterfaces(interfaceRegistry)
81+
82+
// sdk types
83+
upgradetypes.RegisterInterfaces(interfaceRegistry)
84+
banktypes.RegisterInterfaces(interfaceRegistry)
85+
govv1beta1.RegisterInterfaces(interfaceRegistry)
86+
govv1.RegisterInterfaces(interfaceRegistry)
87+
authtypes.RegisterInterfaces(interfaceRegistry)
88+
cryptocodec.RegisterInterfaces(interfaceRegistry)
89+
grouptypes.RegisterInterfaces(interfaceRegistry)
90+
proposaltypes.RegisterInterfaces(interfaceRegistry)
91+
authz.RegisterInterfaces(interfaceRegistry)
92+
txtypes.RegisterInterfaces(interfaceRegistry)
93+
stakingtypes.RegisterInterfaces(interfaceRegistry)
94+
minttypes.RegisterInterfaces(interfaceRegistry)
95+
distrtypes.RegisterInterfaces(interfaceRegistry)
96+
slashingtypes.RegisterInterfaces(interfaceRegistry)
97+
consensustypes.RegisterInterfaces(interfaceRegistry)
98+
99+
// custom module types
100+
ibcwasmtypes.RegisterInterfaces(interfaceRegistry)
101+
102+
cdc := codec.NewProtoCodec(interfaceRegistry)
103+
104+
cfg := &sdktestutil.TestEncodingConfig{
105+
InterfaceRegistry: interfaceRegistry,
106+
Codec: cdc,
107+
TxConfig: authtx.NewTxConfig(cdc, authtx.DefaultSignModes),
108+
Amino: amino,
109+
}
68110

69-
// all other types
70-
upgradetypes.RegisterInterfaces(cfg.InterfaceRegistry)
71-
banktypes.RegisterInterfaces(cfg.InterfaceRegistry)
72-
govv1beta1.RegisterInterfaces(cfg.InterfaceRegistry)
73-
govv1.RegisterInterfaces(cfg.InterfaceRegistry)
74-
authtypes.RegisterInterfaces(cfg.InterfaceRegistry)
75-
cryptocodec.RegisterInterfaces(cfg.InterfaceRegistry)
76-
grouptypes.RegisterInterfaces(cfg.InterfaceRegistry)
77-
proposaltypes.RegisterInterfaces(cfg.InterfaceRegistry)
78-
authz.RegisterInterfaces(cfg.InterfaceRegistry)
79-
txtypes.RegisterInterfaces(cfg.InterfaceRegistry)
80-
cdc := codec.NewProtoCodec(cfg.InterfaceRegistry)
81-
return cdc, cfg
111+
return cfg
82112
}

e2e/interchaintestv8/chainconfig/genesis.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ import (
55
"encoding/json"
66
"fmt"
77

8-
govtypes "cosmossdk.io/x/gov/types"
9-
govv1 "cosmossdk.io/x/gov/types/v1"
10-
118
sdk "github.com/cosmos/cosmos-sdk/types"
129
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
10+
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
11+
govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
1312

14-
"github.com/strangelove-ventures/interchaintest/v9/ibc"
13+
"github.com/strangelove-ventures/interchaintest/v8/ibc"
1514

1615
"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/testvalues"
1716
)
@@ -53,7 +52,7 @@ func defaultModifyGenesis() func(ibc.ChainConfig, []byte) ([]byte, error) {
5352

5453
// modifyGovV1AppState takes the existing gov app state and marshals it to a govv1 GenesisState.
5554
func modifyGovV1AppState(chainConfig ibc.ChainConfig, govAppState []byte) ([]byte, error) {
56-
cdc := Codec()
55+
cdc := CosmosEncodingConfig().Codec
5756

5857
govGenesisState := &govv1.GenesisState{}
5958
if err := cdc.UnmarshalJSON(govAppState, govGenesisState); err != nil {

e2e/interchaintestv8/chainconfig/kurtosis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
ethcommon "github.com/ethereum/go-ethereum/common"
1616
"github.com/ethereum/go-ethereum/crypto"
1717

18-
"github.com/strangelove-ventures/interchaintest/v9/testutil"
18+
"github.com/strangelove-ventures/interchaintest/v8/testutil"
1919

2020
"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/ethereum"
2121
)

e2e/interchaintestv8/cosmos/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package cosmos
22

33
import (
44
"cosmossdk.io/collections"
5-
banktypes "cosmossdk.io/x/bank/types"
65

76
sdk "github.com/cosmos/cosmos-sdk/types"
7+
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
88
)
99

1010
// CloneAppend returns a new slice with the contents of the provided slices.

e2e/interchaintestv8/cosmos_relayer_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import (
1111
"github.com/stretchr/testify/suite"
1212

1313
sdkmath "cosmossdk.io/math"
14-
banktypes "cosmossdk.io/x/bank/types"
1514

1615
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
1716
sdk "github.com/cosmos/cosmos-sdk/types"
17+
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
1818

1919
transfertypes "github.com/cosmos/ibc-go/v9/modules/apps/transfer/types"
2020
clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types"
@@ -24,8 +24,8 @@ import (
2424
ibctm "github.com/cosmos/ibc-go/v9/modules/light-clients/07-tendermint"
2525
ibctesting "github.com/cosmos/ibc-go/v9/testing"
2626

27-
"github.com/strangelove-ventures/interchaintest/v9/chain/cosmos"
28-
"github.com/strangelove-ventures/interchaintest/v9/ibc"
27+
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
28+
"github.com/strangelove-ventures/interchaintest/v8/ibc"
2929

3030
"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/chainconfig"
3131
"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/e2esuite"

e2e/interchaintestv8/e2esuite/grpc_query.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
abci "github.com/cometbft/cometbft/abci/types"
1616

17-
"github.com/strangelove-ventures/interchaintest/v9/chain/cosmos"
17+
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
1818
)
1919

2020
var queryReqToPath = make(map[string]string)
@@ -42,22 +42,22 @@ func populateQueryReqToPath(ctx context.Context, chain *cosmos.CosmosChain) erro
4242
return nil
4343
}
4444

45-
func ABCIQuery(ctx context.Context, chain *cosmos.CosmosChain, req *abci.QueryRequest) (*abci.QueryResponse, error) {
45+
func ABCIQuery(ctx context.Context, chain *cosmos.CosmosChain, req *abci.RequestQuery) (*abci.ResponseQuery, error) {
4646
// Create a connection to the gRPC server.
4747
grpcConn, err := grpc.Dial(
4848
chain.GetHostGRPCAddress(),
4949
grpc.WithTransportCredentials(insecure.NewCredentials()),
5050
)
5151
if err != nil {
52-
return &abci.QueryResponse{}, err
52+
return &abci.ResponseQuery{}, err
5353
}
5454

5555
defer grpcConn.Close()
5656

57-
resp := &abci.QueryResponse{}
57+
resp := &abci.ResponseQuery{}
5858
err = grpcConn.Invoke(ctx, "cosmos.base.tendermint.v1beta1.Service/ABCIQuery", req, resp)
5959
if err != nil {
60-
return &abci.QueryResponse{}, err
60+
return &abci.ResponseQuery{}, err
6161
}
6262

6363
return resp, nil

e2e/interchaintestv8/e2esuite/light_clients.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types"
1515
ibctesting "github.com/cosmos/ibc-go/v9/testing"
1616

17-
"github.com/strangelove-ventures/interchaintest/v9/chain/cosmos"
18-
"github.com/strangelove-ventures/interchaintest/v9/ibc"
17+
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
18+
"github.com/strangelove-ventures/interchaintest/v8/ibc"
1919

2020
"github.com/cosmos/solidity-ibc-eureka/abigen/ics26router"
2121

e2e/interchaintestv8/e2esuite/suite.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ import (
1212
ethcommon "github.com/ethereum/go-ethereum/common"
1313
"github.com/ethereum/go-ethereum/crypto"
1414

15-
interchaintest "github.com/strangelove-ventures/interchaintest/v9"
16-
"github.com/strangelove-ventures/interchaintest/v9/chain/cosmos"
17-
icethereum "github.com/strangelove-ventures/interchaintest/v9/chain/ethereum"
18-
"github.com/strangelove-ventures/interchaintest/v9/ibc"
19-
"github.com/strangelove-ventures/interchaintest/v9/testreporter"
15+
sdkmath "cosmossdk.io/math"
16+
17+
interchaintest "github.com/strangelove-ventures/interchaintest/v8"
18+
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
19+
icethereum "github.com/strangelove-ventures/interchaintest/v8/chain/ethereum"
20+
"github.com/strangelove-ventures/interchaintest/v8/ibc"
21+
"github.com/strangelove-ventures/interchaintest/v8/testreporter"
2022

2123
"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/chainconfig"
2224
"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/ethereum"
@@ -111,9 +113,9 @@ func (s *TestSuite) SetupSuite(ctx context.Context) {
111113
s.Require().NoError(populateQueryReqToPath(ctx, s.CosmosChains[0]))
112114

113115
// Fund user accounts
114-
for _, chain := range chains {
115-
s.CosmosUsers = append(s.CosmosUsers, s.CreateAndFundCosmosUser(ctx, chain.(*cosmos.CosmosChain)))
116-
}
116+
cosmosUserFunds := sdkmath.NewInt(testvalues.InitialBalance)
117+
cosmosUsers := interchaintest.GetAndFundTestUsers(s.T(), ctx, s.T().Name(), cosmosUserFunds, chains...)
118+
s.CosmosUsers = cosmosUsers
117119

118120
s.proposalIDs = make(map[string]uint64)
119121
for _, chain := range s.CosmosChains {

0 commit comments

Comments
 (0)