Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: upgrade sdk to 0.52 #206

Merged
merged 7 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions e2e/interchaintestv8/chainconfig/chain_config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package chainconfig

import (
interchaintest "github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
interchaintest "github.com/strangelove-ventures/interchaintest/v9"
"github.com/strangelove-ventures/interchaintest/v9/ibc"
)

var DefaultChainSpecs = []*interchaintest.ChainSpec{
Expand All @@ -19,7 +19,7 @@ func IbcGoChainSpec(name, chainId string) *interchaintest.ChainSpec {
Images: []ibc.DockerImage{
{
Repository: "ghcr.io/cosmos/ibc-go-wasm-simd", // FOR LOCAL IMAGE USE: Docker Image Name
Version: "feat-ibc-eureka", // FOR LOCAL IMAGE USE: Docker Image Tag
Version: "gjermund-fix-wasm-dockerfile", // FOR LOCAL IMAGE USE: Docker Image Tag
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be changed back after cosmos/ibc-go#7830 is merged

UidGid: "1025:1025",
},
},
Expand All @@ -28,7 +28,7 @@ func IbcGoChainSpec(name, chainId string) *interchaintest.ChainSpec {
Denom: "stake",
GasPrices: "0.00stake",
GasAdjustment: 1.3,
EncodingConfig: CosmosEncodingConfig(),
EncodingConfig: SDKEncodingConfig(),
ModifyGenesis: defaultModifyGenesis(),
TrustingPeriod: "508h",
NoHostMount: false,
Expand Down
132 changes: 51 additions & 81 deletions e2e/interchaintestv8/chainconfig/encoding.go
Original file line number Diff line number Diff line change
@@ -1,33 +1,22 @@
package chainconfig

import (
"github.com/cosmos/gogoproto/proto"

txsigning "cosmossdk.io/x/tx/signing"
"cosmossdk.io/x/authz"
banktypes "cosmossdk.io/x/bank/types"
govv1 "cosmossdk.io/x/gov/types/v1"
govv1beta1 "cosmossdk.io/x/gov/types/v1beta1"
grouptypes "cosmossdk.io/x/group"
proposaltypes "cosmossdk.io/x/params/types/proposal"
upgradetypes "cosmossdk.io/x/upgrade/types"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/address"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
sdktestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/authz"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
grouptypes "github.com/cosmos/cosmos-sdk/x/group"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
proposaltypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

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

// CosmosEncodingConfig returns the global E2E encoding config for simd.
func CosmosEncodingConfig() *sdktestutil.TestEncodingConfig {
return encodingConfig("cosmos")
// Codec returns the global E2E protobuf codec.
func Codec() *codec.ProtoCodec {
cdc, _ := codecAndEncodingConfig()
return cdc
}

// EncodingConfig returns the global E2E encoding config.
// It includes CosmosSDK, IBC, and Wasm messages
func encodingConfig(bech32Prefix string) *sdktestutil.TestEncodingConfig {
amino := codec.NewLegacyAmino()
interfaceRegistry, err := codectypes.NewInterfaceRegistryWithOptions(codectypes.InterfaceRegistryOptions{
ProtoFiles: proto.HybridResolver,
SigningOptions: txsigning.Options{
AddressCodec: address.Bech32Codec{
Bech32Prefix: bech32Prefix,
},
ValidatorAddressCodec: address.Bech32Codec{
Bech32Prefix: bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator,
},
},
})
if err != nil {
panic(err)
// SDKEncodingConfig returns the global E2E encoding config.
func SDKEncodingConfig() *sdktestutil.TestEncodingConfig {
_, cfg := codecAndEncodingConfig()
return &sdktestutil.TestEncodingConfig{
InterfaceRegistry: cfg.InterfaceRegistry,
Codec: cfg.Codec,
TxConfig: cfg.TxConfig,
Amino: cfg.Amino,
}
}

// ibc types
icacontrollertypes.RegisterInterfaces(interfaceRegistry)
icahosttypes.RegisterInterfaces(interfaceRegistry)
feetypes.RegisterInterfaces(interfaceRegistry)
transfertypes.RegisterInterfaces(interfaceRegistry)
v7migrations.RegisterInterfaces(interfaceRegistry)
clienttypes.RegisterInterfaces(interfaceRegistry)
connectiontypes.RegisterInterfaces(interfaceRegistry)
channeltypes.RegisterInterfaces(interfaceRegistry)
channeltypesv2.RegisterInterfaces(interfaceRegistry)
solomachine.RegisterInterfaces(interfaceRegistry)
ibctmtypes.RegisterInterfaces(interfaceRegistry)
ibcwasmtypes.RegisterInterfaces(interfaceRegistry)

// sdk types
upgradetypes.RegisterInterfaces(interfaceRegistry)
banktypes.RegisterInterfaces(interfaceRegistry)
govv1beta1.RegisterInterfaces(interfaceRegistry)
govv1.RegisterInterfaces(interfaceRegistry)
authtypes.RegisterInterfaces(interfaceRegistry)
cryptocodec.RegisterInterfaces(interfaceRegistry)
grouptypes.RegisterInterfaces(interfaceRegistry)
proposaltypes.RegisterInterfaces(interfaceRegistry)
authz.RegisterInterfaces(interfaceRegistry)
txtypes.RegisterInterfaces(interfaceRegistry)
stakingtypes.RegisterInterfaces(interfaceRegistry)
minttypes.RegisterInterfaces(interfaceRegistry)
distrtypes.RegisterInterfaces(interfaceRegistry)
slashingtypes.RegisterInterfaces(interfaceRegistry)
consensustypes.RegisterInterfaces(interfaceRegistry)

// custom module types
ibcwasmtypes.RegisterInterfaces(interfaceRegistry)

cdc := codec.NewProtoCodec(interfaceRegistry)
// codecAndEncodingConfig returns the codec and encoding config used in the E2E tests.
// Note: any new types added to the codec must be added here.
func codecAndEncodingConfig() (*codec.ProtoCodec, sdktestutil.TestEncodingConfig) {
cfg := sdktestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{})

cfg := &sdktestutil.TestEncodingConfig{
InterfaceRegistry: interfaceRegistry,
Codec: cdc,
TxConfig: authtx.NewTxConfig(cdc, authtx.DefaultSignModes),
Amino: amino,
}
// ibc types
icacontrollertypes.RegisterInterfaces(cfg.InterfaceRegistry)
icahosttypes.RegisterInterfaces(cfg.InterfaceRegistry)
feetypes.RegisterInterfaces(cfg.InterfaceRegistry)
solomachine.RegisterInterfaces(cfg.InterfaceRegistry)
v7migrations.RegisterInterfaces(cfg.InterfaceRegistry)
transfertypes.RegisterInterfaces(cfg.InterfaceRegistry)
clienttypes.RegisterInterfaces(cfg.InterfaceRegistry)
channeltypes.RegisterInterfaces(cfg.InterfaceRegistry)
connectiontypes.RegisterInterfaces(cfg.InterfaceRegistry)
ibctmtypes.RegisterInterfaces(cfg.InterfaceRegistry)
wasmtypes.RegisterInterfaces(cfg.InterfaceRegistry)
channeltypesv2.RegisterInterfaces(cfg.InterfaceRegistry)

return cfg
// all other types
upgradetypes.RegisterInterfaces(cfg.InterfaceRegistry)
banktypes.RegisterInterfaces(cfg.InterfaceRegistry)
govv1beta1.RegisterInterfaces(cfg.InterfaceRegistry)
govv1.RegisterInterfaces(cfg.InterfaceRegistry)
authtypes.RegisterInterfaces(cfg.InterfaceRegistry)
cryptocodec.RegisterInterfaces(cfg.InterfaceRegistry)
grouptypes.RegisterInterfaces(cfg.InterfaceRegistry)
proposaltypes.RegisterInterfaces(cfg.InterfaceRegistry)
authz.RegisterInterfaces(cfg.InterfaceRegistry)
txtypes.RegisterInterfaces(cfg.InterfaceRegistry)
cdc := codec.NewProtoCodec(cfg.InterfaceRegistry)
return cdc, cfg
}
9 changes: 5 additions & 4 deletions e2e/interchaintestv8/chainconfig/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import (
"encoding/json"
"fmt"

govtypes "cosmossdk.io/x/gov/types"
govv1 "cosmossdk.io/x/gov/types/v1"

sdk "github.com/cosmos/cosmos-sdk/types"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"

"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v9/ibc"

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

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

govGenesisState := &govv1.GenesisState{}
if err := cdc.UnmarshalJSON(govAppState, govGenesisState); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion e2e/interchaintestv8/chainconfig/kurtosis.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
ethcommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"

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

"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/ethereum"
)
Expand Down
2 changes: 1 addition & 1 deletion e2e/interchaintestv8/cosmos/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package cosmos

import (
"cosmossdk.io/collections"
banktypes "cosmossdk.io/x/bank/types"

sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
)

// CloneAppend returns a new slice with the contents of the provided slices.
Expand Down
6 changes: 3 additions & 3 deletions e2e/interchaintestv8/cosmos_relayer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"github.com/stretchr/testify/suite"

sdkmath "cosmossdk.io/math"
banktypes "cosmossdk.io/x/bank/types"

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"

transfertypes "github.com/cosmos/ibc-go/v9/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types"
Expand All @@ -28,8 +28,8 @@ import (
ibctm "github.com/cosmos/ibc-go/v9/modules/light-clients/07-tendermint"
ibctesting "github.com/cosmos/ibc-go/v9/testing"

"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v9/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v9/ibc"

"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/chainconfig"
"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/e2esuite"
Expand Down
10 changes: 5 additions & 5 deletions e2e/interchaintestv8/e2esuite/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

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

"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v9/chain/cosmos"
)

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

func ABCIQuery(ctx context.Context, chain *cosmos.CosmosChain, req *abci.RequestQuery) (*abci.ResponseQuery, error) {
func ABCIQuery(ctx context.Context, chain *cosmos.CosmosChain, req *abci.QueryRequest) (*abci.QueryResponse, error) {
// Create a connection to the gRPC server.
grpcConn, err := grpc.Dial(
chain.GetHostGRPCAddress(),
grpc.WithTransportCredentials(insecure.NewCredentials()),
)
if err != nil {
return &abci.ResponseQuery{}, err
return &abci.QueryResponse{}, err
}

defer grpcConn.Close()

resp := &abci.ResponseQuery{}
resp := &abci.QueryResponse{}
err = grpcConn.Invoke(ctx, "cosmos.base.tendermint.v1beta1.Service/ABCIQuery", req, resp)
if err != nil {
return &abci.ResponseQuery{}, err
return &abci.QueryResponse{}, err
}

return resp, nil
Expand Down
4 changes: 2 additions & 2 deletions e2e/interchaintestv8/e2esuite/light_clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types"
ibctesting "github.com/cosmos/ibc-go/v9/testing"

"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
"github.com/strangelove-ventures/interchaintest/v9/ibc"
"github.com/strangelove-ventures/interchaintest/v9/testutil"

"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/ethereum"
"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/testvalues"
Expand Down
18 changes: 8 additions & 10 deletions e2e/interchaintestv8/e2esuite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ import (
ethcommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"

sdkmath "cosmossdk.io/math"

interchaintest "github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
icethereum "github.com/strangelove-ventures/interchaintest/v8/chain/ethereum"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/testreporter"
interchaintest "github.com/strangelove-ventures/interchaintest/v9"
"github.com/strangelove-ventures/interchaintest/v9/chain/cosmos"
icethereum "github.com/strangelove-ventures/interchaintest/v9/chain/ethereum"
"github.com/strangelove-ventures/interchaintest/v9/ibc"
"github.com/strangelove-ventures/interchaintest/v9/testreporter"

"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/chainconfig"
"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/ethereum"
Expand Down Expand Up @@ -117,9 +115,9 @@ func (s *TestSuite) SetupSuite(ctx context.Context) {
s.Require().NoError(populateQueryReqToPath(ctx, s.CosmosChains[0]))

// Fund user accounts
cosmosUserFunds := sdkmath.NewInt(testvalues.InitialBalance)
cosmosUsers := interchaintest.GetAndFundTestUsers(s.T(), ctx, s.T().Name(), cosmosUserFunds, chains...)
s.CosmosUsers = cosmosUsers
for _, chain := range chains {
s.CosmosUsers = append(s.CosmosUsers, s.CreateAndFundCosmosUser(ctx, chain.(*cosmos.CosmosChain)))
}

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