Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuvubk committed Dec 10, 2024
1 parent b99ec54 commit 0314c4f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
9 changes: 4 additions & 5 deletions server/v2/cometbft/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@ import (

abci "github.com/cometbft/cometbft/abci/types"
abciproto "github.com/cometbft/cometbft/api/cometbft/abci/v1"
rpchttp "github.com/cometbft/cometbft/rpc/client/http"
gogoproto "github.com/cosmos/gogoproto/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/reflect/protoregistry"

"cosmossdk.io/collections"
addresscodec "cosmossdk.io/core/address"
appmodulev2 "cosmossdk.io/core/appmodule/v2"
"cosmossdk.io/core/comet"
corecontext "cosmossdk.io/core/context"
"cosmossdk.io/core/event"
"cosmossdk.io/core/server"
"cosmossdk.io/core/store"
"cosmossdk.io/core/transaction"
errorsmod "cosmossdk.io/errors/v2"
"cosmossdk.io/log"
"cosmossdk.io/schema/appdata"
Expand All @@ -34,10 +37,6 @@ import (
"cosmossdk.io/store/v2/snapshots"
consensustypes "cosmossdk.io/x/consensus/types"

addresscodec "cosmossdk.io/core/address"
coreserver "cosmossdk.io/core/server"
"cosmossdk.io/core/transaction"
rpchttp "github.com/cometbft/cometbft/rpc/client/http"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"
"github.com/cosmos/cosmos-sdk/codec"
Expand Down Expand Up @@ -93,7 +92,7 @@ type consensus[T transaction.Tx] struct {
queryHandlersMap map[string]appmodulev2.Handler
getProtoRegistry func() (*protoregistry.Files, error)
consensusAddressCodec addresscodec.Codec
cfgMap coreserver.ConfigMap
cfgMap server.ConfigMap
}

// CheckTx implements types.Application.
Expand Down
9 changes: 4 additions & 5 deletions server/v2/cometbft/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
gogoproto "github.com/cosmos/gogoproto/proto"
)

type appSimulator[T transaction.Tx] interface {
Expand Down Expand Up @@ -75,7 +74,7 @@ func (t txServer[T]) GetBlockWithTxs(ctx context.Context, req *txtypes.GetBlockW
if req == nil {
return nil, status.Error(codes.InvalidArgument, "request cannot be nil")
}

resp, err := t.consensus.Info(ctx, &abci.InfoRequest{})
if err != nil {
return nil, err
Expand Down Expand Up @@ -460,18 +459,18 @@ func parseOrderBy(orderBy txtypes.OrderBy) string {

func handleExternalService[T any, PT interface {
*T
gogoproto.Message
proto.Message
},
U any, UT interface {
*U
gogoproto.Message
proto.Message
}](
ctx context.Context,
rawReq *abciproto.QueryRequest,
handler func(ctx context.Context, msg PT) (UT, error),
) (transaction.Msg, error) {
req := PT(new(T))
err := gogoproto.Unmarshal(rawReq.Data, req)
err := proto.Unmarshal(rawReq.Data, req)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion server/v2/cometbft/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/spf13/pflag"
"google.golang.org/grpc"

addresscodec "cosmossdk.io/core/address"
appmodulev2 "cosmossdk.io/core/appmodule/v2"
"cosmossdk.io/core/server"
"cosmossdk.io/core/transaction"
Expand All @@ -38,7 +39,6 @@ import (
"cosmossdk.io/server/v2/cometbft/types"
"cosmossdk.io/store/v2/snapshots"

addresscodec "cosmossdk.io/core/address"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
Expand Down

0 comments on commit 0314c4f

Please sign in to comment.