From faea2f20aa1affd4c9d3aeb488de91c02d55f2ca Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 3 Jun 2021 09:30:44 -0400 Subject: [PATCH] consensus: move pkg to internal --- cmd/tendermint/commands/replay.go | 2 +- {consensus => internal/consensus}/README.md | 0 {consensus => internal/consensus}/byzantine_test.go | 0 {consensus => internal/consensus}/common_test.go | 2 +- {consensus => internal/consensus}/invalid_test.go | 0 {consensus => internal/consensus}/mempool_test.go | 0 {consensus => internal/consensus}/metrics.go | 0 {consensus => internal/consensus}/msgs.go | 2 +- {consensus => internal/consensus}/msgs_test.go | 2 +- {consensus => internal/consensus}/peer_state.go | 2 +- {consensus => internal/consensus}/reactor.go | 2 +- {consensus => internal/consensus}/reactor_test.go | 0 {consensus => internal/consensus}/replay.go | 0 {consensus => internal/consensus}/replay_file.go | 0 {consensus => internal/consensus}/replay_stubs.go | 0 {consensus => internal/consensus}/replay_test.go | 0 {consensus => internal/consensus}/state.go | 2 +- {consensus => internal/consensus}/state_test.go | 2 +- {consensus => internal/consensus}/ticker.go | 0 {consensus => internal/consensus}/types/height_vote_set.go | 0 {consensus => internal/consensus}/types/height_vote_set_test.go | 0 {consensus => internal/consensus}/types/peer_round_state.go | 0 .../consensus}/types/peer_round_state_test.go | 0 {consensus => internal/consensus}/types/round_state.go | 0 {consensus => internal/consensus}/wal.go | 0 {consensus => internal/consensus}/wal_fuzz.go | 0 {consensus => internal/consensus}/wal_generator.go | 0 {consensus => internal/consensus}/wal_test.go | 2 +- node/node.go | 2 +- node/setup.go | 2 +- rpc/core/consensus.go | 2 +- rpc/core/env.go | 2 +- scripts/json2wal/main.go | 2 +- scripts/wal2json/main.go | 2 +- 34 files changed, 15 insertions(+), 15 deletions(-) rename {consensus => internal/consensus}/README.md (100%) rename {consensus => internal/consensus}/byzantine_test.go (100%) rename {consensus => internal/consensus}/common_test.go (99%) rename {consensus => internal/consensus}/invalid_test.go (100%) rename {consensus => internal/consensus}/mempool_test.go (100%) rename {consensus => internal/consensus}/metrics.go (100%) rename {consensus => internal/consensus}/msgs.go (99%) rename {consensus => internal/consensus}/msgs_test.go (99%) rename {consensus => internal/consensus}/peer_state.go (99%) rename {consensus => internal/consensus}/reactor.go (99%) rename {consensus => internal/consensus}/reactor_test.go (100%) rename {consensus => internal/consensus}/replay.go (100%) rename {consensus => internal/consensus}/replay_file.go (100%) rename {consensus => internal/consensus}/replay_stubs.go (100%) rename {consensus => internal/consensus}/replay_test.go (100%) rename {consensus => internal/consensus}/state.go (99%) rename {consensus => internal/consensus}/state_test.go (99%) rename {consensus => internal/consensus}/ticker.go (100%) rename {consensus => internal/consensus}/types/height_vote_set.go (100%) rename {consensus => internal/consensus}/types/height_vote_set_test.go (100%) rename {consensus => internal/consensus}/types/peer_round_state.go (100%) rename {consensus => internal/consensus}/types/peer_round_state_test.go (100%) rename {consensus => internal/consensus}/types/round_state.go (100%) rename {consensus => internal/consensus}/wal.go (100%) rename {consensus => internal/consensus}/wal_fuzz.go (100%) rename {consensus => internal/consensus}/wal_generator.go (100%) rename {consensus => internal/consensus}/wal_test.go (99%) diff --git a/cmd/tendermint/commands/replay.go b/cmd/tendermint/commands/replay.go index 5de8d0d3e..f09e11c86 100644 --- a/cmd/tendermint/commands/replay.go +++ b/cmd/tendermint/commands/replay.go @@ -3,7 +3,7 @@ package commands import ( "github.com/spf13/cobra" - "github.com/tendermint/tendermint/consensus" + "github.com/tendermint/tendermint/internal/consensus" ) // ReplayCmd allows replaying of messages from the WAL. diff --git a/consensus/README.md b/internal/consensus/README.md similarity index 100% rename from consensus/README.md rename to internal/consensus/README.md diff --git a/consensus/byzantine_test.go b/internal/consensus/byzantine_test.go similarity index 100% rename from consensus/byzantine_test.go rename to internal/consensus/byzantine_test.go diff --git a/consensus/common_test.go b/internal/consensus/common_test.go similarity index 99% rename from consensus/common_test.go rename to internal/consensus/common_test.go index 803a22757..e2a04835b 100644 --- a/consensus/common_test.go +++ b/internal/consensus/common_test.go @@ -24,7 +24,7 @@ import ( "github.com/tendermint/tendermint/abci/example/kvstore" abci "github.com/tendermint/tendermint/abci/types" cfg "github.com/tendermint/tendermint/config" - cstypes "github.com/tendermint/tendermint/consensus/types" + cstypes "github.com/tendermint/tendermint/internal/consensus/types" tmsync "github.com/tendermint/tendermint/internal/libs/sync" "github.com/tendermint/tendermint/internal/test/factory" tmbytes "github.com/tendermint/tendermint/libs/bytes" diff --git a/consensus/invalid_test.go b/internal/consensus/invalid_test.go similarity index 100% rename from consensus/invalid_test.go rename to internal/consensus/invalid_test.go diff --git a/consensus/mempool_test.go b/internal/consensus/mempool_test.go similarity index 100% rename from consensus/mempool_test.go rename to internal/consensus/mempool_test.go diff --git a/consensus/metrics.go b/internal/consensus/metrics.go similarity index 100% rename from consensus/metrics.go rename to internal/consensus/metrics.go diff --git a/consensus/msgs.go b/internal/consensus/msgs.go similarity index 99% rename from consensus/msgs.go rename to internal/consensus/msgs.go index 60f869123..f76dfe3b2 100644 --- a/consensus/msgs.go +++ b/internal/consensus/msgs.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - cstypes "github.com/tendermint/tendermint/consensus/types" + cstypes "github.com/tendermint/tendermint/internal/consensus/types" "github.com/tendermint/tendermint/libs/bits" tmjson "github.com/tendermint/tendermint/libs/json" tmmath "github.com/tendermint/tendermint/libs/math" diff --git a/consensus/msgs_test.go b/internal/consensus/msgs_test.go similarity index 99% rename from consensus/msgs_test.go rename to internal/consensus/msgs_test.go index 953a6355d..b4d67e8ba 100644 --- a/consensus/msgs_test.go +++ b/internal/consensus/msgs_test.go @@ -11,9 +11,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - cstypes "github.com/tendermint/tendermint/consensus/types" "github.com/tendermint/tendermint/crypto/merkle" "github.com/tendermint/tendermint/crypto/tmhash" + cstypes "github.com/tendermint/tendermint/internal/consensus/types" "github.com/tendermint/tendermint/internal/test/factory" "github.com/tendermint/tendermint/libs/bits" "github.com/tendermint/tendermint/libs/bytes" diff --git a/consensus/peer_state.go b/internal/consensus/peer_state.go similarity index 99% rename from consensus/peer_state.go rename to internal/consensus/peer_state.go index fd720d815..fbc6c7c1e 100644 --- a/consensus/peer_state.go +++ b/internal/consensus/peer_state.go @@ -6,7 +6,7 @@ import ( "sync" "time" - cstypes "github.com/tendermint/tendermint/consensus/types" + cstypes "github.com/tendermint/tendermint/internal/consensus/types" tmsync "github.com/tendermint/tendermint/internal/libs/sync" "github.com/tendermint/tendermint/libs/bits" tmjson "github.com/tendermint/tendermint/libs/json" diff --git a/consensus/reactor.go b/internal/consensus/reactor.go similarity index 99% rename from consensus/reactor.go rename to internal/consensus/reactor.go index 834fff5bc..41faae3e8 100644 --- a/consensus/reactor.go +++ b/internal/consensus/reactor.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - cstypes "github.com/tendermint/tendermint/consensus/types" + cstypes "github.com/tendermint/tendermint/internal/consensus/types" tmsync "github.com/tendermint/tendermint/internal/libs/sync" "github.com/tendermint/tendermint/libs/bits" tmevents "github.com/tendermint/tendermint/libs/events" diff --git a/consensus/reactor_test.go b/internal/consensus/reactor_test.go similarity index 100% rename from consensus/reactor_test.go rename to internal/consensus/reactor_test.go diff --git a/consensus/replay.go b/internal/consensus/replay.go similarity index 100% rename from consensus/replay.go rename to internal/consensus/replay.go diff --git a/consensus/replay_file.go b/internal/consensus/replay_file.go similarity index 100% rename from consensus/replay_file.go rename to internal/consensus/replay_file.go diff --git a/consensus/replay_stubs.go b/internal/consensus/replay_stubs.go similarity index 100% rename from consensus/replay_stubs.go rename to internal/consensus/replay_stubs.go diff --git a/consensus/replay_test.go b/internal/consensus/replay_test.go similarity index 100% rename from consensus/replay_test.go rename to internal/consensus/replay_test.go diff --git a/consensus/state.go b/internal/consensus/state.go similarity index 99% rename from consensus/state.go rename to internal/consensus/state.go index 14d9ba945..435a09054 100644 --- a/consensus/state.go +++ b/internal/consensus/state.go @@ -13,8 +13,8 @@ import ( "github.com/gogo/protobuf/proto" cfg "github.com/tendermint/tendermint/config" - cstypes "github.com/tendermint/tendermint/consensus/types" "github.com/tendermint/tendermint/crypto" + cstypes "github.com/tendermint/tendermint/internal/consensus/types" "github.com/tendermint/tendermint/internal/libs/fail" tmsync "github.com/tendermint/tendermint/internal/libs/sync" tmevents "github.com/tendermint/tendermint/libs/events" diff --git a/consensus/state_test.go b/internal/consensus/state_test.go similarity index 99% rename from consensus/state_test.go rename to internal/consensus/state_test.go index 63c75a4a4..6ec2e1c3b 100644 --- a/consensus/state_test.go +++ b/internal/consensus/state_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/abci/example/counter" - cstypes "github.com/tendermint/tendermint/consensus/types" "github.com/tendermint/tendermint/crypto/tmhash" + cstypes "github.com/tendermint/tendermint/internal/consensus/types" "github.com/tendermint/tendermint/libs/log" tmpubsub "github.com/tendermint/tendermint/libs/pubsub" tmrand "github.com/tendermint/tendermint/libs/rand" diff --git a/consensus/ticker.go b/internal/consensus/ticker.go similarity index 100% rename from consensus/ticker.go rename to internal/consensus/ticker.go diff --git a/consensus/types/height_vote_set.go b/internal/consensus/types/height_vote_set.go similarity index 100% rename from consensus/types/height_vote_set.go rename to internal/consensus/types/height_vote_set.go diff --git a/consensus/types/height_vote_set_test.go b/internal/consensus/types/height_vote_set_test.go similarity index 100% rename from consensus/types/height_vote_set_test.go rename to internal/consensus/types/height_vote_set_test.go diff --git a/consensus/types/peer_round_state.go b/internal/consensus/types/peer_round_state.go similarity index 100% rename from consensus/types/peer_round_state.go rename to internal/consensus/types/peer_round_state.go diff --git a/consensus/types/peer_round_state_test.go b/internal/consensus/types/peer_round_state_test.go similarity index 100% rename from consensus/types/peer_round_state_test.go rename to internal/consensus/types/peer_round_state_test.go diff --git a/consensus/types/round_state.go b/internal/consensus/types/round_state.go similarity index 100% rename from consensus/types/round_state.go rename to internal/consensus/types/round_state.go diff --git a/consensus/wal.go b/internal/consensus/wal.go similarity index 100% rename from consensus/wal.go rename to internal/consensus/wal.go diff --git a/consensus/wal_fuzz.go b/internal/consensus/wal_fuzz.go similarity index 100% rename from consensus/wal_fuzz.go rename to internal/consensus/wal_fuzz.go diff --git a/consensus/wal_generator.go b/internal/consensus/wal_generator.go similarity index 100% rename from consensus/wal_generator.go rename to internal/consensus/wal_generator.go diff --git a/consensus/wal_test.go b/internal/consensus/wal_test.go similarity index 99% rename from consensus/wal_test.go rename to internal/consensus/wal_test.go index b5538f609..6eb8ca7f7 100644 --- a/consensus/wal_test.go +++ b/internal/consensus/wal_test.go @@ -12,8 +12,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/consensus/types" "github.com/tendermint/tendermint/crypto/merkle" + "github.com/tendermint/tendermint/internal/consensus/types" "github.com/tendermint/tendermint/internal/libs/autofile" "github.com/tendermint/tendermint/libs/log" tmtypes "github.com/tendermint/tendermint/types" diff --git a/node/node.go b/node/node.go index a4c427504..0ad511507 100644 --- a/node/node.go +++ b/node/node.go @@ -18,9 +18,9 @@ import ( _ "github.com/lib/pq" // provide the psql db driver abci "github.com/tendermint/tendermint/abci/types" cfg "github.com/tendermint/tendermint/config" - cs "github.com/tendermint/tendermint/consensus" "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/evidence" + cs "github.com/tendermint/tendermint/internal/consensus" tmjson "github.com/tendermint/tendermint/libs/json" "github.com/tendermint/tendermint/libs/log" tmnet "github.com/tendermint/tendermint/libs/net" diff --git a/node/setup.go b/node/setup.go index 51a35f7db..c03ceeee1 100644 --- a/node/setup.go +++ b/node/setup.go @@ -17,7 +17,7 @@ import ( bcv0 "github.com/tendermint/tendermint/blockchain/v0" bcv2 "github.com/tendermint/tendermint/blockchain/v2" cfg "github.com/tendermint/tendermint/config" - cs "github.com/tendermint/tendermint/consensus" + cs "github.com/tendermint/tendermint/internal/consensus" "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/evidence" "github.com/tendermint/tendermint/libs/log" diff --git a/rpc/core/consensus.go b/rpc/core/consensus.go index 1473a843d..1767c4b35 100644 --- a/rpc/core/consensus.go +++ b/rpc/core/consensus.go @@ -1,7 +1,7 @@ package core import ( - cm "github.com/tendermint/tendermint/consensus" + cm "github.com/tendermint/tendermint/internal/consensus" tmmath "github.com/tendermint/tendermint/libs/math" ctypes "github.com/tendermint/tendermint/rpc/core/types" rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types" diff --git a/rpc/core/env.go b/rpc/core/env.go index c436d0175..4c539844b 100644 --- a/rpc/core/env.go +++ b/rpc/core/env.go @@ -6,8 +6,8 @@ import ( "time" cfg "github.com/tendermint/tendermint/config" - "github.com/tendermint/tendermint/consensus" "github.com/tendermint/tendermint/crypto" + "github.com/tendermint/tendermint/internal/consensus" tmjson "github.com/tendermint/tendermint/libs/json" "github.com/tendermint/tendermint/libs/log" mempl "github.com/tendermint/tendermint/mempool" diff --git a/scripts/json2wal/main.go b/scripts/json2wal/main.go index ef98977d9..d21dc6c44 100644 --- a/scripts/json2wal/main.go +++ b/scripts/json2wal/main.go @@ -14,7 +14,7 @@ import ( "os" "strings" - cs "github.com/tendermint/tendermint/consensus" + cs "github.com/tendermint/tendermint/internal/consensus" tmjson "github.com/tendermint/tendermint/libs/json" "github.com/tendermint/tendermint/types" ) diff --git a/scripts/wal2json/main.go b/scripts/wal2json/main.go index 6fa890522..886e5402f 100644 --- a/scripts/wal2json/main.go +++ b/scripts/wal2json/main.go @@ -12,7 +12,7 @@ import ( "io" "os" - cs "github.com/tendermint/tendermint/consensus" + cs "github.com/tendermint/tendermint/internal/consensus" tmjson "github.com/tendermint/tendermint/libs/json" )