diff --git a/Makefile b/Makefile index 0de3476548..331aa473af 100644 --- a/Makefile +++ b/Makefile @@ -255,8 +255,8 @@ clean_certs: ############################################################################### format: - find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs gofmt -w -s - find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs goimports -w -local github.com/cometbft/cometbft + @echo "--> Running golangci-lint --fix" + @golangci-lint run --fix .PHONY: format lint: diff --git a/blockchain/v2/reactor_test.go b/blockchain/v2/reactor_test.go index 02c991cc6d..73075e5ea1 100644 --- a/blockchain/v2/reactor_test.go +++ b/blockchain/v2/reactor_test.go @@ -9,11 +9,12 @@ import ( "testing" "time" - dbm "github.com/cometbft/cometbft-db" "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/behaviour" cfg "github.com/tendermint/tendermint/config" diff --git a/cmd/cometbft/commands/reindex_event.go b/cmd/cometbft/commands/reindex_event.go index ebce28775e..4a29ef72dd 100644 --- a/cmd/cometbft/commands/reindex_event.go +++ b/cmd/cometbft/commands/reindex_event.go @@ -5,9 +5,10 @@ import ( "fmt" "strings" - dbm "github.com/cometbft/cometbft-db" "github.com/spf13/cobra" + dbm "github.com/cometbft/cometbft-db" + abcitypes "github.com/tendermint/tendermint/abci/types" cmtcfg "github.com/tendermint/tendermint/config" "github.com/tendermint/tendermint/libs/progressbar" diff --git a/consensus/replay_test.go b/consensus/replay_test.go index 90a7710ab4..eac20c6ac5 100644 --- a/consensus/replay_test.go +++ b/consensus/replay_test.go @@ -12,11 +12,12 @@ import ( "testing" "time" - dbm "github.com/cometbft/cometbft-db" "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + dbm "github.com/cometbft/cometbft-db" + "github.com/tendermint/tendermint/abci/example/kvstore" abci "github.com/tendermint/tendermint/abci/types" cfg "github.com/tendermint/tendermint/config" diff --git a/evidence/pool.go b/evidence/pool.go index c6a161ae58..b2d4107af7 100644 --- a/evidence/pool.go +++ b/evidence/pool.go @@ -8,10 +8,11 @@ import ( "sync/atomic" "time" - dbm "github.com/cometbft/cometbft-db" "github.com/gogo/protobuf/proto" gogotypes "github.com/gogo/protobuf/types" + dbm "github.com/cometbft/cometbft-db" + clist "github.com/tendermint/tendermint/libs/clist" "github.com/tendermint/tendermint/libs/log" cmtproto "github.com/tendermint/tendermint/proto/tendermint/types" diff --git a/node/node.go b/node/node.go index d98a9c34ee..e17f2ff065 100644 --- a/node/node.go +++ b/node/node.go @@ -10,13 +10,14 @@ import ( "strings" "time" - dbm "github.com/cometbft/cometbft-db" "github.com/grafana/pyroscope-go" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/rs/cors" sdktrace "go.opentelemetry.io/otel/sdk/trace" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/tendermint/tendermint/abci/types" bcv0 "github.com/tendermint/tendermint/blockchain/v0" bcv1 "github.com/tendermint/tendermint/blockchain/v1" diff --git a/p2p/trust/store_test.go b/p2p/trust/store_test.go index d603e1d741..c5d19533b3 100644 --- a/p2p/trust/store_test.go +++ b/p2p/trust/store_test.go @@ -5,10 +5,11 @@ import ( "os" "testing" - dbm "github.com/cometbft/cometbft-db" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + dbm "github.com/cometbft/cometbft-db" + "github.com/tendermint/tendermint/libs/log" ) diff --git a/proto/tendermint/abci/types.proto b/proto/tendermint/abci/types.proto index 758ab344e6..ccce8453cd 100644 --- a/proto/tendermint/abci/types.proto +++ b/proto/tendermint/abci/types.proto @@ -108,9 +108,9 @@ message RequestListSnapshots {} // offers a snapshot to the application message RequestOfferSnapshot { - Snapshot snapshot = 1; // snapshot offered by peers - bytes app_hash = 2; // light client-verified app hash for snapshot height - uint64 app_version = 3; // The application version at which the snapshot was taken + Snapshot snapshot = 1; // snapshot offered by peers + bytes app_hash = 2; // light client-verified app hash for snapshot height + uint64 app_version = 3; // The application version at which the snapshot was taken } // loads a snapshot chunk diff --git a/proto/tendermint/store/types.proto b/proto/tendermint/store/types.proto index e1d994b4b4..64a32d1f71 100644 --- a/proto/tendermint/store/types.proto +++ b/proto/tendermint/store/types.proto @@ -11,11 +11,11 @@ message BlockStoreState { // TxInfo describes the location of a tx inside a committed block // as well as the result of executing the transaction and the error log output. message TxInfo { - int64 height = 1; - uint32 index = 2; + int64 height = 1; + uint32 index = 2; // The response code of executing the tx. 0 means // successfully executed, all others are error codes. - uint32 code = 3; + uint32 code = 3; // The error log output generated if the transaction execution fails. - string error = 4; + string error = 4; } diff --git a/rpc/core/blocks_test.go b/rpc/core/blocks_test.go index 56e2ade3db..708ebb30eb 100644 --- a/rpc/core/blocks_test.go +++ b/rpc/core/blocks_test.go @@ -11,12 +11,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - dbm "github.com/cometbft/cometbft-db" "github.com/tendermint/tendermint/crypto/merkle" "github.com/tendermint/tendermint/libs/pubsub/query" cmtrand "github.com/tendermint/tendermint/libs/rand" "github.com/tendermint/tendermint/types" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/tendermint/tendermint/abci/types" cmtstate "github.com/tendermint/tendermint/proto/tendermint/state" cmtstore "github.com/tendermint/tendermint/proto/tendermint/store" diff --git a/state/execution_test.go b/state/execution_test.go index 6c8415f3ff..fc51e68749 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -17,7 +17,6 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - db "github.com/cometbft/cometbft-db" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto/ed25519" @@ -35,6 +34,8 @@ import ( "github.com/tendermint/tendermint/types" cmttime "github.com/tendermint/tendermint/types/time" "github.com/tendermint/tendermint/version" + + db "github.com/cometbft/cometbft-db" ) var ( diff --git a/state/indexer/block/kv/kv.go b/state/indexer/block/kv/kv.go index a20e3c7afb..b9da4baff4 100644 --- a/state/indexer/block/kv/kv.go +++ b/state/indexer/block/kv/kv.go @@ -10,9 +10,10 @@ import ( "strconv" "strings" - dbm "github.com/cometbft/cometbft-db" "github.com/google/orderedcode" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/pubsub/query" "github.com/tendermint/tendermint/state/indexer" diff --git a/state/indexer/block/kv/kv_test.go b/state/indexer/block/kv/kv_test.go index e3caca6df2..6450bfbe91 100644 --- a/state/indexer/block/kv/kv_test.go +++ b/state/indexer/block/kv/kv_test.go @@ -5,9 +5,10 @@ import ( "fmt" "testing" - db "github.com/cometbft/cometbft-db" "github.com/stretchr/testify/require" + db "github.com/cometbft/cometbft-db" + abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/pubsub/query" blockidxkv "github.com/tendermint/tendermint/state/indexer/block/kv" diff --git a/state/rollback_test.go b/state/rollback_test.go index 38d5e6e1db..e787d2f9fc 100644 --- a/state/rollback_test.go +++ b/state/rollback_test.go @@ -4,9 +4,10 @@ import ( "crypto/rand" "testing" - dbm "github.com/cometbft/cometbft-db" "github.com/stretchr/testify/require" + dbm "github.com/cometbft/cometbft-db" + "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto/tmhash" cmtstate "github.com/tendermint/tendermint/proto/tendermint/state" diff --git a/state/store.go b/state/store.go index 3fbadccdc0..57f9918037 100644 --- a/state/store.go +++ b/state/store.go @@ -4,9 +4,10 @@ import ( "errors" "fmt" - dbm "github.com/cometbft/cometbft-db" "github.com/gogo/protobuf/proto" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/tendermint/tendermint/abci/types" cmtmath "github.com/tendermint/tendermint/libs/math" cmtos "github.com/tendermint/tendermint/libs/os" diff --git a/state/txindex/indexer_service_test.go b/state/txindex/indexer_service_test.go index 6b8dadc70b..82ed0f2720 100644 --- a/state/txindex/indexer_service_test.go +++ b/state/txindex/indexer_service_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" - db "github.com/cometbft/cometbft-db" "github.com/stretchr/testify/require" + db "github.com/cometbft/cometbft-db" + abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" blockidxkv "github.com/tendermint/tendermint/state/indexer/block/kv" diff --git a/state/txindex/kv/kv.go b/state/txindex/kv/kv.go index 8199dd054a..00fb19edeb 100644 --- a/state/txindex/kv/kv.go +++ b/state/txindex/kv/kv.go @@ -9,9 +9,10 @@ import ( "strconv" "strings" - dbm "github.com/cometbft/cometbft-db" "github.com/gogo/protobuf/proto" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/pubsub/query" "github.com/tendermint/tendermint/state/indexer" diff --git a/store/store.go b/store/store.go index 2990f44378..5fe993247c 100644 --- a/store/store.go +++ b/store/store.go @@ -4,9 +4,10 @@ import ( "fmt" "strconv" - dbm "github.com/cometbft/cometbft-db" "github.com/gogo/protobuf/proto" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/tendermint/tendermint/abci/types" cmtsync "github.com/tendermint/tendermint/libs/sync" cmtstore "github.com/tendermint/tendermint/proto/tendermint/store" diff --git a/store/store_test.go b/store/store_test.go index be119dc3ff..2fa0e65d10 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -10,11 +10,12 @@ import ( "testing" "time" - dbm "github.com/cometbft/cometbft-db" "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/tendermint/tendermint/abci/types" cfg "github.com/tendermint/tendermint/config" "github.com/tendermint/tendermint/crypto" diff --git a/test/loadtime/cmd/load/main.go b/test/loadtime/cmd/load/main.go index a90447ba96..a7ae054322 100644 --- a/test/loadtime/cmd/load/main.go +++ b/test/loadtime/cmd/load/main.go @@ -3,9 +3,10 @@ package main import ( "fmt" - "github.com/cometbft/cometbft-load-test/pkg/loadtest" "github.com/google/uuid" + "github.com/cometbft/cometbft-load-test/pkg/loadtest" + "github.com/tendermint/tendermint/test/loadtime/payload" )