From 98e0889c66fd8dd6f7f216fa5fba045a26390b67 Mon Sep 17 00:00:00 2001 From: shotonoff Date: Wed, 9 Aug 2023 14:04:03 +0200 Subject: [PATCH] refactor: move light client into dash folder --- {light => dash/light}/client.go | 4 ++-- {light => dash/light}/client_benchmark_test.go | 6 +++--- {light => dash/light}/client_test.go | 8 ++++---- {light => dash/light}/dash_core_verifier.go | 0 {light => dash/light}/detector.go | 2 +- {light => dash/light}/doc.go | 0 {light => dash/light}/errors.go | 0 {light => dash/light}/example_test.go | 6 +++--- {light => dash/light}/helpers_test.go | 2 +- {light => dash/light}/light_test.go | 8 ++++---- {light => dash/light}/provider/errors.go | 0 {light => dash/light}/provider/http/http.go | 2 +- {light => dash/light}/provider/http/http_test.go | 4 ++-- {light => dash/light}/provider/mocks/provider.go | 0 {light => dash/light}/provider/provider.go | 0 {light => dash/light}/proxy/proxy.go | 4 ++-- {light => dash/light}/proxy/routes.go | 2 +- {light => dash/light}/rpc/client.go | 2 +- {light => dash/light}/rpc/client_test.go | 0 {light => dash/light}/rpc/mocks/light_client.go | 0 {light => dash/light}/setup.go | 6 +++--- {light => dash/light}/store/db/db.go | 2 +- {light => dash/light}/store/db/db_test.go | 0 {light => dash/light}/store/errors.go | 0 {light => dash/light}/store/store.go | 0 25 files changed, 29 insertions(+), 29 deletions(-) rename {light => dash/light}/client.go (99%) rename {light => dash/light}/client_benchmark_test.go (94%) rename {light => dash/light}/client_test.go (98%) rename {light => dash/light}/dash_core_verifier.go (100%) rename {light => dash/light}/detector.go (99%) rename {light => dash/light}/doc.go (100%) rename {light => dash/light}/errors.go (100%) rename {light => dash/light}/example_test.go (93%) rename {light => dash/light}/helpers_test.go (99%) rename {light => dash/light}/light_test.go (96%) rename {light => dash/light}/provider/errors.go (100%) rename {light => dash/light}/provider/http/http.go (99%) rename {light => dash/light}/provider/http/http_test.go (97%) rename {light => dash/light}/provider/mocks/provider.go (100%) rename {light => dash/light}/provider/provider.go (100%) rename {light => dash/light}/proxy/proxy.go (96%) rename {light => dash/light}/proxy/routes.go (99%) rename {light => dash/light}/rpc/client.go (99%) rename {light => dash/light}/rpc/client_test.go (100%) rename {light => dash/light}/rpc/mocks/light_client.go (100%) rename {light => dash/light}/setup.go (92%) rename {light => dash/light}/store/db/db.go (99%) rename {light => dash/light}/store/db/db_test.go (100%) rename {light => dash/light}/store/errors.go (100%) rename {light => dash/light}/store/store.go (100%) diff --git a/light/client.go b/dash/light/client.go similarity index 99% rename from light/client.go rename to dash/light/client.go index e37da257f6..e5feee2b4e 100644 --- a/light/client.go +++ b/dash/light/client.go @@ -12,10 +12,10 @@ import ( "github.com/tendermint/tendermint/crypto" dashcore "github.com/tendermint/tendermint/dash/core" + "github.com/tendermint/tendermint/dash/light/provider" + "github.com/tendermint/tendermint/dash/light/store" tmstrings "github.com/tendermint/tendermint/internal/libs/strings" "github.com/tendermint/tendermint/libs/log" - "github.com/tendermint/tendermint/light/provider" - "github.com/tendermint/tendermint/light/store" "github.com/tendermint/tendermint/types" ) diff --git a/light/client_benchmark_test.go b/dash/light/client_benchmark_test.go similarity index 94% rename from light/client_benchmark_test.go rename to dash/light/client_benchmark_test.go index e05f943e37..753b72f158 100644 --- a/light/client_benchmark_test.go +++ b/dash/light/client_benchmark_test.go @@ -9,10 +9,10 @@ import ( dbm "github.com/tendermint/tm-db" dashcore "github.com/tendermint/tendermint/dash/core" + "github.com/tendermint/tendermint/dash/light" + "github.com/tendermint/tendermint/dash/light/provider" + dbs "github.com/tendermint/tendermint/dash/light/store/db" "github.com/tendermint/tendermint/libs/log" - "github.com/tendermint/tendermint/light" - "github.com/tendermint/tendermint/light/provider" - dbs "github.com/tendermint/tendermint/light/store/db" "github.com/tendermint/tendermint/types" ) diff --git a/light/client_test.go b/dash/light/client_test.go similarity index 98% rename from light/client_test.go rename to dash/light/client_test.go index 852c9cbbbe..b84e22bb32 100644 --- a/light/client_test.go +++ b/dash/light/client_test.go @@ -15,11 +15,11 @@ import ( dbm "github.com/tendermint/tm-db" dashcore "github.com/tendermint/tendermint/dash/core" + "github.com/tendermint/tendermint/dash/light" + "github.com/tendermint/tendermint/dash/light/provider" + provider_mocks "github.com/tendermint/tendermint/dash/light/provider/mocks" + dbs "github.com/tendermint/tendermint/dash/light/store/db" "github.com/tendermint/tendermint/libs/log" - "github.com/tendermint/tendermint/light" - "github.com/tendermint/tendermint/light/provider" - provider_mocks "github.com/tendermint/tendermint/light/provider/mocks" - dbs "github.com/tendermint/tendermint/light/store/db" "github.com/tendermint/tendermint/types" ) diff --git a/light/dash_core_verifier.go b/dash/light/dash_core_verifier.go similarity index 100% rename from light/dash_core_verifier.go rename to dash/light/dash_core_verifier.go diff --git a/light/detector.go b/dash/light/detector.go similarity index 99% rename from light/detector.go rename to dash/light/detector.go index 78d148b749..cbaa9ad1fb 100644 --- a/light/detector.go +++ b/dash/light/detector.go @@ -6,7 +6,7 @@ import ( "errors" "time" - "github.com/tendermint/tendermint/light/provider" + "github.com/tendermint/tendermint/dash/light/provider" "github.com/tendermint/tendermint/types" ) diff --git a/light/doc.go b/dash/light/doc.go similarity index 100% rename from light/doc.go rename to dash/light/doc.go diff --git a/light/errors.go b/dash/light/errors.go similarity index 100% rename from light/errors.go rename to dash/light/errors.go diff --git a/light/example_test.go b/dash/light/example_test.go similarity index 93% rename from light/example_test.go rename to dash/light/example_test.go index ae452f1c77..f7f0141752 100644 --- a/light/example_test.go +++ b/dash/light/example_test.go @@ -13,10 +13,10 @@ import ( "github.com/tendermint/tendermint/abci/example/kvstore" dashcore "github.com/tendermint/tendermint/dash/core" + "github.com/tendermint/tendermint/dash/light" + httpp "github.com/tendermint/tendermint/dash/light/provider/http" + dbs "github.com/tendermint/tendermint/dash/light/store/db" "github.com/tendermint/tendermint/libs/log" - "github.com/tendermint/tendermint/light" - httpp "github.com/tendermint/tendermint/light/provider/http" - dbs "github.com/tendermint/tendermint/light/store/db" rpctest "github.com/tendermint/tendermint/rpc/test" ) diff --git a/light/helpers_test.go b/dash/light/helpers_test.go similarity index 99% rename from light/helpers_test.go rename to dash/light/helpers_test.go index 2d703c2135..c6803b67fe 100644 --- a/light/helpers_test.go +++ b/dash/light/helpers_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/crypto" - provider_mocks "github.com/tendermint/tendermint/light/provider/mocks" + provider_mocks "github.com/tendermint/tendermint/dash/light/provider/mocks" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/tendermint/tendermint/types" "github.com/tendermint/tendermint/version" diff --git a/light/light_test.go b/dash/light/light_test.go similarity index 96% rename from light/light_test.go rename to dash/light/light_test.go index a906a9582d..5d02f15c97 100644 --- a/light/light_test.go +++ b/dash/light/light_test.go @@ -12,11 +12,11 @@ import ( "github.com/tendermint/tendermint/abci/example/kvstore" dashcore "github.com/tendermint/tendermint/dash/core" + "github.com/tendermint/tendermint/dash/light" + "github.com/tendermint/tendermint/dash/light/provider" + httpp "github.com/tendermint/tendermint/dash/light/provider/http" + dbs "github.com/tendermint/tendermint/dash/light/store/db" "github.com/tendermint/tendermint/libs/log" - "github.com/tendermint/tendermint/light" - "github.com/tendermint/tendermint/light/provider" - httpp "github.com/tendermint/tendermint/light/provider/http" - dbs "github.com/tendermint/tendermint/light/store/db" "github.com/tendermint/tendermint/privval" rpctest "github.com/tendermint/tendermint/rpc/test" "github.com/tendermint/tendermint/types" diff --git a/light/provider/errors.go b/dash/light/provider/errors.go similarity index 100% rename from light/provider/errors.go rename to dash/light/provider/errors.go diff --git a/light/provider/http/http.go b/dash/light/provider/http/http.go similarity index 99% rename from light/provider/http/http.go rename to dash/light/provider/http/http.go index f65262b420..53f4adc35c 100644 --- a/light/provider/http/http.go +++ b/dash/light/provider/http/http.go @@ -13,7 +13,7 @@ import ( "github.com/tendermint/tendermint/crypto" - "github.com/tendermint/tendermint/light/provider" + "github.com/tendermint/tendermint/dash/light/provider" rpcclient "github.com/tendermint/tendermint/rpc/client" rpchttp "github.com/tendermint/tendermint/rpc/client/http" "github.com/tendermint/tendermint/rpc/coretypes" diff --git a/light/provider/http/http_test.go b/dash/light/provider/http/http_test.go similarity index 97% rename from light/provider/http/http_test.go rename to dash/light/provider/http/http_test.go index fc69274900..52a9a0e9aa 100644 --- a/light/provider/http/http_test.go +++ b/dash/light/provider/http/http_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/abci/example/kvstore" - "github.com/tendermint/tendermint/light/provider" - lighthttp "github.com/tendermint/tendermint/light/provider/http" + "github.com/tendermint/tendermint/dash/light/provider" + lighthttp "github.com/tendermint/tendermint/dash/light/provider/http" rpcclient "github.com/tendermint/tendermint/rpc/client" rpchttp "github.com/tendermint/tendermint/rpc/client/http" rpcmock "github.com/tendermint/tendermint/rpc/client/mocks" diff --git a/light/provider/mocks/provider.go b/dash/light/provider/mocks/provider.go similarity index 100% rename from light/provider/mocks/provider.go rename to dash/light/provider/mocks/provider.go diff --git a/light/provider/provider.go b/dash/light/provider/provider.go similarity index 100% rename from light/provider/provider.go rename to dash/light/provider/provider.go diff --git a/light/proxy/proxy.go b/dash/light/proxy/proxy.go similarity index 96% rename from light/proxy/proxy.go rename to dash/light/proxy/proxy.go index 6e7a5ff2a6..df3dff9879 100644 --- a/light/proxy/proxy.go +++ b/dash/light/proxy/proxy.go @@ -6,11 +6,11 @@ import ( "net" "net/http" + "github.com/tendermint/tendermint/dash/light" + lrpc "github.com/tendermint/tendermint/dash/light/rpc" tmpubsub "github.com/tendermint/tendermint/internal/pubsub" rpccore "github.com/tendermint/tendermint/internal/rpc/core" "github.com/tendermint/tendermint/libs/log" - "github.com/tendermint/tendermint/light" - lrpc "github.com/tendermint/tendermint/light/rpc" rpchttp "github.com/tendermint/tendermint/rpc/client/http" rpcserver "github.com/tendermint/tendermint/rpc/jsonrpc/server" ) diff --git a/light/proxy/routes.go b/dash/light/proxy/routes.go similarity index 99% rename from light/proxy/routes.go rename to dash/light/proxy/routes.go index df8b5f9dba..66fd6df3ba 100644 --- a/light/proxy/routes.go +++ b/dash/light/proxy/routes.go @@ -3,7 +3,7 @@ package proxy import ( "context" - lrpc "github.com/tendermint/tendermint/light/rpc" + lrpc "github.com/tendermint/tendermint/dash/light/rpc" rpcclient "github.com/tendermint/tendermint/rpc/client" "github.com/tendermint/tendermint/rpc/coretypes" ) diff --git a/light/rpc/client.go b/dash/light/rpc/client.go similarity index 99% rename from light/rpc/client.go rename to dash/light/rpc/client.go index 9c6df91bf2..d81bf3d552 100644 --- a/light/rpc/client.go +++ b/dash/light/rpc/client.go @@ -18,7 +18,7 @@ import ( tmbytes "github.com/tendermint/tendermint/libs/bytes" "github.com/tendermint/tendermint/libs/log" tmmath "github.com/tendermint/tendermint/libs/math" - service "github.com/tendermint/tendermint/libs/service" + "github.com/tendermint/tendermint/libs/service" rpcclient "github.com/tendermint/tendermint/rpc/client" "github.com/tendermint/tendermint/rpc/coretypes" rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types" diff --git a/light/rpc/client_test.go b/dash/light/rpc/client_test.go similarity index 100% rename from light/rpc/client_test.go rename to dash/light/rpc/client_test.go diff --git a/light/rpc/mocks/light_client.go b/dash/light/rpc/mocks/light_client.go similarity index 100% rename from light/rpc/mocks/light_client.go rename to dash/light/rpc/mocks/light_client.go diff --git a/light/setup.go b/dash/light/setup.go similarity index 92% rename from light/setup.go rename to dash/light/setup.go index a6c3e6703b..aca445c649 100644 --- a/light/setup.go +++ b/dash/light/setup.go @@ -4,9 +4,9 @@ import ( "context" dashcore "github.com/tendermint/tendermint/dash/core" - "github.com/tendermint/tendermint/light/provider" - "github.com/tendermint/tendermint/light/provider/http" - "github.com/tendermint/tendermint/light/store" + "github.com/tendermint/tendermint/dash/light/provider" + "github.com/tendermint/tendermint/dash/light/provider/http" + "github.com/tendermint/tendermint/dash/light/store" ) // NewHTTPClient initiates an instance of a light client using HTTP addresses diff --git a/light/store/db/db.go b/dash/light/store/db/db.go similarity index 99% rename from light/store/db/db.go rename to dash/light/store/db/db.go index c72898f140..e289d48953 100644 --- a/light/store/db/db.go +++ b/dash/light/store/db/db.go @@ -9,7 +9,7 @@ import ( "github.com/google/orderedcode" dbm "github.com/tendermint/tm-db" - "github.com/tendermint/tendermint/light/store" + "github.com/tendermint/tendermint/dash/light/store" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/tendermint/tendermint/types" ) diff --git a/light/store/db/db_test.go b/dash/light/store/db/db_test.go similarity index 100% rename from light/store/db/db_test.go rename to dash/light/store/db/db_test.go diff --git a/light/store/errors.go b/dash/light/store/errors.go similarity index 100% rename from light/store/errors.go rename to dash/light/store/errors.go diff --git a/light/store/store.go b/dash/light/store/store.go similarity index 100% rename from light/store/store.go rename to dash/light/store/store.go