Skip to content

Commit bf7e28a

Browse files
committed
testing: add merkle path to endpoint struct.
1 parent 5332645 commit bf7e28a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

testing/endpoint.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
connectiontypes "github.com/cosmos/ibc-go/v9/modules/core/03-connection/types"
1818
channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types"
1919
commitmenttypes "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types"
20+
commitmenttypesv2 "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types/v2"
2021
host "github.com/cosmos/ibc-go/v9/modules/core/24-host"
2122
"github.com/cosmos/ibc-go/v9/modules/core/exported"
2223
ibctm "github.com/cosmos/ibc-go/v9/modules/light-clients/07-tendermint"
@@ -37,6 +38,7 @@ type Endpoint struct {
3738
ConnectionConfig *ConnectionConfig
3839
ChannelConfig *ChannelConfig
3940

41+
MerklePathPrefix commitmenttypesv2.MerklePath
4042
// disableUniqueChannelIDs is used to enforce, in a test,
4143
// the old way to generate channel IDs (all channels are called channel-0)
4244
// It is used only by one test suite and should not be used for new tests.
@@ -54,6 +56,7 @@ func NewEndpoint(
5456
ClientConfig: clientConfig,
5557
ConnectionConfig: connectionConfig,
5658
ChannelConfig: channelConfig,
59+
MerklePathPrefix: MerklePath,
5760
}
5861
}
5962

@@ -65,6 +68,7 @@ func NewDefaultEndpoint(chain *TestChain) *Endpoint {
6568
ClientConfig: NewTendermintConfig(),
6669
ConnectionConfig: NewConnectionConfig(),
6770
ChannelConfig: NewChannelConfig(),
71+
MerklePathPrefix: MerklePath,
6872
}
6973
}
7074

testing/endpoint_v2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
// CreateChannel will construct and execute a new MsgCreateChannel on the associated endpoint.
1313
func (endpoint *Endpoint) CreateChannel() (err error) {
1414
endpoint.IncrementNextChannelSequence()
15-
msg := channeltypesv2.NewMsgCreateChannel(endpoint.ClientID, MerklePath, endpoint.Chain.SenderAccount.GetAddress().String())
15+
msg := channeltypesv2.NewMsgCreateChannel(endpoint.ClientID, endpoint.MerklePathPrefix, endpoint.Chain.SenderAccount.GetAddress().String())
1616

1717
// create channel
1818
res, err := endpoint.Chain.SendMsgs(msg)

0 commit comments

Comments
 (0)