From c035d34f310860549f41fc59e8d81eb89256be86 Mon Sep 17 00:00:00 2001 From: Julian Toledano Date: Tue, 25 Jun 2024 11:24:21 +0200 Subject: [PATCH] lint --- baseapp/abci_test.go | 3 +-- baseapp/baseapp.go | 25 ------------------------- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/baseapp/abci_test.go b/baseapp/abci_test.go index 6627917a4fbb..3d9197ebb3c1 100644 --- a/baseapp/abci_test.go +++ b/baseapp/abci_test.go @@ -14,8 +14,6 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/codec" - abci "github.com/cometbft/cometbft/api/cometbft/abci/v1" cmtprotocrypto "github.com/cometbft/cometbft/api/cometbft/crypto/v1" cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" @@ -41,6 +39,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" baseapptestutil "github.com/cosmos/cosmos-sdk/baseapp/testutil" "github.com/cosmos/cosmos-sdk/baseapp/testutil/mock" + "github.com/cosmos/cosmos-sdk/codec" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/testdata" diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 50064d06a894..9a3bb1666922 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -13,12 +13,9 @@ import ( cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" "github.com/cometbft/cometbft/crypto/tmhash" dbm "github.com/cosmos/cosmos-db" - "github.com/cosmos/cosmos-proto/anyutil" "github.com/cosmos/gogoproto/proto" "golang.org/x/exp/maps" - protov2 "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/known/anypb" "cosmossdk.io/core/header" "cosmossdk.io/core/log" @@ -1122,28 +1119,6 @@ func (app *BaseApp) simulateNestedMessages(ctx sdk.Context, msg sdk.Msg) error { return err } -// msgsV1ToMsgsV2 transforms v1 messages into v2. -func (app *BaseApp) msgsV1ToMsgsV2(msgs []sdk.Msg) ([]protov2.Message, error) { - msgsV2 := make([]protov2.Message, len(msgs)) - for i, msg := range msgs { - gogoAny, err := codectypes.NewAnyWithValue(msg) - if err != nil { - return nil, err - } - anyMsg := &anypb.Any{ - TypeUrl: gogoAny.TypeUrl, - Value: gogoAny.Value, - } - msgV2, err := anyutil.Unpack(anyMsg, app.cdc.InterfaceRegistry().SigningContext().FileResolver(), app.cdc.InterfaceRegistry().SigningContext().TypeResolver()) - if err != nil { - return nil, err - } - msgsV2[i] = msgV2 - } - - return msgsV2, nil -} - // makeABCIData generates the Data field to be sent to ABCI Check/DeliverTx. func makeABCIData(msgResponses []*codectypes.Any) ([]byte, error) { return proto.Marshal(&sdk.TxMsgData{MsgResponses: msgResponses})