Skip to content

Commit

Permalink
launchtools: ibc nft channel improvement (#135)
Browse files Browse the repository at this point in the history
* reuse the same light client by just creating a new channel

* remove override
  • Loading branch information
jhernandezb authored Feb 12, 2025
1 parent d7582ff commit 7bb2292
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions contrib/launchtools/steps/ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func establishIBCChannels(
link,

// create nft-transfer ports as well
linkWithPorts(srcPort, dstPort, channelVersion),
channelWithPorts(srcPort, dstPort, channelVersion),
)

return func(ctx launchtools.Launcher) error {
Expand Down Expand Up @@ -264,8 +264,8 @@ func link(r *Relayer) error {
})
}

// linkWithports is the same as link, however ports are specified
func linkWithPorts(srcPort string, dstPort string, version string) func(*Relayer) error {
// channelWithPorts create a channel reusing the same light client
func channelWithPorts(srcPort string, dstPort string, version string) func(*Relayer) error {
return func(r *Relayer) error {
versionBz, err := marshalIBCFeeMetadata(version)
if err != nil {
Expand All @@ -275,15 +275,14 @@ func linkWithPorts(srcPort string, dstPort string, version string) func(*Relayer
r.logger.Info("linking chains for relayer...", "version", string(versionBz))
return r.run([]string{
"tx",
"link",
"channel",
RelayerPathName,
"--src-port",
srcPort,
"--dst-port",
dstPort,
"--version",
string(versionBz),
"--override",
})
}
}
Expand Down

0 comments on commit 7bb2292

Please sign in to comment.