Skip to content

Commit

Permalink
fix: e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
srdtrk committed May 11, 2024
1 parent 3167af9 commit 01aed19
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
29 changes: 11 additions & 18 deletions e2e/interchaintestv8/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
controllertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"
icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"
channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
ibctesting "github.com/cosmos/ibc-go/v8/testing"

"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
Expand All @@ -33,11 +34,6 @@ import (
type ContractTestSuite struct {
e2esuite.TestSuite

// ChainAConnID is the connection id of chain A
ChainAConnID string
// ChainBConnID is the connection id of chain B
ChainBConnID string

// Contract is the representation of the ICA controller contract
Contract *cwicacontroller.Contract
// CallbackCounterContract is the representation of the callback counter contract
Expand All @@ -52,9 +48,6 @@ func (s *ContractTestSuite) SetupSuite(ctx context.Context) {
s.TestSuite.SetupSuite(ctx)

s.IcaContractToAddrMap = make(map[string]string)

s.ChainAConnID = "connection-0"
s.ChainBConnID = "connection-0"
}

// SetupContractTestSuite starts the chains, relayer, creates the user accounts, creates the ibc clients and connections,
Expand All @@ -75,8 +68,8 @@ func (s *ContractTestSuite) SetupContractTestSuite(ctx context.Context, ordering
instantiateMsg := cwicacontroller.InstantiateMsg{
Owner: nil,
ChannelOpenInitOptions: cwicacontroller.ChannelOpenInitOptions{
ConnectionId: s.ChainAConnID,
CounterpartyConnectionId: s.ChainBConnID,
ConnectionId: ibctesting.FirstConnectionID,
CounterpartyConnectionId: ibctesting.FirstConnectionID,
CounterpartyPortId: nil,
ChannelOrdering: &ordering,
},
Expand Down Expand Up @@ -191,7 +184,7 @@ func (s *ContractTestSuite) TestIcaRelayerInstantiatedChannelHandshake() {
instantiateMsg := cwicacontroller.InstantiateMsg{
Owner: nil,
ChannelOpenInitOptions: cwicacontroller.ChannelOpenInitOptions{
ConnectionId: s.ChainAConnID,
ConnectionId: ibctesting.FirstConnectionID,
CounterpartyConnectionId: "connection-123",
CounterpartyPortId: nil,
},
Expand All @@ -201,7 +194,7 @@ func (s *ContractTestSuite) TestIcaRelayerInstantiatedChannelHandshake() {
s.Contract, err = cwicacontroller.Instantiate(ctx, wasmdUser.KeyName(), codeId, "", wasmd, instantiateMsg, "--gas", "500000")
s.Require().NoError(err)

version := fmt.Sprintf(`{"version":"%s","controller_connection_id":"%s","host_connection_id":"%s","address":"","encoding":"%s","tx_type":"%s"}`, icatypes.Version, s.ChainAConnID, s.ChainBConnID, icatypes.EncodingProtobuf, icatypes.TxTypeSDKMultiMsg)
version := fmt.Sprintf(`{"version":"%s","controller_connection_id":"%s","host_connection_id":"%s","address":"","encoding":"%s","tx_type":"%s"}`, icatypes.Version, ibctesting.FirstConnectionID, ibctesting.FirstConnectionID, icatypes.EncodingProtobuf, icatypes.TxTypeSDKMultiMsg)
err = s.Relayer.CreateChannel(ctx, s.ExecRep, s.PathName, ibc.CreateChannelOptions{
SourcePortName: s.Contract.Port(),
DestPortName: icatypes.HostPortID,
Expand All @@ -228,7 +221,7 @@ func (s *ContractTestSuite) TestRecoveredIcaContractInstantiatedChannelHandshake
Owner: nil,
ChannelOpenInitOptions: cwicacontroller.ChannelOpenInitOptions{
ConnectionId: "invalid",
CounterpartyConnectionId: s.ChainBConnID,
CounterpartyConnectionId: ibctesting.FirstConnectionID,
CounterpartyPortId: nil,
},
SendCallbacksTo: nil,
Expand All @@ -243,7 +236,7 @@ func (s *ContractTestSuite) TestRecoveredIcaContractInstantiatedChannelHandshake
instantiateMsg := cwicacontroller.InstantiateMsg{
Owner: nil,
ChannelOpenInitOptions: cwicacontroller.ChannelOpenInitOptions{
ConnectionId: s.ChainAConnID,
ConnectionId: ibctesting.FirstConnectionID,
CounterpartyConnectionId: "connection-123",
CounterpartyPortId: nil,
},
Expand All @@ -258,8 +251,8 @@ func (s *ContractTestSuite) TestRecoveredIcaContractInstantiatedChannelHandshake
createChannelMsg := cwicacontroller.ExecuteMsg{
CreateChannel: &cwicacontroller.ExecuteMsg_CreateChannel{
ChannelOpenInitOptions: &cwicacontroller.ChannelOpenInitOptions{
ConnectionId: s.ChainAConnID,
CounterpartyConnectionId: s.ChainBConnID,
ConnectionId: ibctesting.FirstConnectionID,
CounterpartyConnectionId: ibctesting.FirstConnectionID,
CounterpartyPortId: nil,
},
},
Expand Down Expand Up @@ -1056,8 +1049,8 @@ func (s *ContractTestSuite) TestMigrateOrderedToUnordered() {
createChannelMsg := cwicacontroller.ExecuteMsg{
CreateChannel: &cwicacontroller.ExecuteMsg_CreateChannel{
ChannelOpenInitOptions: &cwicacontroller.ChannelOpenInitOptions{
ConnectionId: s.ChainAConnID,
CounterpartyConnectionId: s.ChainBConnID,
ConnectionId: ibctesting.FirstConnectionID,
CounterpartyConnectionId: ibctesting.FirstConnectionID,
CounterpartyPortId: nil,
ChannelOrdering: &ordering,
},
Expand Down
4 changes: 4 additions & 0 deletions e2e/interchaintestv8/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ require (
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/storage v1.36.0 // indirect
cosmossdk.io/client/v2 v2.0.0-beta.1 // indirect
cosmossdk.io/collections v0.4.0 // indirect
cosmossdk.io/core v0.11.0 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
cosmossdk.io/errors v1.0.1 // indirect
cosmossdk.io/log v1.3.1 // indirect
cosmossdk.io/store v1.0.2 // indirect
cosmossdk.io/x/circuit v0.1.0 // indirect
cosmossdk.io/x/evidence v0.1.0 // indirect
cosmossdk.io/x/feegrant v0.1.0 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.2 // indirect
Expand Down
1 change: 1 addition & 0 deletions e2e/interchaintestv8/owner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (s *OwnerTestSuite) SetupOwnerTestSuite(ctx context.Context) {
s.Require().NoError(err)

s.NumOfIcaContracts = 0
s.ChainAConnID, s.ChainBConnID = "connection-0", "connection-0"

// Create the ICA Contract
createMsg := cwicaowner.ExecuteMsg{
Expand Down
6 changes: 4 additions & 2 deletions e2e/interchaintestv8/wasm_msg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"encoding/base64"
"strconv"

ibctesting "github.com/cosmos/ibc-go/v8/testing"

wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

interchaintest "github.com/strangelove-ventures/interchaintest/v8"
Expand Down Expand Up @@ -63,8 +65,8 @@ func (s *ContractTestSuite) SetupWasmTestSuite(ctx context.Context) int {
instantiateMsg := cwicacontroller.InstantiateMsg{
Owner: nil,
ChannelOpenInitOptions: cwicacontroller.ChannelOpenInitOptions{
ConnectionId: s.ChainAConnID,
CounterpartyConnectionId: s.ChainBConnID,
ConnectionId: ibctesting.FirstConnectionID,
CounterpartyConnectionId: ibctesting.FirstConnectionID,
CounterpartyPortId: nil,
},
SendCallbacksTo: &s.CallbackCounterContract.Address,
Expand Down

0 comments on commit 01aed19

Please sign in to comment.