From cf358f6fc20cabfb5cb8ce75fc10b2623150869e Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Fri, 12 Jan 2024 12:30:34 -0700 Subject: [PATCH] chore(types): replace amino json encoder with stdlib --- types/result.go | 2 +- types/result_test.go | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/types/result.go b/types/result.go index 7f4910ac45ec..536a37828271 100644 --- a/types/result.go +++ b/types/result.go @@ -49,7 +49,7 @@ func NewABCIMessageLog(i uint32, log string, events Events) ABCIMessageLog { // String implements the fmt.Stringer interface for the ABCIMessageLogs type. func (logs ABCIMessageLogs) String() (str string) { if logs != nil { - raw, err := cdc.MarshalJSON(logs) + raw, err := json.Marshal(logs) if err == nil { str = string(raw) } diff --git a/types/result_test.go b/types/result_test.go index fe79c8c13f84..d68b05a6608c 100644 --- a/types/result_test.go +++ b/types/result_test.go @@ -2,6 +2,7 @@ package types_test import ( "encoding/hex" + "encoding/json" "fmt" "strings" "testing" @@ -13,7 +14,6 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -41,14 +41,13 @@ func (s *resultTestSuite) TestParseABCILog() { } func (s *resultTestSuite) TestABCIMessageLog() { - cdc := codec.NewLegacyAmino() events := sdk.Events{ sdk.NewEvent("transfer", sdk.NewAttribute("sender", "foo")), sdk.NewEvent("transfer", sdk.NewAttribute("sender", "bar")), } msgLog := sdk.NewABCIMessageLog(0, "", events) msgLogs := sdk.ABCIMessageLogs{msgLog} - bz, err := cdc.MarshalJSON(msgLogs) + bz, err := json.Marshal(msgLogs) s.Require().NoError(err) s.Require().Equal(string(bz), msgLogs.String())