From bf7e28adc5a9585df17e8dd1188ef88f5e72c3aa Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Wed, 20 Nov 2024 16:22:32 +0200 Subject: [PATCH] testing: add merkle path to endpoint struct. --- testing/endpoint.go | 4 ++++ testing/endpoint_v2.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/testing/endpoint.go b/testing/endpoint.go index 1fc0be299ed..df72c0e7ac7 100644 --- a/testing/endpoint.go +++ b/testing/endpoint.go @@ -17,6 +17,7 @@ import ( connectiontypes "github.com/cosmos/ibc-go/v9/modules/core/03-connection/types" channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" commitmenttypes "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types" + commitmenttypesv2 "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types/v2" host "github.com/cosmos/ibc-go/v9/modules/core/24-host" "github.com/cosmos/ibc-go/v9/modules/core/exported" ibctm "github.com/cosmos/ibc-go/v9/modules/light-clients/07-tendermint" @@ -37,6 +38,7 @@ type Endpoint struct { ConnectionConfig *ConnectionConfig ChannelConfig *ChannelConfig + MerklePathPrefix commitmenttypesv2.MerklePath // disableUniqueChannelIDs is used to enforce, in a test, // the old way to generate channel IDs (all channels are called channel-0) // It is used only by one test suite and should not be used for new tests. @@ -54,6 +56,7 @@ func NewEndpoint( ClientConfig: clientConfig, ConnectionConfig: connectionConfig, ChannelConfig: channelConfig, + MerklePathPrefix: MerklePath, } } @@ -65,6 +68,7 @@ func NewDefaultEndpoint(chain *TestChain) *Endpoint { ClientConfig: NewTendermintConfig(), ConnectionConfig: NewConnectionConfig(), ChannelConfig: NewChannelConfig(), + MerklePathPrefix: MerklePath, } } diff --git a/testing/endpoint_v2.go b/testing/endpoint_v2.go index b4efd98247b..e28ff51fb6b 100644 --- a/testing/endpoint_v2.go +++ b/testing/endpoint_v2.go @@ -12,7 +12,7 @@ import ( // CreateChannel will construct and execute a new MsgCreateChannel on the associated endpoint. func (endpoint *Endpoint) CreateChannel() (err error) { endpoint.IncrementNextChannelSequence() - msg := channeltypesv2.NewMsgCreateChannel(endpoint.ClientID, MerklePath, endpoint.Chain.SenderAccount.GetAddress().String()) + msg := channeltypesv2.NewMsgCreateChannel(endpoint.ClientID, endpoint.MerklePathPrefix, endpoint.Chain.SenderAccount.GetAddress().String()) // create channel res, err := endpoint.Chain.SendMsgs(msg)