From d9647e799a07d4771a836966fdb5c6aa9c021137 Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Mon, 4 Mar 2024 10:26:29 +0900 Subject: [PATCH] fix w --- x/collection/keeper/msg_server_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/x/collection/keeper/msg_server_test.go b/x/collection/keeper/msg_server_test.go index 72a6f4760e..62c3ed710f 100644 --- a/x/collection/keeper/msg_server_test.go +++ b/x/collection/keeper/msg_server_test.go @@ -6,6 +6,7 @@ import ( "strings" abci "github.com/cometbft/cometbft/abci/types" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" "github.com/cosmos/gogoproto/proto" "cosmossdk.io/math" @@ -28,6 +29,27 @@ func mustJSONMarshal(v any) string { // w wraps input with double quotes if it is a string or fmt.Stringer. func w(input any) string { switch input.(type) { + case sdk.AccAddress: + ac := authcodec.NewBech32Codec("link") + s, err := ac.BytesToString(input.([]byte)) + if err != nil { + panic(err) + } + return fmt.Sprintf("\"%s\"", s) + case sdk.ValAddress: + ac := authcodec.NewBech32Codec("linkvaloper") + s, err := ac.BytesToString(input.([]byte)) + if err != nil { + panic(err) + } + return fmt.Sprintf("\"%s\"", s) + case sdk.ConsAddress: + ac := authcodec.NewBech32Codec("linkvalcons") + s, err := ac.BytesToString(input.([]byte)) + if err != nil { + panic(err) + } + return fmt.Sprintf("\"%s\"", s) case string, fmt.Stringer: return fmt.Sprintf("\"%s\"", input) default: