From ec1bc293e4f8dbb8b2f54f78fd5c95ec112cd298 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 28 Nov 2024 15:21:28 +0100 Subject: [PATCH] linting --- server/v2/cometbft/abci_test.go | 22 +++++++++---------- .../v2/cometbft/internal/mock/mock_store.go | 1 - .../cometbft/oe/optimistic_execution_test.go | 5 +++-- server/v2/cometbft/server.go | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/server/v2/cometbft/abci_test.go b/server/v2/cometbft/abci_test.go index f159dba7193f..8cac351920a5 100644 --- a/server/v2/cometbft/abci_test.go +++ b/server/v2/cometbft/abci_test.go @@ -2,18 +2,16 @@ package cometbft import ( "context" - "cosmossdk.io/core/server" "crypto/sha256" "encoding/json" "errors" - abci "github.com/cometbft/cometbft/abci/types" "io" "strings" "sync" "testing" "time" - "cosmossdk.io/server/v2/cometbft/oe" + abci "github.com/cometbft/cometbft/abci/types" abciproto "github.com/cometbft/cometbft/api/cometbft/abci/v1" v1 "github.com/cometbft/cometbft/api/cometbft/types/v1" "github.com/cosmos/gogoproto/proto" @@ -21,6 +19,7 @@ import ( "github.com/stretchr/testify/require" appmodulev2 "cosmossdk.io/core/appmodule/v2" + "cosmossdk.io/core/server" "cosmossdk.io/core/store" "cosmossdk.io/core/transaction" "cosmossdk.io/log" @@ -28,6 +27,7 @@ import ( "cosmossdk.io/server/v2/cometbft/handlers" cometmock "cosmossdk.io/server/v2/cometbft/internal/mock" "cosmossdk.io/server/v2/cometbft/mempool" + "cosmossdk.io/server/v2/cometbft/oe" "cosmossdk.io/server/v2/cometbft/types" "cosmossdk.io/server/v2/stf" "cosmossdk.io/server/v2/stf/branch" @@ -60,10 +60,10 @@ func getQueryRouterBuilder[T any, PT interface { *T proto.Message }, -U any, UT interface { - *U - proto.Message -}]( + U any, UT interface { + *U + proto.Message + }]( t *testing.T, handler func(ctx context.Context, msg PT) (UT, error), ) *stf.MsgRouterBuilder { @@ -90,10 +90,10 @@ func getMsgRouterBuilder[T any, PT interface { *T transaction.Msg }, -U any, UT interface { - *U - transaction.Msg -}]( + U any, UT interface { + *U + transaction.Msg + }]( t *testing.T, handler func(ctx context.Context, msg PT) (UT, error), ) *stf.MsgRouterBuilder { diff --git a/server/v2/cometbft/internal/mock/mock_store.go b/server/v2/cometbft/internal/mock/mock_store.go index 6f2de4747762..8cb4542ac41e 100644 --- a/server/v2/cometbft/internal/mock/mock_store.go +++ b/server/v2/cometbft/internal/mock/mock_store.go @@ -50,7 +50,6 @@ func (s *MockStore) StateLatest() (uint64, corestore.ReaderMap, error) { } func (s *MockStore) Commit(changeset *corestore.Changeset) (corestore.Hash, error) { - err := s.Committer.WriteChangeset(changeset) if err != nil { return []byte{}, err diff --git a/server/v2/cometbft/oe/optimistic_execution_test.go b/server/v2/cometbft/oe/optimistic_execution_test.go index c0eb28c2a5e9..cd3c9263c784 100644 --- a/server/v2/cometbft/oe/optimistic_execution_test.go +++ b/server/v2/cometbft/oe/optimistic_execution_test.go @@ -5,12 +5,13 @@ import ( "errors" "testing" + abci "github.com/cometbft/cometbft/api/cometbft/abci/v1" + "github.com/stretchr/testify/assert" + "cosmossdk.io/core/server" "cosmossdk.io/core/store" "cosmossdk.io/core/transaction" "cosmossdk.io/log" - abci "github.com/cometbft/cometbft/api/cometbft/abci/v1" - "github.com/stretchr/testify/assert" ) func testFinalizeBlock[T transaction.Tx](context.Context, *abci.FinalizeBlockRequest) (*server.BlockResponse, store.WriterMap, []T, error) { diff --git a/server/v2/cometbft/server.go b/server/v2/cometbft/server.go index 21ae75307595..ed0c4fba8702 100644 --- a/server/v2/cometbft/server.go +++ b/server/v2/cometbft/server.go @@ -2,7 +2,6 @@ package cometbft import ( "context" - "cosmossdk.io/server/v2/cometbft/oe" "crypto/sha256" "encoding/json" "fmt" @@ -35,6 +34,7 @@ import ( "cosmossdk.io/server/v2/appmanager" cometlog "cosmossdk.io/server/v2/cometbft/log" "cosmossdk.io/server/v2/cometbft/mempool" + "cosmossdk.io/server/v2/cometbft/oe" "cosmossdk.io/server/v2/cometbft/types" "cosmossdk.io/store/v2/snapshots"