From 94e040c3d32370b12771642989691969ebbd860b Mon Sep 17 00:00:00 2001 From: beer-1 Date: Fri, 4 Oct 2024 15:52:02 +0900 Subject: [PATCH] apply coderabbit comment --- contrib/launchtools/steps/ibc.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/contrib/launchtools/steps/ibc.go b/contrib/launchtools/steps/ibc.go index fb65d0a..46d6e42 100644 --- a/contrib/launchtools/steps/ibc.go +++ b/contrib/launchtools/steps/ibc.go @@ -238,13 +238,17 @@ func initializeRelayerKeyring(config *launchtools.Config) func(*Relayer) error { } } +func marshalIBCFeeMetadata(appVersion string) ([]byte, error) { + return json.Marshal(ibcfeetypes.Metadata{ + FeeVersion: ibcfeetypes.Version, + AppVersion: appVersion, + }) +} + // link creates a default transfer channel between the chains // it does all the heavy lifting of creating the channel, connection, and client func link(r *Relayer) error { - versionBz, err := json.Marshal(ibcfeetypes.Metadata{ - FeeVersion: ibcfeetypes.Version, - AppVersion: ibctransfertypes.Version, - }) + versionBz, err := marshalIBCFeeMetadata(ibctransfertypes.Version) if err != nil { return err } @@ -262,10 +266,7 @@ 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 { return func(r *Relayer) error { - versionBz, err := json.Marshal(ibcfeetypes.Metadata{ - FeeVersion: ibcfeetypes.Version, - AppVersion: version, - }) + versionBz, err := marshalIBCFeeMetadata(version) if err != nil { return err }