Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 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/v9"
"github.com/strangelove-ventures/interchaintest/v9/ibc"
interchaintest "github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
)

var DefaultChainSpecs = []*interchaintest.ChainSpec{
Expand Down
19 changes: 9 additions & 10 deletions e2e/interchaintestv8/chainconfig/encoding.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
package chainconfig

import (
"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"
codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
sdktestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
txtypes "github.com/cosmos/cosmos-sdk/types/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"
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"
proposaltypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal"

wasmtypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"
ibcwasmtypes "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 Down Expand Up @@ -50,7 +49,7 @@ func SDKEncodingConfig() *sdktestutil.TestEncodingConfig {
// 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.MakeTestEncodingConfig()

// ibc types
icacontrollertypes.RegisterInterfaces(cfg.InterfaceRegistry)
Expand All @@ -63,7 +62,7 @@ func codecAndEncodingConfig() (*codec.ProtoCodec, sdktestutil.TestEncodingConfig
channeltypes.RegisterInterfaces(cfg.InterfaceRegistry)
connectiontypes.RegisterInterfaces(cfg.InterfaceRegistry)
ibctmtypes.RegisterInterfaces(cfg.InterfaceRegistry)
wasmtypes.RegisterInterfaces(cfg.InterfaceRegistry)
ibcwasmtypes.RegisterInterfaces(cfg.InterfaceRegistry)
channeltypesv2.RegisterInterfaces(cfg.InterfaceRegistry)

// all other types
Expand Down
9 changes: 4 additions & 5 deletions e2e/interchaintestv8/chainconfig/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ 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/v9/ibc"
"github.com/strangelove-ventures/interchaintest/v8/ibc"

"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/testvalues"
)
Expand Down Expand Up @@ -53,7 +52,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 := Codec()
cdc := SDKEncodingConfig().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/v9/testutil"
"github.com/strangelove-ventures/interchaintest/v8/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 @@ -11,10 +11,10 @@ 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"
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 @@ -24,8 +24,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/v9/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v9/ibc"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/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/v9/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/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.QueryRequest) (*abci.QueryResponse, error) {
func ABCIQuery(ctx context.Context, chain *cosmos.CosmosChain, req *abci.RequestQuery) (*abci.ResponseQuery, error) {
// Create a connection to the gRPC server.
grpcConn, err := grpc.Dial(
chain.GetHostGRPCAddress(),
grpc.WithTransportCredentials(insecure.NewCredentials()),
)
if err != nil {
return &abci.QueryResponse{}, err
return &abci.ResponseQuery{}, err
}

defer grpcConn.Close()

resp := &abci.QueryResponse{}
resp := &abci.ResponseQuery{}
err = grpcConn.Invoke(ctx, "cosmos.base.tendermint.v1beta1.Service/ABCIQuery", req, resp)
if err != nil {
return &abci.QueryResponse{}, err
return &abci.ResponseQuery{}, 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 @@ -14,8 +14,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/v9/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v9/ibc"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"

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

Expand Down
10 changes: 5 additions & 5 deletions e2e/interchaintestv8/e2esuite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
ethcommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"

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"
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"

"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/chainconfig"
"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/ethereum"
Expand Down
65 changes: 28 additions & 37 deletions e2e/interchaintestv8/e2esuite/utils.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package e2esuite

import (
"bytes"
"context"
"crypto/ecdsa"
"crypto/sha256"
Expand All @@ -22,18 +21,19 @@ import (

errorsmod "cosmossdk.io/errors"
sdkmath "cosmossdk.io/math"
govtypes "cosmossdk.io/x/gov/types"
govtypesv1 "cosmossdk.io/x/gov/types/v1"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"
"github.com/cosmos/cosmos-sdk/client/tx"
sdk "github.com/cosmos/cosmos-sdk/types"
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"

"github.com/cometbft/cometbft/crypto/ed25519"
"github.com/cometbft/cometbft/crypto/tmhash"
cometproto "github.com/cometbft/cometbft/proto/tendermint/types"
comettypes "github.com/cometbft/cometbft/types"
comettime "github.com/cometbft/cometbft/types/time"

Expand All @@ -43,10 +43,10 @@ import (
tmclient "github.com/cosmos/ibc-go/v9/modules/light-clients/07-tendermint"
ibctesting "github.com/cosmos/ibc-go/v9/testing"

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

"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/ethereum"
"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/testvalues"
Expand All @@ -56,17 +56,19 @@ import (
// BroadcastMessages broadcasts the provided messages to the given chain and signs them on behalf of the provided user.
// Once the broadcast response is returned, we wait for two blocks to be created on chain.
func (s *TestSuite) BroadcastMessages(ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, gas uint64, msgs ...sdk.Msg) (*sdk.TxResponse, error) {
sdk.GetConfig().SetBech32PrefixForAccount(chain.Config().Bech32Prefix, chain.Config().Bech32Prefix+sdk.PrefixPublic)
sdk.GetConfig().SetBech32PrefixForValidator(
chain.Config().Bech32Prefix+sdk.PrefixValidator+sdk.PrefixOperator,
chain.Config().Bech32Prefix+sdk.PrefixValidator+sdk.PrefixOperator+sdk.PrefixPublic,
)

broadcaster := cosmos.NewBroadcaster(s.T(), chain)

broadcaster.ConfigureClientContextOptions(func(clientContext client.Context) client.Context {
txConfig := chain.Config().EncodingConfig.TxConfig
return clientContext.WithCodec(chain.Config().EncodingConfig.Codec).
WithTxConfig(txConfig).
WithAddressCodec(txConfig.SigningContext().AddressCodec()).
WithValidatorAddressCodec(txConfig.SigningContext().ValidatorAddressCodec()).
WithAddressPrefix(chain.Config().Bech32Prefix).
WithAddressCodec(txConfig.SigningContext().AddressCodec()).
WithValidatorAddressCodec(txConfig.SigningContext().ValidatorAddressCodec())
return clientContext.
WithCodec(chain.Config().EncodingConfig.Codec).
WithChainID(chain.Config().ChainID).
WithTxConfig(chain.Config().EncodingConfig.TxConfig)
})

broadcaster.ConfigureFactoryOptions(func(factory tx.Factory) tx.Factory {
Expand All @@ -91,20 +93,9 @@ func (s *TestSuite) BroadcastMessages(ctx context.Context, chain *cosmos.CosmosC
// CreateAndFundCosmosUser returns a new cosmos user with the given initial balance and funds it with the native chain denom.
func (s *TestSuite) CreateAndFundCosmosUser(ctx context.Context, chain *cosmos.CosmosChain) ibc.Wallet {
cosmosUserFunds := sdkmath.NewInt(testvalues.InitialBalance)
cosmosUser := interchaintest.GetAndFundTestUsers(s.T(), ctx, s.T().Name(), cosmosUserFunds, chain)[0]

// in order to ensure that the underlying account is created, we need to perform an operation on its behalf.
// in this case we just send 1 token to itself so the account gets created.
err := chain.SendFunds(ctx, cosmosUser.KeyName(), ibc.WalletAmount{
Address: cosmosUser.FormattedAddress(),
Denom: chain.Config().Denom,
Amount: sdkmath.NewInt(1),
})

s.Require().NoError(err)
s.Require().NoError(testutil.WaitForBlocks(ctx, 2, chain))
cosmosUsers := interchaintest.GetAndFundTestUsers(s.T(), ctx, s.T().Name(), cosmosUserFunds, chain)

return cosmosUser
return cosmosUsers[0]
}

// GetEvmEvent parses the logs in the given receipt and returns the first event that can be parsed
Expand Down Expand Up @@ -185,7 +176,7 @@ func (s *TestSuite) ExecuteGovV1Proposal(ctx context.Context, msg sdk.Msg, cosmo
"",
fmt.Sprintf("e2e gov proposal: %d", proposalID),
fmt.Sprintf("executing gov proposal %d", proposalID),
govtypesv1.ProposalType_PROPOSAL_TYPE_STANDARD,
false,
)
s.Require().NoError(err)

Expand Down Expand Up @@ -293,7 +284,7 @@ func (s *TestSuite) CreateTMClientHeader(
pk, err := pv.GetPubKey()
s.Require().NoError(err)

if bytes.Equal(pk.Bytes(), val.PubKey.Bytes()) {
if pk.Equals(val.PubKey) {
signers[i] = pv
break
}
Expand Down Expand Up @@ -323,15 +314,15 @@ func (s *TestSuite) CreateTMClientHeader(

hhash := tmHeader.Hash()
blockID := ibctesting.MakeBlockID(hhash, oldHeader.Commit.BlockID.PartSetHeader.Total, tmhash.Sum([]byte("part_set")))
voteSet := comettypes.NewVoteSet(oldHeader.Header.ChainID, blockHeight, 1, comettypes.PrecommitType, valSet)
voteSet := comettypes.NewVoteSet(oldHeader.Header.ChainID, blockHeight, 1, cometproto.PrecommitType, valSet)

voteProto := &comettypes.Vote{
ValidatorAddress: nil,
ValidatorIndex: -1,
Height: blockHeight,
Round: 1,
Timestamp: comettime.Now(),
Type: comettypes.PrecommitType,
Type: cometproto.PrecommitType,
BlockID: blockID,
}

Expand All @@ -348,19 +339,19 @@ func (s *TestSuite) CreateTMClientHeader(
s.Require().NoError(err)
s.Require().True(added)
}
extCommit := voteSet.MakeExtendedCommit(comettypes.DefaultFeatureParams())
extCommit := voteSet.MakeExtendedCommit(comettypes.DefaultABCIParams())
commit := extCommit.ToCommit()

signedHeader := &comettypes.SignedHeader{
Header: &tmHeader,
Commit: commit,
signedHeader := &cometproto.SignedHeader{
Header: tmHeader.ToProto(),
Commit: commit.ToProto(),
}

valSetProto, err := valSet.ToProto()
s.Require().NoError(err)

return tmclient.Header{
SignedHeader: signedHeader.ToProto(),
SignedHeader: signedHeader,
ValidatorSet: valSetProto,
TrustedHeight: oldHeader.TrustedHeight,
TrustedValidators: oldHeader.TrustedValidators,
Expand Down
2 changes: 1 addition & 1 deletion e2e/interchaintestv8/ethereum/ethereum.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"cosmossdk.io/math"

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

"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/testvalues"
)
Expand Down
Loading
Loading