From 091b785416a594aca0cc5a3bdaddff1a74a3e890 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Wed, 5 Jan 2022 15:12:26 +0000 Subject: [PATCH] chore(imports): fix imports post file moves --- .github/PULL_REQUEST/pull_request.go | 2 +- Dockerfile | 4 +- Makefile | 14 ++-- cmd/gossamer/README.md | 40 +++++----- cmd/gossamer/account.go | 6 +- cmd/gossamer/account_test.go | 2 +- cmd/gossamer/config.go | 32 ++++---- cmd/gossamer/config_test.go | 16 ++-- cmd/gossamer/export.go | 6 +- cmd/gossamer/export_test.go | 8 +- cmd/gossamer/flags.go | 2 +- cmd/gossamer/flags_test.go | 6 +- cmd/gossamer/import_runtime.go | 4 +- cmd/gossamer/import_runtime_test.go | 6 +- cmd/gossamer/main.go | 8 +- cmd/gossamer/main_test.go | 14 ++-- cmd/gossamer/prune_test.go | 4 +- cmd/gossamer/toml_config.go | 2 +- cmd/gossamer/toml_config_test.go | 12 +-- cmd/gossamer/utils.go | 4 +- docs/docs/usage/configuration.md | 2 +- internal/chain/dev/config.toml | 2 +- internal/chain/dev/defaults.go | 8 +- internal/chain/gssmr/config.toml | 2 +- internal/chain/gssmr/defaults.go | 8 +- internal/chain/kusama/config.toml | 2 +- internal/chain/kusama/defaults.go | 8 +- internal/chain/polkadot/config.toml | 2 +- internal/chain/polkadot/defaults.go | 8 +- internal/dot/build_spec.go | 8 +- internal/dot/build_spec_test.go | 2 +- internal/dot/config.go | 14 ++-- internal/dot/config_test.go | 2 +- internal/dot/core/interface.go | 14 ++-- internal/dot/core/messages.go | 10 +-- internal/dot/core/messages_test.go | 18 ++--- internal/dot/core/mocks/block_state.go | 8 +- internal/dot/core/mocks/digest_handler.go | 2 +- internal/dot/core/mocks/network.go | 7 +- internal/dot/core/mocks/storage_state.go | 6 +- internal/dot/core/service.go | 22 +++--- internal/dot/core/service_test.go | 26 +++---- internal/dot/core/test_helpers.go | 20 ++--- internal/dot/digest/digest.go | 4 +- internal/dot/digest/digest_test.go | 14 ++-- internal/dot/digest/interface.go | 4 +- internal/dot/import.go | 8 +- internal/dot/import_test.go | 8 +- internal/dot/network/README.md | 2 +- internal/dot/network/block_announce.go | 4 +- internal/dot/network/block_announce_test.go | 6 +- internal/dot/network/config_test.go | 4 +- internal/dot/network/connmgr.go | 2 +- internal/dot/network/connmgr_test.go | 4 +- internal/dot/network/discovery_test.go | 2 +- internal/dot/network/gossip_test.go | 2 +- internal/dot/network/host.go | 2 +- internal/dot/network/host_test.go | 6 +- internal/dot/network/light.go | 4 +- internal/dot/network/light_test.go | 6 +- internal/dot/network/mdns_test.go | 2 +- internal/dot/network/message.go | 8 +- internal/dot/network/message_cache.go | 2 +- internal/dot/network/message_cache_test.go | 4 +- internal/dot/network/message_test.go | 6 +- internal/dot/network/mock_block_state.go | 4 +- internal/dot/network/notifications.go | 2 +- internal/dot/network/notifications_test.go | 6 +- internal/dot/network/proto/api.v1.proto | 2 +- internal/dot/network/service.go | 10 +-- internal/dot/network/service_test.go | 2 +- internal/dot/network/state.go | 6 +- internal/dot/network/sync.go | 2 +- internal/dot/network/test_helpers.go | 6 +- internal/dot/network/transaction.go | 4 +- internal/dot/network/transaction_test.go | 4 +- internal/dot/network/utils_test.go | 2 +- internal/dot/node.go | 26 +++---- internal/dot/node_test.go | 22 +++--- internal/dot/rpc/dot_up_codec.go | 4 +- internal/dot/rpc/helpers.go | 2 +- internal/dot/rpc/http.go | 8 +- internal/dot/rpc/http_test.go | 12 +-- internal/dot/rpc/modules/api.go | 22 +++--- internal/dot/rpc/modules/api_mocks.go | 10 +-- internal/dot/rpc/modules/author.go | 6 +- .../rpc/modules/author_integration_test.go | 18 ++--- internal/dot/rpc/modules/author_test.go | 14 ++-- internal/dot/rpc/modules/chain.go | 4 +- .../dot/rpc/modules/chain_integration_test.go | 18 ++--- internal/dot/rpc/modules/chain_test.go | 6 +- internal/dot/rpc/modules/childstate.go | 2 +- .../modules/childstate_integration_test.go | 6 +- internal/dot/rpc/modules/childstate_test.go | 10 +-- internal/dot/rpc/modules/dev.go | 2 +- .../dot/rpc/modules/dev_integration_test.go | 22 +++--- internal/dot/rpc/modules/dev_test.go | 2 +- internal/dot/rpc/modules/grandpa.go | 4 +- .../rpc/modules/grandpa_integration_test.go | 12 +-- internal/dot/rpc/modules/grandpa_test.go | 12 +-- internal/dot/rpc/modules/mocks/block_api.go | 6 +- .../rpc/modules/mocks/block_finality_api.go | 4 +- internal/dot/rpc/modules/mocks/core_api.go | 10 +-- internal/dot/rpc/modules/mocks/network_api.go | 2 +- internal/dot/rpc/modules/mocks/storage_api.go | 6 +- .../dot/rpc/modules/mocks/sync_state_api.go | 2 +- .../modules/mocks/transaction_state_api.go | 6 +- internal/dot/rpc/modules/offchain.go | 2 +- .../rpc/modules/offchain_integration_test.go | 4 +- internal/dot/rpc/modules/offchain_test.go | 4 +- internal/dot/rpc/modules/payment.go | 2 +- .../rpc/modules/payment_integration_test.go | 8 +- internal/dot/rpc/modules/payment_test.go | 8 +- internal/dot/rpc/modules/state.go | 4 +- .../dot/rpc/modules/state_integration_test.go | 8 +- internal/dot/rpc/modules/state_test.go | 10 +-- internal/dot/rpc/modules/sync_state.go | 4 +- .../modules/sync_state_integration_test.go | 2 +- internal/dot/rpc/modules/sync_state_test.go | 6 +- internal/dot/rpc/modules/system.go | 4 +- .../rpc/modules/system_integration_test.go | 26 +++---- internal/dot/rpc/modules/system_test.go | 10 +-- internal/dot/rpc/service_test.go | 4 +- internal/dot/rpc/subscription/listeners.go | 12 +-- .../dot/rpc/subscription/listeners_test.go | 18 ++--- internal/dot/rpc/subscription/websocket.go | 6 +- .../dot/rpc/subscription/websocket_test.go | 12 +-- internal/dot/rpc/websocket_test.go | 8 +- internal/dot/services.go | 40 +++++----- internal/dot/services_test.go | 10 +-- internal/dot/state/base.go | 6 +- internal/dot/state/base_test.go | 6 +- internal/dot/state/block.go | 12 +-- internal/dot/state/block_data.go | 2 +- internal/dot/state/block_data_test.go | 6 +- internal/dot/state/block_finalisation.go | 6 +- internal/dot/state/block_finalisation_test.go | 2 +- internal/dot/state/block_notify.go | 6 +- internal/dot/state/block_notify_test.go | 6 +- internal/dot/state/block_race_test.go | 4 +- internal/dot/state/block_test.go | 6 +- internal/dot/state/bloom.go | 2 +- internal/dot/state/epoch.go | 2 +- internal/dot/state/epoch_test.go | 6 +- internal/dot/state/grandpa.go | 4 +- internal/dot/state/grandpa_test.go | 6 +- internal/dot/state/initialize.go | 16 ++-- internal/dot/state/offline_pruner.go | 8 +- internal/dot/state/pruner/pruner.go | 2 +- internal/dot/state/service.go | 10 +-- internal/dot/state/service_test.go | 16 ++-- internal/dot/state/storage.go | 10 +-- internal/dot/state/storage_notify.go | 2 +- internal/dot/state/storage_notify_test.go | 2 +- internal/dot/state/storage_test.go | 8 +- internal/dot/state/test_helpers.go | 10 +-- internal/dot/state/transaction.go | 8 +- internal/dot/state/transaction_test.go | 6 +- internal/dot/sync/block_queue.go | 4 +- internal/dot/sync/bootstrap_syncer.go | 4 +- internal/dot/sync/bootstrap_syncer_test.go | 8 +- internal/dot/sync/chain_processor.go | 6 +- internal/dot/sync/chain_processor_test.go | 10 +-- internal/dot/sync/chain_sync.go | 10 +-- internal/dot/sync/chain_sync_test.go | 12 +-- internal/dot/sync/disjoint_block_set.go | 4 +- internal/dot/sync/disjoint_block_set_test.go | 4 +- internal/dot/sync/interface.go | 12 +-- internal/dot/sync/message.go | 6 +- internal/dot/sync/message_test.go | 10 +-- internal/dot/sync/mocks/babe_verifier.go | 2 +- .../dot/sync/mocks/block_import_handler.go | 4 +- internal/dot/sync/mocks/block_state.go | 6 +- internal/dot/sync/mocks/finality_gadget.go | 2 +- internal/dot/sync/mocks/network.go | 6 +- internal/dot/sync/syncer.go | 4 +- internal/dot/sync/syncer_test.go | 22 +++--- internal/dot/sync/test_helpers.go | 4 +- internal/dot/sync/tip_syncer.go | 4 +- internal/dot/sync/tip_syncer_test.go | 10 +-- internal/dot/sync/worker.go | 4 +- internal/dot/system/service.go | 4 +- internal/dot/system/service_test.go | 4 +- .../telemetry/afg_finalized_blocks_up_to.go | 2 +- internal/dot/telemetry/afg_received.go | 2 +- internal/dot/telemetry/block_import.go | 2 +- internal/dot/telemetry/notify_finalized.go | 2 +- .../telemetry/prepared_block_for_proposing.go | 2 +- internal/dot/telemetry/system_connected.go | 2 +- internal/dot/telemetry/system_interval.go | 2 +- internal/dot/telemetry/telemetry.go | 2 +- internal/dot/telemetry/telemetry_test.go | 4 +- internal/dot/types/authority.go | 6 +- internal/dot/types/babe_digest.go | 2 +- internal/dot/types/babe_digest_test.go | 2 +- internal/dot/types/babe_test.go | 4 +- internal/dot/types/block_data.go | 2 +- internal/dot/types/block_data_test.go | 2 +- internal/dot/types/block_test.go | 2 +- internal/dot/types/body.go | 2 +- internal/dot/types/body_test.go | 2 +- internal/dot/types/consensus_digest_test.go | 6 +- internal/dot/types/digest.go | 2 +- internal/dot/types/digest_test.go | 2 +- internal/dot/types/extrinsic.go | 2 +- internal/dot/types/grandpa.go | 4 +- internal/dot/types/grandpa_test.go | 2 +- internal/dot/types/header.go | 2 +- internal/dot/types/header_test.go | 2 +- internal/dot/utils.go | 10 +-- internal/dot/utils_test.go | 6 +- internal/lib/babe/babe.go | 8 +- internal/lib/babe/babe_test.go | 24 +++--- internal/lib/babe/build.go | 10 +-- internal/lib/babe/build_test.go | 12 +-- internal/lib/babe/crypto.go | 4 +- internal/lib/babe/epoch_test.go | 6 +- .../lib/babe/mocks/block_import_handler.go | 4 +- internal/lib/babe/secondary.go | 6 +- internal/lib/babe/secondary_test.go | 4 +- internal/lib/babe/state.go | 10 +-- internal/lib/babe/types.go | 4 +- internal/lib/babe/verify.go | 6 +- internal/lib/babe/verify_test.go | 10 +-- internal/lib/blocktree/blocktree.go | 6 +- internal/lib/blocktree/blocktree_test.go | 4 +- internal/lib/blocktree/leaves.go | 2 +- internal/lib/blocktree/node.go | 2 +- internal/lib/common/hasher_test.go | 2 +- internal/lib/common/types/result.go | 2 +- internal/lib/common/variadic/uint64OrHash.go | 2 +- .../lib/common/variadic/uint64OrHash_test.go | 2 +- internal/lib/crypto/ed25519/ed25519.go | 4 +- internal/lib/crypto/ed25519/ed25519_test.go | 4 +- internal/lib/crypto/keypair.go | 2 +- internal/lib/crypto/keypair_test.go | 4 +- internal/lib/crypto/secp256k1/secp256k1.go | 4 +- .../lib/crypto/secp256k1/secp256k1_test.go | 4 +- internal/lib/crypto/sig_verifier_test.go | 8 +- internal/lib/crypto/sr25519/sr25519.go | 4 +- internal/lib/crypto/sr25519/sr25519_test.go | 2 +- internal/lib/genesis/genesis.go | 2 +- internal/lib/genesis/helpers.go | 14 ++-- internal/lib/genesis/helpers_test.go | 6 +- internal/lib/genesis/test_utils.go | 23 +++--- internal/lib/grandpa/errors.go | 2 +- internal/lib/grandpa/grandpa.go | 10 +-- internal/lib/grandpa/grandpa_test.go | 24 +++--- internal/lib/grandpa/message.go | 8 +- internal/lib/grandpa/message_handler.go | 12 +-- internal/lib/grandpa/message_handler_test.go | 12 +-- internal/lib/grandpa/message_test.go | 8 +- internal/lib/grandpa/message_tracker.go | 6 +- internal/lib/grandpa/message_tracker_test.go | 8 +- internal/lib/grandpa/mocks/network.go | 5 +- internal/lib/grandpa/network.go | 4 +- internal/lib/grandpa/network_test.go | 2 +- internal/lib/grandpa/round_test.go | 12 +-- internal/lib/grandpa/state.go | 6 +- internal/lib/grandpa/types.go | 6 +- internal/lib/grandpa/types_test.go | 8 +- internal/lib/grandpa/vote_message.go | 6 +- internal/lib/grandpa/vote_message_test.go | 8 +- internal/lib/keystore/basic_keystore.go | 4 +- internal/lib/keystore/basic_keystore_test.go | 4 +- internal/lib/keystore/encrypt.go | 8 +- internal/lib/keystore/encrypt_test.go | 6 +- internal/lib/keystore/generic_keystore.go | 10 +-- .../lib/keystore/generic_keystore_test.go | 8 +- internal/lib/keystore/helpers.go | 12 +-- internal/lib/keystore/helpers_test.go | 10 +-- internal/lib/keystore/keyring.go | 8 +- internal/lib/keystore/keyring_test.go | 4 +- internal/lib/keystore/keystore.go | 4 +- internal/lib/runtime/constants.go | 2 +- internal/lib/runtime/interface.go | 10 +-- internal/lib/runtime/life/exports.go | 6 +- internal/lib/runtime/life/exports_test.go | 14 ++-- internal/lib/runtime/life/instance.go | 8 +- internal/lib/runtime/life/resolver.go | 16 ++-- internal/lib/runtime/life/resolver_test.go | 20 ++--- internal/lib/runtime/life/test_helpers.go | 8 +- internal/lib/runtime/mocks/instance.go | 10 +-- .../lib/runtime/mocks/transaction_state.go | 4 +- internal/lib/runtime/mocks/version.go | 2 +- internal/lib/runtime/storage/trie.go | 4 +- internal/lib/runtime/storage/trie_test.go | 4 +- internal/lib/runtime/test_helpers.go | 8 +- internal/lib/runtime/types.go | 8 +- internal/lib/runtime/types_test.go | 10 +-- internal/lib/runtime/wasmer/exports.go | 6 +- internal/lib/runtime/wasmer/exports_test.go | 16 ++-- internal/lib/runtime/wasmer/imports.go | 20 ++--- internal/lib/runtime/wasmer/imports_test.go | 20 ++--- internal/lib/runtime/wasmer/instance.go | 12 +-- internal/lib/runtime/wasmer/instance_test.go | 2 +- internal/lib/runtime/wasmer/test_helpers.go | 12 +-- internal/lib/services/services_test.go | 2 +- internal/lib/transaction/pool.go | 2 +- internal/lib/transaction/pool_test.go | 2 +- internal/lib/transaction/priority_queue.go | 4 +- internal/lib/transaction/types.go | 2 +- internal/lib/trie/child_storage.go | 2 +- internal/lib/trie/database.go | 2 +- internal/lib/trie/database_test.go | 2 +- internal/lib/trie/print.go | 2 +- internal/lib/trie/proof.go | 2 +- internal/lib/trie/trie.go | 2 +- internal/lib/trie/trie_test.go | 2 +- internal/lib/utils/utils.go | 75 ++++++++++++------- internal/tests/data/db/config.toml | 4 +- .../polkadotjs_test/start_polkadotjs_test.go | 2 +- internal/tests/rpc/rpc_00_test.go | 2 +- internal/tests/rpc/rpc_01-system_test.go | 4 +- internal/tests/rpc/rpc_02-author_test.go | 2 +- internal/tests/rpc/rpc_03-chain_test.go | 4 +- internal/tests/rpc/rpc_04-offchain_test.go | 2 +- internal/tests/rpc/rpc_05-state_test.go | 4 +- internal/tests/rpc/rpc_06-engine_test.go | 2 +- internal/tests/rpc/rpc_07-payment_test.go | 2 +- internal/tests/rpc/rpc_08-contracts_test.go | 2 +- internal/tests/rpc/rpc_09-babe_test.go | 2 +- internal/tests/rpc/system_integration_test.go | 4 +- internal/tests/stress/grandpa_test.go | 2 +- internal/tests/stress/helpers.go | 6 +- internal/tests/stress/network_test.go | 2 +- internal/tests/stress/stress_test.go | 6 +- internal/tests/sync/sync_test.go | 2 +- internal/tests/utils/chain.go | 6 +- internal/tests/utils/dev.go | 2 +- internal/tests/utils/gossamer_utils.go | 12 +-- internal/tests/utils/header.go | 6 +- internal/tests/utils/request_utils.go | 4 +- internal/tests/utils/state.go | 2 +- internal/tests/utils/system.go | 4 +- internal/trie/node/branch.go | 2 +- internal/trie/node/branch_encode.go | 2 +- internal/trie/node/hash.go | 2 +- internal/trie/node/leaf.go | 2 +- scripts/docker-entrypoint.sh | 2 +- scripts/integration-test-all.sh | 2 +- 341 files changed, 1171 insertions(+), 1157 deletions(-) diff --git a/.github/PULL_REQUEST/pull_request.go b/.github/PULL_REQUEST/pull_request.go index 98ce0d67c83..685ce671238 100644 --- a/.github/PULL_REQUEST/pull_request.go +++ b/.github/PULL_REQUEST/pull_request.go @@ -7,7 +7,7 @@ import ( "fmt" "os" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/lib/utils" ) func main() { diff --git a/Dockerfile b/Dockerfile index cc79eef2747..0dc721d3752 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,8 +18,8 @@ RUN wget -O /usr/local/bin/subkey https://chainbridge.ams3.digitaloceanspaces.co chmod +x /usr/local/bin/subkey # Polkadot JS dependencies -WORKDIR /go/src/github.com/ChainSafe/gossamer/tests/polkadotjs_test -COPY tests/polkadotjs_test/package.json tests/polkadotjs_test/package-lock.json ./ +WORKDIR /go/src/github.com/ChainSafe/gossamer/internal/tests/polkadotjs_test +COPY internal/tests/polkadotjs_test/package.json internal/tests/polkadotjs_test/package-lock.json ./ RUN npm install WORKDIR /go/src/github.com/ChainSafe/gossamer diff --git a/Makefile b/Makefile index d12d358db95..7b648c68c81 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ format: proto: go install google.golang.org/protobuf/cmd/protoc-gen-go - protoc -I=./dot/network/proto --go_out=./dot/network/proto dot/network/proto/api.v1.proto + protoc -I=./internal/dot/network/proto --go_out=./internal/dot/network/proto dot/network/proto/api.v1.proto ## test: Runs `go test` on project test files. test: @@ -47,28 +47,28 @@ it-stable: ## it-stress: Runs Integration Tests stress mode it-stress: build @echo " > \033[32mRunning stress tests...\033[0m " - HOSTNAME=0.0.0.0 MODE=stress go test ./tests/stress/... -timeout=15m -v -short -run TestSync_ + HOSTNAME=0.0.0.0 MODE=stress go test ./internal/tests/stress/... -timeout=15m -v -short -run TestSync_ it-grandpa: build @echo " > \033[32mRunning GRANDPA stress tests...\033[0m " - HOSTNAME=0.0.0.0 MODE=stress go test ./tests/stress/... -timeout=12m -v -short -run TestStress_Grandpa_ + HOSTNAME=0.0.0.0 MODE=stress go test ./internal/tests/stress/... -timeout=12m -v -short -run TestStress_Grandpa_ it-rpc: build @echo " > \033[32mRunning Integration Tests RPC Specs mode...\033[0m " - HOSTNAME=0.0.0.0 MODE=rpc go test ./tests/rpc/... -timeout=10m -v + HOSTNAME=0.0.0.0 MODE=rpc go test ./internal/tests/rpc/... -timeout=10m -v it-sync: build @echo " > \033[32mRunning Integration Tests sync mode...\033[0m " - HOSTNAME=0.0.0.0 MODE=sync go test ./tests/sync/... -timeout=5m -v + HOSTNAME=0.0.0.0 MODE=sync go test ./internal/tests/sync/... -timeout=5m -v it-polkadotjs: build @echo " > \033[32mRunning Integration Tests polkadot.js/api mode...\033[0m " - HOSTNAME=0.0.0.0 MODE=polkadot go test ./tests/polkadotjs_test/... -timeout=5m -v + HOSTNAME=0.0.0.0 MODE=polkadot go test ./internal/tests/polkadotjs_test/... -timeout=5m -v ## test: Runs `go test -race` on project test files. test-state-race: @echo " > \033[32mRunning race tests...\033[0m " - go test ./dot/state/... -short -race -timeout=5m + go test ./internal/dot/state/... -short -race -timeout=5m ## deps: Install missing dependencies. Runs `go mod download` internally. deps: diff --git a/cmd/gossamer/README.md b/cmd/gossamer/README.md index f71ac24f2f7..97ed4c1291d 100644 --- a/cmd/gossamer/README.md +++ b/cmd/gossamer/README.md @@ -20,7 +20,7 @@ This is the default Gossamer execution method, which invokes the `gossamerAction blockchain client are [described below in the Client Components section](#client-components). - `--basepath` - the path to the directory where Gossamer will store its data -- `--chain` - specifies the [chain configuration](../../chain) that the +- `--chain` - specifies the [chain configuration](../../internal/chain) that the [Gossamer host node](https://chainsafe.github.io/gossamer/getting-started/overview/host-architecture/) should load - `--key` - specifies a test keyring account to use (e.g. `--key=alice`) - `--log` - supports levels `crit` (silent), `error`, `warn`, `info`, `debug`, and `trce` (detailed), default is `info` @@ -39,7 +39,7 @@ This subcommand accepts a genesis configuration file and uses it to initialise t The `account` subcommand provides the user with capabilities related to generating and using `ed25519`, `secp256k1`, and `sr25519` [account keys](https://wiki.polkadot.network/docs/learn-keys), and managing the keys present in the [Gossamer keystore](#keystore). The `accountAction` function is defined in [account.go](account.go); it is an interface -to the capabilities defined in the [`lib/crypto`](../../lib/crypto) and [`lib/keystore`](../../lib/keystore) packages. +to the capabilities defined in the [`lib/crypto`](../../internal/lib/crypto) and [`lib/keystore`](../../internal/lib/keystore) packages. This subcommand provides capabilities that are similar to [Parity's Subkey utility](https://docs.substrate.io/v3/tools/subkey). @@ -68,7 +68,7 @@ in [`main.go`](main.go). ### Import State Subcommand -The `import-state` subcommand allows a user to seed [Gossamer storage](../../dot/state) with key-value pairs in the form +The `import-state` subcommand allows a user to seed [Gossamer storage](../../internal/dot/state) with key-value pairs in the form of a JSON file. The input for this subcommand can be retrieved from [the `state_getPairs` RPC endpoint](https://github.com/w3f/PSPs/blob/master/PSPs/drafts/psp-6.md#1114-state_getpairs). The `importStateAction` function is defined in [`main.go`](main.go). @@ -86,7 +86,7 @@ The `importStateAction` function is defined in [`main.go`](main.go). The `export` subcommand transforms a genesis configuration and Gossamer state into a TOML configuration file. This subcommand invokes the `exportAction` function defined in [`export.go`](export.go). -- `--config` - path to a TOML configuration file (e.g. those defined in [the `chain` directory](../../chain)) +- `--config` - path to a TOML configuration file (e.g. those defined in [the `chain` directory](../../internal/chain)) - `--basepath` - path to the Gossamer data directory that defines the state to export ## Client Components @@ -96,8 +96,8 @@ In its default method of execution, Gossamer orchestrates a number of modular se a blockchain network. Alongside these services, Gossamer manages [a keystore](#keystore), [a runtime](#runtime), and [monitoring utilities](#monitoring), all of which are described in greater detail below. The entry point to the Gossamer blockchain client capabilities is the `gossamerAction` function that is defined in [main.go](main.go), which in turn -invokes the `NewNode` function in [dot/node.go](../../dot/node.go). `NewNode` calls into functions that are defined in -[dot/services.go](../../dot/services.go) and starts the services that power a Gossamer node. +invokes the `NewNode` function in [dot/node.go](../../internal/dot/node.go). `NewNode` calls into functions that are defined in +[dot/services.go](../../internal/dot/services.go) and starts the services that power a Gossamer node. ### Services & Capabilities @@ -108,11 +108,11 @@ What follows is a list that describes the services and capabilities that inform This service is a wrapper around an instance of [`chaindb`](https://github.com/ChainSafe/chaindb), a key-value database that is built on top of [BadgerDB](https://github.com/dgraph-io/badger) from [Dgraph](https://dgraph.io/). The state service provides storage capabilities for the other Gossamer services - each service is assigned a prefix that is added -to its storage keys. The state service is defined in [dot/state/service.go](../../dot/state/service.go). +to its storage keys. The state service is defined in [dot/state/service.go](../../internal/dot/state/service.go). #### Network -The network service, which is defined in [dot/network/service.go](../../dot/network/service.go), is built on top of +The network service, which is defined in [dot/network/service.go](../../internal/dot/network/service.go), is built on top of [the Go implementation](https://github.com/libp2p/go-libp2p) of [the `libp2p` protocol](https://libp2p.io/). This service manages a `libp2p` "host", a peer-to-peer networking term for a network participant that is providing both client _and_ server capabilities to a peer-to-peer network. Gossamer's network service manages the discovery of other @@ -120,7 +120,7 @@ hosts as well as the connections with these hosts that allow Gossamer to communi #### Digest Handler -The digest handler ([dot/digest/digest.go](../../dot/digest/digest.go)) manages the verification of the +The digest handler ([dot/digest/digest.go](../../internal/dot/digest/digest.go)) manages the verification of the [digests](https://docs.substrate.io/v3/getting-started/glossary/#digest) that are present in block headers. #### Consensus @@ -128,40 +128,40 @@ The digest handler ([dot/digest/digest.go](../../dot/digest/digest.go)) manages The BABE and GRANDPA services work together to provide Gossamer with its [hybrid consensus](https://wiki.polkadot.network/docs/learn-consensus#hybrid-consensus) capabilities. The term "hybrid consensus" refers to the fact that block _production_ is decoupled from block _finalisation_. Block production is -handled by the BABE service, which is defined in [lib/babe/babe.go](../../lib/babe/babe.go); block finalisation is -handled by the GRANDPA service, which is defined in [lib/grandpa/grandpa.go](../../lib/grandpa/grandpa.go). +handled by the BABE service, which is defined in [lib/babe/babe.go](../../internal/lib/babe/babe.go); block finalisation is +handled by the GRANDPA service, which is defined in [lib/grandpa/grandpa.go](../../internal/lib/grandpa/grandpa.go). #### Sync This service is concerned with keeping Gossamer in sync with a blockchain - it implements a "bootstrap" mode, to download and verify blocks that are part of an existing chain's history, and a "tip-syncing" mode that manages the multiple candidate forks that may exist at the head of a live chain. The sync service makes use of -[a block verification utility](../../lib/babe/verify.go) that implements BABE logic and is used by Gossamer to verify +[a block verification utility](../../internal/lib/babe/verify.go) that implements BABE logic and is used by Gossamer to verify blocks that were produced by other other nodes in the network. The sync service is defined in -[dot/sync/syncer.go](../../dot/sync/syncer.go). +[dot/sync/syncer.go](../../internal/dot/sync/syncer.go). #### RPC -This service, which is defined in [dot/rpc/service.go](../../dot/rpc/service.go), exposes a JSON-RPC interface that is +This service, which is defined in [dot/rpc/service.go](../../internal/dot/rpc/service.go), exposes a JSON-RPC interface that is used by client applications like [Polkadot JS Apps UI](https://polkadot.js.org/apps/). The RPC interface is used to interact with Gossamer to perform administrative tasks such as key management, as well as for interacting with the runtime by querying storage and submitting transactions, and inspecting the chain's history. #### System -The system service is defined in [dot/system/service.go](../../dot/system/service.go) and exposes metadata about the +The system service is defined in [dot/system/service.go](../../internal/dot/system/service.go) and exposes metadata about the Gossamer system, such as the names and versions of the protocols that it implements. #### Core -As its name implies, the core service ([dot/core/service.go](../../dot/core/service.go)) encapsulates a range of +As its name implies, the core service ([dot/core/service.go](../../internal/dot/core/service.go)) encapsulates a range of capabilities that are central to the functioning of a Gossamer node. In general, the core service is a type of dispatcher that coordinates interactions between services, e.g. writing blocks to the database, reloading [the runtime](#runtime) when its definition is updated, etc. ### Keystore -The Gossamer keystore ([lib/keystore](../../lib/keystore)) is used for managing the public/private cryptographic key +The Gossamer keystore ([lib/keystore](../../internal/lib/keystore)) is used for managing the public/private cryptographic key pairs that are used for participating in a blockchain network. Public keys are used to identify network participants; network participants use their private keys to sign messages in order to authorise privileged actions. In addition to informing the Gossamer blockchain client capabilities, the Gossamer keystore is accessible by way of the `account` @@ -177,16 +177,16 @@ subcommand. The Gossamer keystore manages a number of key types, some of which a In addition to the above-described services, Gossamer hosts a Wasm execution environment that is used to manage an upgradeable blockchain runtime. The runtime must be implemented in Wasm, and must expose an interface that is specified -in [lib/runtime/interface.go](../../lib/runtime/interface.go). The runtime defines the blockchain's state transition +in [lib/runtime/interface.go](../../internal/lib/runtime/interface.go). The runtime defines the blockchain's state transition function, and the various Gossamer services consume this capability in order to author blocks, as well as to verify blocks that were authored by network peers. The runtime is dependent on a [Wasm host interface](https://docs.wasmer.io/integrations/examples/host-functions), which Gossamer implements and is -defined in [lib/runtime/wasmer/exports.go](../../lib/runtime/wasmer/exports.go). +defined in [lib/runtime/wasmer/exports.go](../../internal/lib/runtime/wasmer/exports.go). ### Monitoring Gossamer publishes telemetry data and also includes an embedded Prometheus server that reports metrics. The metrics -capabilities are defined in the [dot/metrics](../../dot/metrics) package and build on +capabilities are defined in the [dot/metrics](../../internal/dot/metrics) package and build on [the metrics library that is included with Go Ethereum](https://github.com/ethereum/go-ethereum/blob/master/metrics/README.md). The default port for Prometheus metrics is 9090, and Gossamer allows the user to configure this parameter with the `--metrics-port` command-line parameter. The Gossamer telemetry server publishes telemetry data that is compatible with diff --git a/cmd/gossamer/account.go b/cmd/gossamer/account.go index e1280820e78..0a5a47d93d6 100644 --- a/cmd/gossamer/account.go +++ b/cmd/gossamer/account.go @@ -7,9 +7,9 @@ import ( "fmt" "strings" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/urfave/cli" ) diff --git a/cmd/gossamer/account_test.go b/cmd/gossamer/account_test.go index b77b1ec4326..625670483cd 100644 --- a/cmd/gossamer/account_test.go +++ b/cmd/gossamer/account_test.go @@ -7,7 +7,7 @@ import ( "fmt" "testing" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/stretchr/testify/require" ) diff --git a/cmd/gossamer/config.go b/cmd/gossamer/config.go index fe7db3a0f4e..33b8c956446 100644 --- a/cmd/gossamer/config.go +++ b/cmd/gossamer/config.go @@ -10,29 +10,29 @@ import ( "strings" "time" - "github.com/ChainSafe/gossamer/chain/dev" - "github.com/ChainSafe/gossamer/chain/gssmr" - "github.com/ChainSafe/gossamer/dot" - ctoml "github.com/ChainSafe/gossamer/dot/config/toml" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/state/pruner" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/chain/dev" + "github.com/ChainSafe/gossamer/internal/chain/gssmr" + "github.com/ChainSafe/gossamer/internal/dot" + ctoml "github.com/ChainSafe/gossamer/internal/dot/config/toml" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/state/pruner" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/runtime/life" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/runtime/life" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" - "github.com/ChainSafe/gossamer/lib/utils" "github.com/urfave/cli" ) var ( // DefaultCfg is the default configuration for the node. DefaultCfg = dot.GssmrConfig - defaultGssmrConfigPath = "./chain/gssmr/config.toml" - defaultKusamaConfigPath = "./chain/kusama/config.toml" - defaultPolkadotConfigPath = "./chain/polkadot/config.toml" - defaultDevConfigPath = "./chain/dev/config.toml" + defaultGssmrConfigPath = "./internal/chain/gssmr/config.toml" + defaultKusamaConfigPath = "./internal/chain/kusama/config.toml" + defaultPolkadotConfigPath = "./internal/chain/polkadot/config.toml" + defaultDevConfigPath = "./internal/chain/dev/config.toml" gossamerName = "gssmr" kusamaName = "kusama" diff --git a/cmd/gossamer/config_test.go b/cmd/gossamer/config_test.go index 1d2e80a292b..7b444eebe2c 100644 --- a/cmd/gossamer/config_test.go +++ b/cmd/gossamer/config_test.go @@ -9,15 +9,15 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/chain/dev" - "github.com/ChainSafe/gossamer/chain/gssmr" - "github.com/ChainSafe/gossamer/dot" - ctoml "github.com/ChainSafe/gossamer/dot/config/toml" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/chain/dev" + "github.com/ChainSafe/gossamer/internal/chain/gssmr" + "github.com/ChainSafe/gossamer/internal/dot" + ctoml "github.com/ChainSafe/gossamer/internal/dot/config/toml" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/utils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/cmd/gossamer/export.go b/cmd/gossamer/export.go index c99c7b89dd8..fb3883b1518 100644 --- a/cmd/gossamer/export.go +++ b/cmd/gossamer/export.go @@ -7,9 +7,9 @@ import ( "fmt" "time" - "github.com/ChainSafe/gossamer/dot" - ctoml "github.com/ChainSafe/gossamer/dot/config/toml" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot" + ctoml "github.com/ChainSafe/gossamer/internal/dot/config/toml" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/urfave/cli" ) diff --git a/cmd/gossamer/export_test.go b/cmd/gossamer/export_test.go index a1e8f0955b1..e3d282a57ee 100644 --- a/cmd/gossamer/export_test.go +++ b/cmd/gossamer/export_test.go @@ -7,11 +7,11 @@ import ( "io" "testing" - "github.com/ChainSafe/gossamer/chain/gssmr" - "github.com/ChainSafe/gossamer/dot" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/chain/gssmr" + "github.com/ChainSafe/gossamer/internal/dot" + "github.com/ChainSafe/gossamer/internal/lib/utils" - ctoml "github.com/ChainSafe/gossamer/dot/config/toml" + ctoml "github.com/ChainSafe/gossamer/internal/dot/config/toml" "github.com/ChainSafe/gossamer/internal/log" "github.com/stretchr/testify/require" "github.com/urfave/cli" diff --git a/cmd/gossamer/flags.go b/cmd/gossamer/flags.go index 91b504091fb..b47314047c4 100644 --- a/cmd/gossamer/flags.go +++ b/cmd/gossamer/flags.go @@ -4,7 +4,7 @@ package main import ( - "github.com/ChainSafe/gossamer/chain/dev" + "github.com/ChainSafe/gossamer/internal/chain/dev" "github.com/urfave/cli" ) diff --git a/cmd/gossamer/flags_test.go b/cmd/gossamer/flags_test.go index ba81750f2e3..4e87d9c2103 100644 --- a/cmd/gossamer/flags_test.go +++ b/cmd/gossamer/flags_test.go @@ -7,9 +7,9 @@ import ( "io" "testing" - "github.com/ChainSafe/gossamer/chain/dev" - "github.com/ChainSafe/gossamer/dot" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/chain/dev" + "github.com/ChainSafe/gossamer/internal/dot" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/stretchr/testify/require" "github.com/urfave/cli" diff --git a/cmd/gossamer/import_runtime.go b/cmd/gossamer/import_runtime.go index 5e4619a7d36..3d00ec5911a 100644 --- a/cmd/gossamer/import_runtime.go +++ b/cmd/gossamer/import_runtime.go @@ -9,10 +9,10 @@ import ( "os" "path/filepath" - "github.com/ChainSafe/gossamer/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/genesis" ) -var defaultGenesisSpecPath = "./chain/gssmr/genesis-spec.json" +var defaultGenesisSpecPath = "./internal/chain/gssmr/genesis-spec.json" func createGenesisWithRuntime(fp string) (string, error) { runtime, err := os.ReadFile(filepath.Clean(fp)) diff --git a/cmd/gossamer/import_runtime_test.go b/cmd/gossamer/import_runtime_test.go index 083b5c5abe2..22e9a67c164 100644 --- a/cmd/gossamer/import_runtime_test.go +++ b/cmd/gossamer/import_runtime_test.go @@ -8,14 +8,14 @@ import ( "os" "testing" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/genesis" "github.com/stretchr/testify/require" ) func TestCreateGenesisWithRuntime(t *testing.T) { - defaultGenesisSpecPath = "../../chain/gssmr/genesis-spec.json" + defaultGenesisSpecPath = "../../internal/chain/gssmr/genesis-spec.json" testCode := []byte("somecode") testHex := common.BytesToHex(testCode) diff --git a/cmd/gossamer/main.go b/cmd/gossamer/main.go index a42cfcbf170..c3fbc29f91b 100644 --- a/cmd/gossamer/main.go +++ b/cmd/gossamer/main.go @@ -8,11 +8,11 @@ import ( "fmt" "os" - "github.com/ChainSafe/gossamer/dot" - "github.com/ChainSafe/gossamer/dot/state" + "github.com/ChainSafe/gossamer/internal/dot" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/utils" "github.com/urfave/cli" ) diff --git a/cmd/gossamer/main_test.go b/cmd/gossamer/main_test.go index 56144f76cf3..4eaced9648f 100644 --- a/cmd/gossamer/main_test.go +++ b/cmd/gossamer/main_test.go @@ -16,8 +16,8 @@ import ( "text/template" "time" - "github.com/ChainSafe/gossamer/dot" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/docker/docker/pkg/reexec" "github.com/stretchr/testify/require" ) @@ -195,10 +195,10 @@ func TestMain(m *testing.M) { if reexec.Init() { return } - defaultGssmrConfigPath = "../../chain/gssmr/config.toml" - defaultKusamaConfigPath = "../../chain/kusama/config.toml" - defaultPolkadotConfigPath = "../../chain/polkadot/config.toml" - defaultDevConfigPath = "../../chain/dev/config.toml" + defaultGssmrConfigPath = "../../internal/chain/gssmr/config.toml" + defaultKusamaConfigPath = "../../internal/chain/kusama/config.toml" + defaultPolkadotConfigPath = "../../internal/chain/polkadot/config.toml" + defaultDevConfigPath = "../../internal/chain/dev/config.toml" os.Exit(m.Run()) } @@ -259,7 +259,7 @@ func TestBuildSpecCommandWithOutput(t *testing.T) { buildSpecCommand := runTestGossamer(t, "build-spec", "--raw", - "--genesis-spec", "../../chain/gssmr/genesis-spec.json", + "--genesis-spec", "../../internal/chain/gssmr/genesis-spec.json", "--output", tmpOutputfile) time.Sleep(5 * time.Second) diff --git a/cmd/gossamer/prune_test.go b/cmd/gossamer/prune_test.go index 91f410a0f1b..c93bd2b6a13 100644 --- a/cmd/gossamer/prune_test.go +++ b/cmd/gossamer/prune_test.go @@ -28,8 +28,8 @@ func TestPruneState(t *testing.T) { } var ( - inputDBPath = "../../tests/data/db" - configFile = "../../tests/data/db/config.toml" + inputDBPath = "../../internal/tests/data/db" + configFile = "../../internal/tests/data/db/config.toml" prunedDBPath = fmt.Sprintf("%s/%s", t.TempDir(), "pruned") storagePrefix = "storage" ) diff --git a/cmd/gossamer/toml_config.go b/cmd/gossamer/toml_config.go index f57b72104a7..bf283cb8a06 100644 --- a/cmd/gossamer/toml_config.go +++ b/cmd/gossamer/toml_config.go @@ -12,7 +12,7 @@ import ( "github.com/naoina/toml" - ctoml "github.com/ChainSafe/gossamer/dot/config/toml" + ctoml "github.com/ChainSafe/gossamer/internal/dot/config/toml" ) // loadConfig loads the values from the toml configuration file into the provided configuration diff --git a/cmd/gossamer/toml_config_test.go b/cmd/gossamer/toml_config_test.go index feae45a401b..332caa70cfa 100644 --- a/cmd/gossamer/toml_config_test.go +++ b/cmd/gossamer/toml_config_test.go @@ -6,17 +6,17 @@ package main import ( "testing" - "github.com/ChainSafe/gossamer/dot" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/stretchr/testify/require" ) -const GssmrConfigPath = "../../chain/gssmr/config.toml" -const GssmrGenesisPath = "../../chain/gssmr/genesis.json" +const GssmrConfigPath = "../../internal/chain/gssmr/config.toml" +const GssmrGenesisPath = "../../internal/chain/gssmr/genesis.json" -const KusamaConfigPath = "../../chain/kusama/config.toml" -const KusamaGenesisPath = "../../chain/kusama/genesis.json" +const KusamaConfigPath = "../../internal/chain/kusama/config.toml" +const KusamaGenesisPath = "../../internal/chain/kusama/genesis.json" // TestLoadConfig tests loading a toml configuration file func TestLoadConfig(t *testing.T) { diff --git a/cmd/gossamer/utils.go b/cmd/gossamer/utils.go index d464e9d43cd..56324b8e538 100644 --- a/cmd/gossamer/utils.go +++ b/cmd/gossamer/utils.go @@ -11,9 +11,9 @@ import ( "syscall" "testing" - "github.com/ChainSafe/gossamer/dot" + "github.com/ChainSafe/gossamer/internal/dot" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/utils" "github.com/stretchr/testify/require" "github.com/urfave/cli" terminal "golang.org/x/term" diff --git a/docs/docs/usage/configuration.md b/docs/docs/usage/configuration.md index 99c0230d184..e735e12f2c7 100644 --- a/docs/docs/usage/configuration.md +++ b/docs/docs/usage/configuration.md @@ -31,7 +31,7 @@ grandpa = " | trace | debug | info | warn | error | crit" sync = " | trace | debug | info | warn | error | crit" [init] -genesis-raw = "./chain/gssmr/genesis-raw.json" +genesis-raw = "./internal/chain/gssmr/genesis-raw.json" [account] key = "" diff --git a/internal/chain/dev/config.toml b/internal/chain/dev/config.toml index 9e30f02c91f..1aee75847b5 100644 --- a/internal/chain/dev/config.toml +++ b/internal/chain/dev/config.toml @@ -14,7 +14,7 @@ grandpa = "" sync = "" [init] -genesis = "./chain/dev/genesis-spec.json" +genesis = "./internal/chain/dev/genesis-spec.json" [account] key = "alice" diff --git a/internal/chain/dev/defaults.go b/internal/chain/dev/defaults.go index 8c242f616fc..a3663af7b2b 100644 --- a/internal/chain/dev/defaults.go +++ b/internal/chain/dev/defaults.go @@ -4,9 +4,9 @@ package dev import ( + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" ) var ( @@ -17,7 +17,7 @@ var ( // DefaultID is the chain ID DefaultID = string("dev") // DefaultConfig is the toml configuration path - DefaultConfig = string("./chain/dev/config.toml") + DefaultConfig = string("./internal/chain/dev/config.toml") // DefaultBasePath is the node base directory path DefaultBasePath = string("~/.gossamer/dev") @@ -38,7 +38,7 @@ var ( // InitConfig // DefaultGenesis is the default genesis configuration path - DefaultGenesis = string("./chain/dev/genesis-spec.json") + DefaultGenesis = string("./internal/chain/dev/genesis-spec.json") // AccountConfig diff --git a/internal/chain/gssmr/config.toml b/internal/chain/gssmr/config.toml index 80301de7d22..e3837e5b338 100644 --- a/internal/chain/gssmr/config.toml +++ b/internal/chain/gssmr/config.toml @@ -14,7 +14,7 @@ grandpa = "" sync = "" [init] -genesis = "./chain/gssmr/genesis-spec.json" +genesis = "./internal/chain/gssmr/genesis-spec.json" [account] key = "" diff --git a/internal/chain/gssmr/defaults.go b/internal/chain/gssmr/defaults.go index 806a86f5b96..cc2a6e089a8 100644 --- a/internal/chain/gssmr/defaults.go +++ b/internal/chain/gssmr/defaults.go @@ -6,9 +6,9 @@ package gssmr import ( "time" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" ) var ( @@ -19,7 +19,7 @@ var ( // DefaultID Default chain ID DefaultID = string("gssmr") // DefaultConfig Default toml configuration path - DefaultConfig = string("./chain/gssmr/config.toml") + DefaultConfig = string("./internal/chain/gssmr/config.toml") // DefaultBasePath Default node base directory path DefaultBasePath = string("~/.gossamer/gssmr") @@ -40,7 +40,7 @@ var ( // InitConfig // DefaultGenesis is the default genesis configuration path - DefaultGenesis = string("./chain/gssmr/genesis-spec.json") + DefaultGenesis = string("./internal/chain/gssmr/genesis-spec.json") // AccountConfig diff --git a/internal/chain/kusama/config.toml b/internal/chain/kusama/config.toml index 37aabc81654..6d39e5da0d4 100644 --- a/internal/chain/kusama/config.toml +++ b/internal/chain/kusama/config.toml @@ -14,7 +14,7 @@ grandpa = "" sync = "" [init] -genesis = "./chain/kusama/genesis.json" +genesis = "./internal/chain/kusama/genesis.json" [account] key = "" diff --git a/internal/chain/kusama/defaults.go b/internal/chain/kusama/defaults.go index f312ef7e9e5..b7bc807336b 100644 --- a/internal/chain/kusama/defaults.go +++ b/internal/chain/kusama/defaults.go @@ -4,9 +4,9 @@ package kusama import ( + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" ) var ( @@ -17,7 +17,7 @@ var ( // DefaultID Default chain ID DefaultID = string("ksmcc3") // DefaultConfig Default toml configuration path - DefaultConfig = string("./chain/kusama/config.toml") + DefaultConfig = string("./internal/chain/kusama/config.toml") // DefaultBasePath Default node base directory path DefaultBasePath = string("~/.gossamer/kusama") @@ -38,7 +38,7 @@ var ( // InitConfig // DefaultGenesis is the default genesis configuration path - DefaultGenesis = string("./chain/kusama/genesis.json") + DefaultGenesis = string("./internal/chain/kusama/genesis.json") // AccountConfig diff --git a/internal/chain/polkadot/config.toml b/internal/chain/polkadot/config.toml index 86dc72ad6e3..f0719fdbd65 100644 --- a/internal/chain/polkadot/config.toml +++ b/internal/chain/polkadot/config.toml @@ -14,7 +14,7 @@ grandpa = "" sync = "" [init] -genesis = "./chain/polkadot/genesis.json" +genesis = "./internal/chain/polkadot/genesis.json" [account] key = "" diff --git a/internal/chain/polkadot/defaults.go b/internal/chain/polkadot/defaults.go index 4ae826c5e14..9340b3dedc8 100644 --- a/internal/chain/polkadot/defaults.go +++ b/internal/chain/polkadot/defaults.go @@ -4,9 +4,9 @@ package polkadot import ( + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" ) var ( @@ -17,7 +17,7 @@ var ( // DefaultID Default chain ID DefaultID = string("polkadot") // DefaultConfig Default toml configuration path - DefaultConfig = string("./chain/polkadot/config.toml") + DefaultConfig = string("./internal/chain/polkadot/config.toml") // DefaultBasePath Default node base directory path DefaultBasePath = string("~/.gossamer/polkadot") @@ -35,7 +35,7 @@ var ( // InitConfig // DefaultGenesis is the default genesis configuration path - DefaultGenesis = string("./chain/polkadot/genesis.json") + DefaultGenesis = string("./internal/chain/polkadot/genesis.json") // AccountConfig diff --git a/internal/dot/build_spec.go b/internal/dot/build_spec.go index 7e7e3327b72..994e300895d 100644 --- a/internal/dot/build_spec.go +++ b/internal/dot/build_spec.go @@ -9,11 +9,11 @@ import ( "os" "path/filepath" - "github.com/ChainSafe/gossamer/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/utils" ) // BuildSpec object for working with building genesis JSON files diff --git a/internal/dot/build_spec_test.go b/internal/dot/build_spec_test.go index b00683cceaf..183b393434b 100644 --- a/internal/dot/build_spec_test.go +++ b/internal/dot/build_spec_test.go @@ -10,7 +10,7 @@ import ( "os" "testing" - "github.com/ChainSafe/gossamer/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/genesis" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/config.go b/internal/dot/config.go index a8ee61f9478..a1c7547c512 100644 --- a/internal/dot/config.go +++ b/internal/dot/config.go @@ -8,15 +8,15 @@ import ( "strings" "time" - "github.com/ChainSafe/gossamer/chain/dev" - "github.com/ChainSafe/gossamer/chain/gssmr" - "github.com/ChainSafe/gossamer/chain/kusama" - "github.com/ChainSafe/gossamer/chain/polkadot" - "github.com/ChainSafe/gossamer/dot/state/pruner" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/chain/dev" + "github.com/ChainSafe/gossamer/internal/chain/gssmr" + "github.com/ChainSafe/gossamer/internal/chain/kusama" + "github.com/ChainSafe/gossamer/internal/chain/polkadot" + "github.com/ChainSafe/gossamer/internal/dot/state/pruner" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/genesis" "github.com/ChainSafe/gossamer/internal/log" "github.com/ChainSafe/gossamer/internal/pprof" - "github.com/ChainSafe/gossamer/lib/genesis" ) // TODO: update config to have toml rules and perhaps un-export some fields, since we don't want to expose all diff --git a/internal/dot/config_test.go b/internal/dot/config_test.go index e0631f26837..b379948ce56 100644 --- a/internal/dot/config_test.go +++ b/internal/dot/config_test.go @@ -6,7 +6,7 @@ package dot import ( "testing" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/core/interface.go b/internal/dot/core/interface.go index 35b66cc36b7..6a7a8fea4e4 100644 --- a/internal/dot/core/interface.go +++ b/internal/dot/core/interface.go @@ -9,13 +9,13 @@ import ( "github.com/libp2p/go-libp2p-core/peer" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/peerset" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/runtime" - rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/transaction" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/peerset" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + rtstorage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/transaction" ) //go:generate mockery --name BlockState --structname BlockState --case underscore --keeptree diff --git a/internal/dot/core/messages.go b/internal/dot/core/messages.go index 53e9834ceaa..958c7d874ce 100644 --- a/internal/dot/core/messages.go +++ b/internal/dot/core/messages.go @@ -8,11 +8,11 @@ import ( "github.com/libp2p/go-libp2p-core/peer" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/peerset" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/transaction" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/peerset" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/transaction" ) // HandleTransactionMessage validates each transaction in the message and diff --git a/internal/dot/core/messages_test.go b/internal/dot/core/messages_test.go index b42cae86744..291474f43de 100644 --- a/internal/dot/core/messages_test.go +++ b/internal/dot/core/messages_test.go @@ -12,15 +12,15 @@ import ( ctypes "github.com/centrifuge/go-substrate-rpc-client/v3/types" "github.com/stretchr/testify/require" - "github.com/ChainSafe/gossamer/dot/core/mocks" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/sync" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" + "github.com/ChainSafe/gossamer/internal/dot/core/mocks" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/sync" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/core/mocks/block_state.go b/internal/dot/core/mocks/block_state.go index 43f779983cf..96588bbe1d3 100644 --- a/internal/dot/core/mocks/block_state.go +++ b/internal/dot/core/mocks/block_state.go @@ -5,15 +5,15 @@ package mocks import ( big "math/big" - common "github.com/ChainSafe/gossamer/lib/common" + common "github.com/ChainSafe/gossamer/internal/lib/common" mock "github.com/stretchr/testify/mock" - runtime "github.com/ChainSafe/gossamer/lib/runtime" + runtime "github.com/ChainSafe/gossamer/internal/lib/runtime" - storage "github.com/ChainSafe/gossamer/lib/runtime/storage" + storage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" - types "github.com/ChainSafe/gossamer/dot/types" + types "github.com/ChainSafe/gossamer/internal/dot/types" ) // BlockState is an autogenerated mock type for the BlockState type diff --git a/internal/dot/core/mocks/digest_handler.go b/internal/dot/core/mocks/digest_handler.go index c6f23a4c3c9..3ac2efa6a95 100644 --- a/internal/dot/core/mocks/digest_handler.go +++ b/internal/dot/core/mocks/digest_handler.go @@ -3,7 +3,7 @@ package mocks import ( - types "github.com/ChainSafe/gossamer/dot/types" + types "github.com/ChainSafe/gossamer/internal/dot/types" mock "github.com/stretchr/testify/mock" ) diff --git a/internal/dot/core/mocks/network.go b/internal/dot/core/mocks/network.go index 37cd0c072f5..232a80e6342 100644 --- a/internal/dot/core/mocks/network.go +++ b/internal/dot/core/mocks/network.go @@ -3,12 +3,11 @@ package mocks import ( - network "github.com/ChainSafe/gossamer/dot/network" - mock "github.com/stretchr/testify/mock" - + network "github.com/ChainSafe/gossamer/internal/dot/network" peer "github.com/libp2p/go-libp2p-core/peer" + mock "github.com/stretchr/testify/mock" - peerset "github.com/ChainSafe/gossamer/dot/peerset" + peerset "github.com/ChainSafe/gossamer/internal/dot/peerset" ) // Network is an autogenerated mock type for the Network type diff --git a/internal/dot/core/mocks/storage_state.go b/internal/dot/core/mocks/storage_state.go index 320a6165d04..476fafb9cf8 100644 --- a/internal/dot/core/mocks/storage_state.go +++ b/internal/dot/core/mocks/storage_state.go @@ -3,13 +3,13 @@ package mocks import ( - common "github.com/ChainSafe/gossamer/lib/common" + common "github.com/ChainSafe/gossamer/internal/lib/common" mock "github.com/stretchr/testify/mock" - storage "github.com/ChainSafe/gossamer/lib/runtime/storage" + storage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" - types "github.com/ChainSafe/gossamer/dot/types" + types "github.com/ChainSafe/gossamer/internal/dot/types" ) // StorageState is an autogenerated mock type for the StorageState type diff --git a/internal/dot/core/service.go b/internal/dot/core/service.go index 91b97aff494..76eaa57026f 100644 --- a/internal/dot/core/service.go +++ b/internal/dot/core/service.go @@ -9,18 +9,18 @@ import ( "math/big" "sync" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/blocktree" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + rtstorage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" + "github.com/ChainSafe/gossamer/internal/lib/services" + "github.com/ChainSafe/gossamer/internal/lib/transaction" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/blocktree" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" - rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" - "github.com/ChainSafe/gossamer/lib/services" - "github.com/ChainSafe/gossamer/lib/transaction" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/core/service_test.go b/internal/dot/core/service_test.go index 46f38188cf0..d1f699248d9 100644 --- a/internal/dot/core/service_test.go +++ b/internal/dot/core/service_test.go @@ -12,20 +12,20 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/core/mocks" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/sync" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/core/mocks" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/sync" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + runtimemocks "github.com/ChainSafe/gossamer/internal/lib/runtime/mocks" + rtstorage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" + "github.com/ChainSafe/gossamer/internal/lib/transaction" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" - runtimemocks "github.com/ChainSafe/gossamer/lib/runtime/mocks" - rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" - "github.com/ChainSafe/gossamer/lib/transaction" - "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/internal/dot/core/test_helpers.go b/internal/dot/core/test_helpers.go index db91b0172c6..dfc07180708 100644 --- a/internal/dot/core/test_helpers.go +++ b/internal/dot/core/test_helpers.go @@ -7,17 +7,17 @@ import ( "path/filepath" "testing" - coremocks "github.com/ChainSafe/gossamer/dot/core/mocks" - "github.com/ChainSafe/gossamer/dot/state" + coremocks "github.com/ChainSafe/gossamer/internal/dot/core/mocks" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + rtstorage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" - rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" - "github.com/ChainSafe/gossamer/lib/utils" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/digest/digest.go b/internal/dot/digest/digest.go index d8f4e674aef..86676c82a36 100644 --- a/internal/dot/digest/digest.go +++ b/internal/dot/digest/digest.go @@ -9,9 +9,9 @@ import ( "math" "math/big" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/services" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/services" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/digest/digest_test.go b/internal/dot/digest/digest_test.go index 256ff7fddae..8c48f536085 100644 --- a/internal/dot/digest/digest_test.go +++ b/internal/dot/digest/digest_test.go @@ -8,14 +8,14 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/keystore" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/keystore" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" diff --git a/internal/dot/digest/interface.go b/internal/dot/digest/interface.go index 22c8201e3f9..21b04d6dc44 100644 --- a/internal/dot/digest/interface.go +++ b/internal/dot/digest/interface.go @@ -6,8 +6,8 @@ package digest import ( "math/big" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/grandpa" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/grandpa" ) // BlockState interface for block state methods diff --git a/internal/dot/import.go b/internal/dot/import.go index 7cbc7c7bd1c..95e5814c188 100644 --- a/internal/dot/import.go +++ b/internal/dot/import.go @@ -9,10 +9,10 @@ import ( "os" "path/filepath" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/ChainSafe/gossamer/internal/log" diff --git a/internal/dot/import_test.go b/internal/dot/import_test.go index 2bc8392ad72..8c46ca6d8b1 100644 --- a/internal/dot/import_test.go +++ b/internal/dot/import_test.go @@ -9,16 +9,16 @@ import ( "os" "testing" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" ) func setupStateFile(t *testing.T) string { - filename := "../lib/runtime/test_data/kusama/block1482002.json" + const filename = "../lib/runtime/test_data/kusama/block1482002.json" data, err := os.ReadFile(filename) require.NoError(t, err) diff --git a/internal/dot/network/README.md b/internal/dot/network/README.md index da3db2efe4e..e662dfd8e9a 100644 --- a/internal/dot/network/README.md +++ b/internal/dot/network/README.md @@ -39,7 +39,7 @@ is distributed to network peers to allow for the verification of messages signed may be constructive to think about a public key as a username and private key as a password, such as for a banking or social media website. Participants in P2P networks that use asymmetric cryptography must protect their private keys, as well as keep track of the public keys that belong to the other participants in the network. Gossamer provides a -[keystore](../../lib/keystore) for securely storing one's private keys. There are a number of Gossamer processes that +[keystore](../../internal/lib/keystore) for securely storing one's private keys. There are a number of Gossamer processes that manage the public keys of network peers - some of these, such as [peer discovery and management](#peer-discovery--management), are described in this document, but there are other packages (most notably [`peerset`](../peerset)) that also interact with the public keys of network peers. One of the diff --git a/internal/dot/network/block_announce.go b/internal/dot/network/block_announce.go index 5edf37f1046..f3c5381d4bd 100644 --- a/internal/dot/network/block_announce.go +++ b/internal/dot/network/block_announce.go @@ -8,8 +8,8 @@ import ( "fmt" "math/big" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/libp2p/go-libp2p-core/peer" diff --git a/internal/dot/network/block_announce_test.go b/internal/dot/network/block_announce_test.go index f81b984a243..f7ea55f2808 100644 --- a/internal/dot/network/block_announce_test.go +++ b/internal/dot/network/block_announce_test.go @@ -8,9 +8,9 @@ import ( "sync" "testing" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/libp2p/go-libp2p-core/peer" diff --git a/internal/dot/network/config_test.go b/internal/dot/network/config_test.go index cd2e2d91623..9d3ab798e73 100644 --- a/internal/dot/network/config_test.go +++ b/internal/dot/network/config_test.go @@ -8,8 +8,8 @@ import ( "reflect" "testing" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" "github.com/stretchr/testify/require" diff --git a/internal/dot/network/connmgr.go b/internal/dot/network/connmgr.go index 81db9d9f1dc..57caed6b60e 100644 --- a/internal/dot/network/connmgr.go +++ b/internal/dot/network/connmgr.go @@ -12,7 +12,7 @@ import ( "github.com/libp2p/go-libp2p-core/peer" ma "github.com/multiformats/go-multiaddr" - "github.com/ChainSafe/gossamer/dot/peerset" + "github.com/ChainSafe/gossamer/internal/dot/peerset" ) // ConnManager implements connmgr.ConnManager diff --git a/internal/dot/network/connmgr_test.go b/internal/dot/network/connmgr_test.go index f67a99f77a7..d26b9427a42 100644 --- a/internal/dot/network/connmgr_test.go +++ b/internal/dot/network/connmgr_test.go @@ -12,8 +12,8 @@ import ( "github.com/libp2p/go-libp2p-core/peerstore" "github.com/stretchr/testify/require" - "github.com/ChainSafe/gossamer/dot/peerset" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot/peerset" + "github.com/ChainSafe/gossamer/internal/lib/utils" ) func TestMinPeers(t *testing.T) { diff --git a/internal/dot/network/discovery_test.go b/internal/dot/network/discovery_test.go index 7c9bc856e03..8a1a1795647 100644 --- a/internal/dot/network/discovery_test.go +++ b/internal/dot/network/discovery_test.go @@ -14,7 +14,7 @@ import ( "github.com/libp2p/go-libp2p-core/routing" "github.com/stretchr/testify/require" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/lib/utils" ) func newTestDiscovery(t *testing.T, num int) []*discovery { diff --git a/internal/dot/network/gossip_test.go b/internal/dot/network/gossip_test.go index 2f2e27b5948..57c60ccd051 100644 --- a/internal/dot/network/gossip_test.go +++ b/internal/dot/network/gossip_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/network/host.go b/internal/dot/network/host.go index 1dbdda5d9c1..924cfa5f180 100644 --- a/internal/dot/network/host.go +++ b/internal/dot/network/host.go @@ -13,7 +13,7 @@ import ( "sync" "time" - "github.com/ChainSafe/gossamer/dot/peerset" + "github.com/ChainSafe/gossamer/internal/dot/peerset" "github.com/chyeh/pubip" "github.com/dgraph-io/ristretto" badger "github.com/ipfs/go-ds-badger2" diff --git a/internal/dot/network/host_test.go b/internal/dot/network/host_test.go index a39bfcbed2b..56d25573787 100644 --- a/internal/dot/network/host_test.go +++ b/internal/dot/network/host_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/peerset" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot/peerset" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/libp2p/go-libp2p-core/peerstore" "github.com/libp2p/go-libp2p-core/protocol" ma "github.com/multiformats/go-multiaddr" diff --git a/internal/dot/network/light.go b/internal/dot/network/light.go index d782568133e..2f42ecacfb2 100644 --- a/internal/dot/network/light.go +++ b/internal/dot/network/light.go @@ -6,8 +6,8 @@ package network import ( "fmt" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" libp2pnetwork "github.com/libp2p/go-libp2p-core/network" diff --git a/internal/dot/network/light_test.go b/internal/dot/network/light_test.go index 313166760ea..0f0707f61cf 100644 --- a/internal/dot/network/light_test.go +++ b/internal/dot/network/light_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/require" diff --git a/internal/dot/network/mdns_test.go b/internal/dot/network/mdns_test.go index e63bdf64040..4f6db16e65b 100644 --- a/internal/dot/network/mdns_test.go +++ b/internal/dot/network/mdns_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/lib/utils" ) // wait time to discover and connect using mdns discovery diff --git a/internal/dot/network/message.go b/internal/dot/network/message.go index fe42657acd1..246b26d6690 100644 --- a/internal/dot/network/message.go +++ b/internal/dot/network/message.go @@ -10,10 +10,10 @@ import ( "google.golang.org/protobuf/proto" - pb "github.com/ChainSafe/gossamer/dot/network/proto" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/common/variadic" + pb "github.com/ChainSafe/gossamer/internal/dot/network/proto" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common/variadic" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/network/message_cache.go b/internal/dot/network/message_cache.go index c3a1da3692b..cfb5eb79298 100644 --- a/internal/dot/network/message_cache.go +++ b/internal/dot/network/message_cache.go @@ -7,7 +7,7 @@ import ( "errors" "time" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/dgraph-io/ristretto" "github.com/libp2p/go-libp2p-core/peer" ) diff --git a/internal/dot/network/message_cache_test.go b/internal/dot/network/message_cache_test.go index 347ed159674..c4528aee7a5 100644 --- a/internal/dot/network/message_cache_test.go +++ b/internal/dot/network/message_cache_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/dgraph-io/ristretto" "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/require" diff --git a/internal/dot/network/message_test.go b/internal/dot/network/message_test.go index efa5d3dc074..57304a87460 100644 --- a/internal/dot/network/message_test.go +++ b/internal/dot/network/message_test.go @@ -8,9 +8,9 @@ import ( "math/big" "testing" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/common/variadic" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common/variadic" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/network/mock_block_state.go b/internal/dot/network/mock_block_state.go index f403cf4421e..85337ca6622 100644 --- a/internal/dot/network/mock_block_state.go +++ b/internal/dot/network/mock_block_state.go @@ -5,10 +5,10 @@ package network import ( big "math/big" - common "github.com/ChainSafe/gossamer/lib/common" + common "github.com/ChainSafe/gossamer/internal/lib/common" mock "github.com/stretchr/testify/mock" - types "github.com/ChainSafe/gossamer/dot/types" + types "github.com/ChainSafe/gossamer/internal/dot/types" ) // MockBlockState is an autogenerated mock type for the BlockState type diff --git a/internal/dot/network/notifications.go b/internal/dot/network/notifications.go index f803e89ed14..7132f5cf9ad 100644 --- a/internal/dot/network/notifications.go +++ b/internal/dot/network/notifications.go @@ -15,7 +15,7 @@ import ( "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/protocol" - "github.com/ChainSafe/gossamer/dot/peerset" + "github.com/ChainSafe/gossamer/internal/dot/peerset" ) const handshakeTimeout = time.Second * 10 diff --git a/internal/dot/network/notifications_test.go b/internal/dot/network/notifications_test.go index e0d7b4fc775..549ccb03aaa 100644 --- a/internal/dot/network/notifications_test.go +++ b/internal/dot/network/notifications_test.go @@ -16,9 +16,9 @@ import ( "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/require" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/utils" ) func TestCreateDecoder_BlockAnnounce(t *testing.T) { diff --git a/internal/dot/network/proto/api.v1.proto b/internal/dot/network/proto/api.v1.proto index 2c68c7619ef..90fe3cfb7f6 100644 --- a/internal/dot/network/proto/api.v1.proto +++ b/internal/dot/network/proto/api.v1.proto @@ -8,7 +8,7 @@ syntax = "proto3"; package api.v1; // This file is copied from https://github.com/paritytech/substrate/blob/9b08105b8c7106d723c4f470304ad9e2868569d9/client/network/src/schema/api.v1.proto -option go_package = "github.com/ChainSafe/gossamer/dot/network/proto"; +option go_package = "github.com/ChainSafe/gossamer/internal/dot/network/proto"; // Block enumeration direction. enum Direction { diff --git a/internal/dot/network/service.go b/internal/dot/network/service.go index f6ad9d0727c..e4d1e642b00 100644 --- a/internal/dot/network/service.go +++ b/internal/dot/network/service.go @@ -16,12 +16,12 @@ import ( "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/protocol" - gssmrmetrics "github.com/ChainSafe/gossamer/dot/metrics" - "github.com/ChainSafe/gossamer/dot/peerset" - "github.com/ChainSafe/gossamer/dot/telemetry" + gssmrmetrics "github.com/ChainSafe/gossamer/internal/dot/metrics" + "github.com/ChainSafe/gossamer/internal/dot/peerset" + "github.com/ChainSafe/gossamer/internal/dot/telemetry" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/services" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/services" ) const ( diff --git a/internal/dot/network/service_test.go b/internal/dot/network/service_test.go index a33dd8dec9e..0a01c135e38 100644 --- a/internal/dot/network/service_test.go +++ b/internal/dot/network/service_test.go @@ -14,7 +14,7 @@ import ( mock "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/lib/utils" ) var TestProtocolID = "/gossamer/test/0" diff --git a/internal/dot/network/state.go b/internal/dot/network/state.go index b9467d02f3c..cdec0af204b 100644 --- a/internal/dot/network/state.go +++ b/internal/dot/network/state.go @@ -8,9 +8,9 @@ import ( "github.com/libp2p/go-libp2p-core/peer" - "github.com/ChainSafe/gossamer/dot/peerset" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/peerset" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" ) //go:generate mockery --name BlockState --structname MockBlockState --case underscore --inpackage diff --git a/internal/dot/network/sync.go b/internal/dot/network/sync.go index 4c260dad2fe..77bc64e1998 100644 --- a/internal/dot/network/sync.go +++ b/internal/dot/network/sync.go @@ -8,7 +8,7 @@ import ( "fmt" "time" - "github.com/ChainSafe/gossamer/dot/peerset" + "github.com/ChainSafe/gossamer/internal/dot/peerset" libp2pnetwork "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" ) diff --git a/internal/dot/network/test_helpers.go b/internal/dot/network/test_helpers.go index 73c2fbcad80..727165da5a4 100644 --- a/internal/dot/network/test_helpers.go +++ b/internal/dot/network/test_helpers.go @@ -10,9 +10,9 @@ import ( "github.com/stretchr/testify/mock" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/common/variadic" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common/variadic" libp2pnetwork "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" diff --git a/internal/dot/network/transaction.go b/internal/dot/network/transaction.go index cad849f3d5c..1b84301c351 100644 --- a/internal/dot/network/transaction.go +++ b/internal/dot/network/transaction.go @@ -10,8 +10,8 @@ import ( "github.com/libp2p/go-libp2p-core/peer" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/network/transaction_test.go b/internal/dot/network/transaction_test.go index 49f0cbf4b60..7e7f4c33699 100644 --- a/internal/dot/network/transaction_test.go +++ b/internal/dot/network/transaction_test.go @@ -8,8 +8,8 @@ import ( "github.com/libp2p/go-libp2p-core/peer" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/internal/dot/network/utils_test.go b/internal/dot/network/utils_test.go index 047c491dcab..359cbb4c2c0 100644 --- a/internal/dot/network/utils_test.go +++ b/internal/dot/network/utils_test.go @@ -7,7 +7,7 @@ import ( "bytes" "testing" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/node.go b/internal/dot/node.go index 057aad77942..a6c6250c246 100644 --- a/internal/dot/node.go +++ b/internal/dot/node.go @@ -15,20 +15,20 @@ import ( "syscall" "time" - "github.com/ChainSafe/gossamer/dot/metrics" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/rpc" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/state/pruner" - "github.com/ChainSafe/gossamer/dot/telemetry" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/metrics" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/rpc" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/state/pruner" + "github.com/ChainSafe/gossamer/internal/dot/telemetry" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/services" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/services" - "github.com/ChainSafe/gossamer/lib/utils" ) var logger = log.NewFromGlobal(log.AddContext("pkg", "dot")) diff --git a/internal/dot/node_test.go b/internal/dot/node_test.go index 1d589486a9f..b4afc92a26c 100644 --- a/internal/dot/node_test.go +++ b/internal/dot/node_test.go @@ -8,17 +8,17 @@ import ( "reflect" "testing" - "github.com/ChainSafe/gossamer/dot/core" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/babe" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/grandpa" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/trie" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot/core" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/babe" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/grandpa" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" "github.com/stretchr/testify/require" diff --git a/internal/dot/rpc/dot_up_codec.go b/internal/dot/rpc/dot_up_codec.go index 3ab7b6574d1..fd0d6b9ccdf 100644 --- a/internal/dot/rpc/dot_up_codec.go +++ b/internal/dot/rpc/dot_up_codec.go @@ -10,8 +10,8 @@ import ( "unicode" "unicode/utf8" - "github.com/ChainSafe/gossamer/dot/rpc/json2" - "github.com/ChainSafe/gossamer/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/dot/rpc/json2" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" "github.com/gorilla/rpc/v2" ) diff --git a/internal/dot/rpc/helpers.go b/internal/dot/rpc/helpers.go index 2c0f2aa04ae..ebabc22f2ec 100644 --- a/internal/dot/rpc/helpers.go +++ b/internal/dot/rpc/helpers.go @@ -9,7 +9,7 @@ import ( "net" "strings" - "github.com/ChainSafe/gossamer/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" "github.com/go-playground/validator/v10" "github.com/gorilla/rpc/v2" "github.com/jpillora/ipfilter" diff --git a/internal/dot/rpc/http.go b/internal/dot/rpc/http.go index 0729cd02d08..b30c00b0ef1 100644 --- a/internal/dot/rpc/http.go +++ b/internal/dot/rpc/http.go @@ -9,11 +9,11 @@ import ( "net/http" "time" - "github.com/ChainSafe/gossamer/dot/rpc/modules" - "github.com/ChainSafe/gossamer/dot/rpc/subscription" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/dot/rpc/subscription" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/runtime" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/runtime" "github.com/go-playground/validator/v10" "github.com/gorilla/mux" "github.com/gorilla/rpc/v2" diff --git a/internal/dot/rpc/http_test.go b/internal/dot/rpc/http_test.go index 49a7e98a552..39ac7fa8b13 100644 --- a/internal/dot/rpc/http_test.go +++ b/internal/dot/rpc/http_test.go @@ -13,12 +13,12 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/core" - "github.com/ChainSafe/gossamer/dot/rpc/modules" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - "github.com/ChainSafe/gossamer/dot/system" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/core" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/dot/system" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/btcsuite/btcutil/base58" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/internal/dot/rpc/modules/api.go b/internal/dot/rpc/modules/api.go index 4d1940bda41..f851195fe06 100644 --- a/internal/dot/rpc/modules/api.go +++ b/internal/dot/rpc/modules/api.go @@ -6,17 +6,17 @@ package modules import ( "math/big" - "github.com/ChainSafe/gossamer/dot/core" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/grandpa" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/transaction" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/dot/core" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/grandpa" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/transaction" + "github.com/ChainSafe/gossamer/internal/lib/trie" ) //go:generate mockery --name StorageAPI --structname StorageAPI --case underscore --keeptree diff --git a/internal/dot/rpc/modules/api_mocks.go b/internal/dot/rpc/modules/api_mocks.go index cbe05b5a0ce..fe3ee5a6dd8 100644 --- a/internal/dot/rpc/modules/api_mocks.go +++ b/internal/dot/rpc/modules/api_mocks.go @@ -4,11 +4,11 @@ package modules import ( - modulesmocks "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - runtimemocks "github.com/ChainSafe/gossamer/lib/runtime/mocks" - "github.com/ChainSafe/gossamer/lib/transaction" + modulesmocks "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + runtimemocks "github.com/ChainSafe/gossamer/internal/lib/runtime/mocks" + "github.com/ChainSafe/gossamer/internal/lib/transaction" "github.com/stretchr/testify/mock" ) diff --git a/internal/dot/rpc/modules/author.go b/internal/dot/rpc/modules/author.go index 310a370f499..0891d8b56fb 100644 --- a/internal/dot/rpc/modules/author.go +++ b/internal/dot/rpc/modules/author.go @@ -8,10 +8,10 @@ import ( "net/http" "strings" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/keystore" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/keystore" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/rpc/modules/author_integration_test.go b/internal/dot/rpc/modules/author_integration_test.go index 092804c8c84..dc8dd4b2248 100644 --- a/internal/dot/rpc/modules/author_integration_test.go +++ b/internal/dot/rpc/modules/author_integration_test.go @@ -13,16 +13,16 @@ import ( "reflect" "testing" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" + "github.com/ChainSafe/gossamer/internal/lib/transaction" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" - "github.com/ChainSafe/gossamer/lib/transaction" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/rpc/modules/author_test.go b/internal/dot/rpc/modules/author_test.go index e32e524adb9..43dc72be5ff 100644 --- a/internal/dot/rpc/modules/author_test.go +++ b/internal/dot/rpc/modules/author_test.go @@ -10,14 +10,14 @@ import ( "net/http" "testing" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/transaction" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/transaction" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/internal/dot/rpc/modules/chain.go b/internal/dot/rpc/modules/chain.go index 4b0f9f8ad27..a1fc7570889 100644 --- a/internal/dot/rpc/modules/chain.go +++ b/internal/dot/rpc/modules/chain.go @@ -9,8 +9,8 @@ import ( "net/http" "regexp" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/rpc/modules/chain_integration_test.go b/internal/dot/rpc/modules/chain_integration_test.go index 5eb55697c4b..97a0b5226a1 100644 --- a/internal/dot/rpc/modules/chain_integration_test.go +++ b/internal/dot/rpc/modules/chain_integration_test.go @@ -11,19 +11,19 @@ import ( "path/filepath" "testing" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" + "github.com/ChainSafe/gossamer/internal/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" - "github.com/ChainSafe/gossamer/lib/trie" - "github.com/ChainSafe/gossamer/lib/utils" "github.com/ChainSafe/gossamer/pkg/scale" database "github.com/ChainSafe/chaindb" - rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" + rtstorage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/rpc/modules/chain_test.go b/internal/dot/rpc/modules/chain_test.go index 0cb98954bd0..a109838f50a 100644 --- a/internal/dot/rpc/modules/chain_test.go +++ b/internal/dot/rpc/modules/chain_test.go @@ -9,9 +9,9 @@ import ( "net/http" "testing" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/internal/dot/rpc/modules/childstate.go b/internal/dot/rpc/modules/childstate.go index 270e2cb54b8..dd45a68bb94 100644 --- a/internal/dot/rpc/modules/childstate.go +++ b/internal/dot/rpc/modules/childstate.go @@ -6,7 +6,7 @@ package modules import ( "net/http" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // GetKeysRequest represents the request to retrieve the keys of a child storage diff --git a/internal/dot/rpc/modules/childstate_integration_test.go b/internal/dot/rpc/modules/childstate_integration_test.go index e09dd3b51dc..9c28a0e130d 100644 --- a/internal/dot/rpc/modules/childstate_integration_test.go +++ b/internal/dot/rpc/modules/childstate_integration_test.go @@ -25,9 +25,9 @@ import ( "testing" "github.com/ChainSafe/chaindb" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/rpc/modules/childstate_test.go b/internal/dot/rpc/modules/childstate_test.go index 7d3d41afbae..c72b196e66c 100644 --- a/internal/dot/rpc/modules/childstate_test.go +++ b/internal/dot/rpc/modules/childstate_test.go @@ -8,11 +8,11 @@ import ( "net/http" "testing" - apimocks "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/genesis" - rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/trie" + apimocks "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + rtstorage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/internal/dot/rpc/modules/dev.go b/internal/dot/rpc/modules/dev.go index 44560a3115a..8ab3de8ee35 100644 --- a/internal/dot/rpc/modules/dev.go +++ b/internal/dot/rpc/modules/dev.go @@ -8,7 +8,7 @@ import ( "errors" "net/http" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) var blockProducerStoppedMsg = "babe service stopped" diff --git a/internal/dot/rpc/modules/dev_integration_test.go b/internal/dot/rpc/modules/dev_integration_test.go index baaf9a4bbc5..434f3114aa8 100644 --- a/internal/dot/rpc/modules/dev_integration_test.go +++ b/internal/dot/rpc/modules/dev_integration_test.go @@ -10,18 +10,18 @@ import ( "encoding/binary" "testing" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/babe" + babemocks "github.com/ChainSafe/gossamer/internal/lib/babe/mocks" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/babe" - babemocks "github.com/ChainSafe/gossamer/lib/babe/mocks" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" - "github.com/ChainSafe/gossamer/lib/trie" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/rpc/modules/dev_test.go b/internal/dot/rpc/modules/dev_test.go index c15d5a6535c..947c2d59e2d 100644 --- a/internal/dot/rpc/modules/dev_test.go +++ b/internal/dot/rpc/modules/dev_test.go @@ -8,7 +8,7 @@ import ( "net/http" "testing" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" "github.com/stretchr/testify/assert" ) diff --git a/internal/dot/rpc/modules/grandpa.go b/internal/dot/rpc/modules/grandpa.go index 012bd9cd610..f5108d79e80 100644 --- a/internal/dot/rpc/modules/grandpa.go +++ b/internal/dot/rpc/modules/grandpa.go @@ -6,8 +6,8 @@ package modules import ( "net/http" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" ) // GrandpaModule init parameters diff --git a/internal/dot/rpc/modules/grandpa_integration_test.go b/internal/dot/rpc/modules/grandpa_integration_test.go index ae6282ce84a..770d50918fb 100644 --- a/internal/dot/rpc/modules/grandpa_integration_test.go +++ b/internal/dot/rpc/modules/grandpa_integration_test.go @@ -23,14 +23,14 @@ import ( "reflect" "testing" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/grandpa" - "github.com/ChainSafe/gossamer/lib/keystore" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/grandpa" + "github.com/ChainSafe/gossamer/internal/lib/keystore" "github.com/stretchr/testify/require" - rpcmocks "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" + rpcmocks "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" ) var kr, _ = keystore.NewEd25519Keyring() diff --git a/internal/dot/rpc/modules/grandpa_test.go b/internal/dot/rpc/modules/grandpa_test.go index 1c50ae36482..33d65a31f82 100644 --- a/internal/dot/rpc/modules/grandpa_test.go +++ b/internal/dot/rpc/modules/grandpa_test.go @@ -8,12 +8,12 @@ import ( "net/http" "testing" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/grandpa" - "github.com/ChainSafe/gossamer/lib/keystore" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/grandpa" + "github.com/ChainSafe/gossamer/internal/lib/keystore" "github.com/stretchr/testify/assert" ) diff --git a/internal/dot/rpc/modules/mocks/block_api.go b/internal/dot/rpc/modules/mocks/block_api.go index 3bd095768e2..f0e097a4ebf 100644 --- a/internal/dot/rpc/modules/mocks/block_api.go +++ b/internal/dot/rpc/modules/mocks/block_api.go @@ -5,12 +5,12 @@ package mocks import ( big "math/big" - common "github.com/ChainSafe/gossamer/lib/common" + common "github.com/ChainSafe/gossamer/internal/lib/common" mock "github.com/stretchr/testify/mock" - runtime "github.com/ChainSafe/gossamer/lib/runtime" + runtime "github.com/ChainSafe/gossamer/internal/lib/runtime" - types "github.com/ChainSafe/gossamer/dot/types" + types "github.com/ChainSafe/gossamer/internal/dot/types" ) // BlockAPI is an autogenerated mock type for the BlockAPI type diff --git a/internal/dot/rpc/modules/mocks/block_finality_api.go b/internal/dot/rpc/modules/mocks/block_finality_api.go index e4eed4ed381..564069dc128 100644 --- a/internal/dot/rpc/modules/mocks/block_finality_api.go +++ b/internal/dot/rpc/modules/mocks/block_finality_api.go @@ -3,10 +3,10 @@ package mocks import ( - ed25519 "github.com/ChainSafe/gossamer/lib/crypto/ed25519" + ed25519 "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" mock "github.com/stretchr/testify/mock" - types "github.com/ChainSafe/gossamer/dot/types" + types "github.com/ChainSafe/gossamer/internal/dot/types" ) // BlockFinalityAPI is an autogenerated mock type for the BlockFinalityAPI type diff --git a/internal/dot/rpc/modules/mocks/core_api.go b/internal/dot/rpc/modules/mocks/core_api.go index 3d669330c1b..07a17f2f0bf 100644 --- a/internal/dot/rpc/modules/mocks/core_api.go +++ b/internal/dot/rpc/modules/mocks/core_api.go @@ -3,16 +3,16 @@ package mocks import ( - core "github.com/ChainSafe/gossamer/dot/core" - common "github.com/ChainSafe/gossamer/lib/common" + core "github.com/ChainSafe/gossamer/internal/dot/core" + common "github.com/ChainSafe/gossamer/internal/lib/common" - crypto "github.com/ChainSafe/gossamer/lib/crypto" + crypto "github.com/ChainSafe/gossamer/internal/lib/crypto" mock "github.com/stretchr/testify/mock" - runtime "github.com/ChainSafe/gossamer/lib/runtime" + runtime "github.com/ChainSafe/gossamer/internal/lib/runtime" - types "github.com/ChainSafe/gossamer/dot/types" + types "github.com/ChainSafe/gossamer/internal/dot/types" ) // CoreAPI is an autogenerated mock type for the CoreAPI type diff --git a/internal/dot/rpc/modules/mocks/network_api.go b/internal/dot/rpc/modules/mocks/network_api.go index d9dd66275a2..2e977cf83fe 100644 --- a/internal/dot/rpc/modules/mocks/network_api.go +++ b/internal/dot/rpc/modules/mocks/network_api.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/ChainSafe/gossamer/lib/common" + common "github.com/ChainSafe/gossamer/internal/lib/common" mock "github.com/stretchr/testify/mock" ) diff --git a/internal/dot/rpc/modules/mocks/storage_api.go b/internal/dot/rpc/modules/mocks/storage_api.go index 2a33b3db889..272ab377812 100644 --- a/internal/dot/rpc/modules/mocks/storage_api.go +++ b/internal/dot/rpc/modules/mocks/storage_api.go @@ -3,12 +3,12 @@ package mocks import ( - common "github.com/ChainSafe/gossamer/lib/common" + common "github.com/ChainSafe/gossamer/internal/lib/common" mock "github.com/stretchr/testify/mock" - state "github.com/ChainSafe/gossamer/dot/state" + state "github.com/ChainSafe/gossamer/internal/dot/state" - trie "github.com/ChainSafe/gossamer/lib/trie" + trie "github.com/ChainSafe/gossamer/internal/lib/trie" ) // StorageAPI is an autogenerated mock type for the StorageAPI type diff --git a/internal/dot/rpc/modules/mocks/sync_state_api.go b/internal/dot/rpc/modules/mocks/sync_state_api.go index ca7c0aba8f5..100bfa1e69d 100644 --- a/internal/dot/rpc/modules/mocks/sync_state_api.go +++ b/internal/dot/rpc/modules/mocks/sync_state_api.go @@ -3,7 +3,7 @@ package mocks import ( - genesis "github.com/ChainSafe/gossamer/lib/genesis" + genesis "github.com/ChainSafe/gossamer/internal/lib/genesis" mock "github.com/stretchr/testify/mock" ) diff --git a/internal/dot/rpc/modules/mocks/transaction_state_api.go b/internal/dot/rpc/modules/mocks/transaction_state_api.go index e07c4994aea..73890a30a07 100644 --- a/internal/dot/rpc/modules/mocks/transaction_state_api.go +++ b/internal/dot/rpc/modules/mocks/transaction_state_api.go @@ -3,12 +3,12 @@ package mocks import ( - common "github.com/ChainSafe/gossamer/lib/common" + common "github.com/ChainSafe/gossamer/internal/lib/common" mock "github.com/stretchr/testify/mock" - transaction "github.com/ChainSafe/gossamer/lib/transaction" + transaction "github.com/ChainSafe/gossamer/internal/lib/transaction" - types "github.com/ChainSafe/gossamer/dot/types" + types "github.com/ChainSafe/gossamer/internal/dot/types" ) // TransactionStateAPI is an autogenerated mock type for the TransactionStateAPI type diff --git a/internal/dot/rpc/modules/offchain.go b/internal/dot/rpc/modules/offchain.go index c6950d45eda..4eae18c08d9 100644 --- a/internal/dot/rpc/modules/offchain.go +++ b/internal/dot/rpc/modules/offchain.go @@ -7,7 +7,7 @@ import ( "fmt" "net/http" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) const ( diff --git a/internal/dot/rpc/modules/offchain_integration_test.go b/internal/dot/rpc/modules/offchain_integration_test.go index d41339dd417..6f4c4e46794 100644 --- a/internal/dot/rpc/modules/offchain_integration_test.go +++ b/internal/dot/rpc/modules/offchain_integration_test.go @@ -10,8 +10,8 @@ import ( "errors" "testing" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/rpc/modules/offchain_test.go b/internal/dot/rpc/modules/offchain_test.go index cf1ba011371..5225e9029fe 100644 --- a/internal/dot/rpc/modules/offchain_test.go +++ b/internal/dot/rpc/modules/offchain_test.go @@ -9,8 +9,8 @@ import ( "net/http" "testing" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/stretchr/testify/assert" ) diff --git a/internal/dot/rpc/modules/payment.go b/internal/dot/rpc/modules/payment.go index 9e4a1fb8a58..7988f770e07 100644 --- a/internal/dot/rpc/modules/payment.go +++ b/internal/dot/rpc/modules/payment.go @@ -6,7 +6,7 @@ package modules import ( "net/http" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // PaymentQueryInfoRequest represents the request to get the fee of an extrinsic in a given block diff --git a/internal/dot/rpc/modules/payment_integration_test.go b/internal/dot/rpc/modules/payment_integration_test.go index 4e8b7a81df3..bbe0cb4bd61 100644 --- a/internal/dot/rpc/modules/payment_integration_test.go +++ b/internal/dot/rpc/modules/payment_integration_test.go @@ -10,14 +10,14 @@ import ( "errors" "testing" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/dot/types" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/ChainSafe/gossamer/lib/common" - mocksruntime "github.com/ChainSafe/gossamer/lib/runtime/mocks" + "github.com/ChainSafe/gossamer/internal/lib/common" + mocksruntime "github.com/ChainSafe/gossamer/internal/lib/runtime/mocks" ) func TestPaymentQueryInfo(t *testing.T) { diff --git a/internal/dot/rpc/modules/payment_test.go b/internal/dot/rpc/modules/payment_test.go index 16f0c70d258..b0b353a3cd5 100644 --- a/internal/dot/rpc/modules/payment_test.go +++ b/internal/dot/rpc/modules/payment_test.go @@ -9,10 +9,10 @@ import ( "net/http" "testing" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - mocksruntime "github.com/ChainSafe/gossamer/lib/runtime/mocks" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + mocksruntime "github.com/ChainSafe/gossamer/internal/lib/runtime/mocks" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/assert" diff --git a/internal/dot/rpc/modules/state.go b/internal/dot/rpc/modules/state.go index d22230b9653..704469067bf 100644 --- a/internal/dot/rpc/modules/state.go +++ b/internal/dot/rpc/modules/state.go @@ -10,8 +10,8 @@ import ( "net/http" "strings" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/runtime" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/rpc/modules/state_integration_test.go b/internal/dot/rpc/modules/state_integration_test.go index 1c12766e955..2a0914c90b5 100644 --- a/internal/dot/rpc/modules/state_integration_test.go +++ b/internal/dot/rpc/modules/state_integration_test.go @@ -28,10 +28,10 @@ import ( "strings" "testing" - "github.com/ChainSafe/gossamer/dot/core" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/core" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/rpc/modules/state_test.go b/internal/dot/rpc/modules/state_test.go index 3983c0129e6..b93c59cd17f 100644 --- a/internal/dot/rpc/modules/state_test.go +++ b/internal/dot/rpc/modules/state_test.go @@ -20,11 +20,11 @@ import ( "net/http" "testing" - "github.com/ChainSafe/gossamer/dot/core" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - testdata "github.com/ChainSafe/gossamer/dot/rpc/modules/test_data" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/runtime" + "github.com/ChainSafe/gossamer/internal/dot/core" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + testdata "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/test_data" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/runtime" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/assert" diff --git a/internal/dot/rpc/modules/sync_state.go b/internal/dot/rpc/modules/sync_state.go index 5d08a87a2cb..e7b85e097ae 100644 --- a/internal/dot/rpc/modules/sync_state.go +++ b/internal/dot/rpc/modules/sync_state.go @@ -6,8 +6,8 @@ package modules import ( "net/http" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/genesis" ) // GenSyncSpecRequest represents request to get chain specification. diff --git a/internal/dot/rpc/modules/sync_state_integration_test.go b/internal/dot/rpc/modules/sync_state_integration_test.go index db8cca71c82..4a24247e610 100644 --- a/internal/dot/rpc/modules/sync_state_integration_test.go +++ b/internal/dot/rpc/modules/sync_state_integration_test.go @@ -12,7 +12,7 @@ import ( "path/filepath" "testing" - "github.com/ChainSafe/gossamer/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/genesis" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/rpc/modules/sync_state_test.go b/internal/dot/rpc/modules/sync_state_test.go index ccc56814907..0e06f9bd656 100644 --- a/internal/dot/rpc/modules/sync_state_test.go +++ b/internal/dot/rpc/modules/sync_state_test.go @@ -8,9 +8,9 @@ import ( "net/http" "testing" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/genesis" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/genesis" "github.com/stretchr/testify/assert" ) diff --git a/internal/dot/rpc/modules/system.go b/internal/dot/rpc/modules/system.go index 23a99f27be6..f407619059d 100644 --- a/internal/dot/rpc/modules/system.go +++ b/internal/dot/rpc/modules/system.go @@ -10,8 +10,8 @@ import ( "net/http" "strings" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/btcsuite/btcutil/base58" ctypes "github.com/centrifuge/go-substrate-rpc-client/v3/types" diff --git a/internal/dot/rpc/modules/system_integration_test.go b/internal/dot/rpc/modules/system_integration_test.go index e4794611552..90a58113432 100644 --- a/internal/dot/rpc/modules/system_integration_test.go +++ b/internal/dot/rpc/modules/system_integration_test.go @@ -32,20 +32,20 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/ChainSafe/gossamer/dot/core" - coremocks "github.com/ChainSafe/gossamer/dot/core/mocks" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/core" + coremocks "github.com/ChainSafe/gossamer/internal/dot/core/mocks" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" + "github.com/ChainSafe/gossamer/internal/lib/transaction" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" - "github.com/ChainSafe/gossamer/lib/transaction" - "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/rpc/modules/system_test.go b/internal/dot/rpc/modules/system_test.go index 6adfde9706e..3f4bd88807f 100644 --- a/internal/dot/rpc/modules/system_test.go +++ b/internal/dot/rpc/modules/system_test.go @@ -8,11 +8,11 @@ import ( "net/http" "testing" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - testdata "github.com/ChainSafe/gossamer/dot/rpc/modules/test_data" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/transaction" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + testdata "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/test_data" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/transaction" "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/assert" diff --git a/internal/dot/rpc/service_test.go b/internal/dot/rpc/service_test.go index be27181b206..8c60a92e1f4 100644 --- a/internal/dot/rpc/service_test.go +++ b/internal/dot/rpc/service_test.go @@ -11,9 +11,9 @@ import ( "strings" "testing" - "github.com/ChainSafe/gossamer/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" "github.com/gorilla/rpc/v2" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/rpc/subscription/listeners.go b/internal/dot/rpc/subscription/listeners.go index 125438705ba..36a67f9da09 100644 --- a/internal/dot/rpc/subscription/listeners.go +++ b/internal/dot/rpc/subscription/listeners.go @@ -10,12 +10,12 @@ import ( "reflect" "time" - "github.com/ChainSafe/gossamer/dot/rpc/modules" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/transaction" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/transaction" ) const ( diff --git a/internal/dot/rpc/subscription/listeners_test.go b/internal/dot/rpc/subscription/listeners_test.go index 6592bc0f313..58a815fd8e8 100644 --- a/internal/dot/rpc/subscription/listeners_test.go +++ b/internal/dot/rpc/subscription/listeners_test.go @@ -16,15 +16,15 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/rpc/modules" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/grandpa" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" - "github.com/ChainSafe/gossamer/lib/transaction" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/grandpa" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" + "github.com/ChainSafe/gossamer/internal/lib/transaction" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/gorilla/websocket" "github.com/stretchr/testify/mock" diff --git a/internal/dot/rpc/subscription/websocket.go b/internal/dot/rpc/subscription/websocket.go index cb53b914388..246a53f37a2 100644 --- a/internal/dot/rpc/subscription/websocket.go +++ b/internal/dot/rpc/subscription/websocket.go @@ -15,10 +15,10 @@ import ( "sync" "sync/atomic" - "github.com/ChainSafe/gossamer/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/runtime" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/runtime" "github.com/gorilla/websocket" ) diff --git a/internal/dot/rpc/subscription/websocket_test.go b/internal/dot/rpc/subscription/websocket_test.go index 496807d5559..9694024e894 100644 --- a/internal/dot/rpc/subscription/websocket_test.go +++ b/internal/dot/rpc/subscription/websocket_test.go @@ -9,14 +9,14 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/rpc/modules/mocks" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules/mocks" "github.com/ChainSafe/gossamer/pkg/scale" - "github.com/ChainSafe/gossamer/dot/rpc/modules" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/grandpa" - "github.com/ChainSafe/gossamer/lib/runtime" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/grandpa" + "github.com/ChainSafe/gossamer/internal/lib/runtime" "github.com/gorilla/websocket" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/internal/dot/rpc/websocket_test.go b/internal/dot/rpc/websocket_test.go index 3336c95c9d7..c308acadd0a 100644 --- a/internal/dot/rpc/websocket_test.go +++ b/internal/dot/rpc/websocket_test.go @@ -10,10 +10,10 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/core" - "github.com/ChainSafe/gossamer/dot/rpc/modules" - "github.com/ChainSafe/gossamer/dot/system" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/core" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/dot/system" + "github.com/ChainSafe/gossamer/internal/dot/types" "github.com/gorilla/websocket" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/services.go b/internal/dot/services.go index 703e651b9d4..b6837ea3b28 100644 --- a/internal/dot/services.go +++ b/internal/dot/services.go @@ -11,28 +11,28 @@ import ( "github.com/ChainSafe/chaindb" - "github.com/ChainSafe/gossamer/dot/core" - "github.com/ChainSafe/gossamer/dot/digest" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/rpc" - "github.com/ChainSafe/gossamer/dot/rpc/modules" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/sync" - "github.com/ChainSafe/gossamer/dot/system" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/core" + "github.com/ChainSafe/gossamer/internal/dot/digest" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/rpc" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/sync" + "github.com/ChainSafe/gossamer/internal/dot/system" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/babe" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/grandpa" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/runtime/life" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" "github.com/ChainSafe/gossamer/internal/pprof" - "github.com/ChainSafe/gossamer/lib/babe" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/grandpa" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/runtime/life" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" - "github.com/ChainSafe/gossamer/lib/utils" ) func newInMemoryDB(path string) (chaindb.Database, error) { diff --git a/internal/dot/services_test.go b/internal/dot/services_test.go index b1a939a38a3..59d04fe58cb 100644 --- a/internal/dot/services_test.go +++ b/internal/dot/services_test.go @@ -9,12 +9,12 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/grandpa" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/pprof" - "github.com/ChainSafe/gossamer/lib/grandpa" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/utils" "github.com/gorilla/websocket" "github.com/stretchr/testify/require" diff --git a/internal/dot/state/base.go b/internal/dot/state/base.go index a55e48152b3..b3513abb588 100644 --- a/internal/dot/state/base.go +++ b/internal/dot/state/base.go @@ -9,9 +9,9 @@ import ( "fmt" "github.com/ChainSafe/chaindb" - "github.com/ChainSafe/gossamer/dot/state/pruner" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/genesis" + "github.com/ChainSafe/gossamer/internal/dot/state/pruner" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/genesis" ) // BaseState is a wrapper for the chaindb.Database, without any prefixes diff --git a/internal/dot/state/base_test.go b/internal/dot/state/base_test.go index ed4a3f8698f..42c96d1c648 100644 --- a/internal/dot/state/base_test.go +++ b/internal/dot/state/base_test.go @@ -7,9 +7,9 @@ import ( "bytes" "testing" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/state/block.go b/internal/dot/state/block.go index f0957e704cd..f75e6728a7c 100644 --- a/internal/dot/state/block.go +++ b/internal/dot/state/block.go @@ -13,14 +13,14 @@ import ( "time" "github.com/ChainSafe/chaindb" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/blocktree" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/runtime" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/blocktree" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/runtime" "github.com/ChainSafe/gossamer/pkg/scale" - rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" + rtstorage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" ) const ( diff --git a/internal/dot/state/block_data.go b/internal/dot/state/block_data.go index f41d9bc9e39..b52bd22f0ea 100644 --- a/internal/dot/state/block_data.go +++ b/internal/dot/state/block_data.go @@ -4,7 +4,7 @@ package state import ( - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // prefixKey = prefix + hash diff --git a/internal/dot/state/block_data_test.go b/internal/dot/state/block_data_test.go index 1a90dd1796c..96a583d70ca 100644 --- a/internal/dot/state/block_data_test.go +++ b/internal/dot/state/block_data_test.go @@ -7,9 +7,9 @@ import ( "math/big" "testing" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/state/block_finalisation.go b/internal/dot/state/block_finalisation.go index b85083f12e6..60be3437c37 100644 --- a/internal/dot/state/block_finalisation.go +++ b/internal/dot/state/block_finalisation.go @@ -8,9 +8,9 @@ import ( "fmt" "math/big" - "github.com/ChainSafe/gossamer/dot/telemetry" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/telemetry" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" ) var highestRoundAndSetIDKey = []byte("hrs") diff --git a/internal/dot/state/block_finalisation_test.go b/internal/dot/state/block_finalisation_test.go index 20775d9a419..525a79f7530 100644 --- a/internal/dot/state/block_finalisation_test.go +++ b/internal/dot/state/block_finalisation_test.go @@ -7,7 +7,7 @@ import ( "math/big" "testing" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/types" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/state/block_notify.go b/internal/dot/state/block_notify.go index 168bd6b2d19..6c92d69d547 100644 --- a/internal/dot/state/block_notify.go +++ b/internal/dot/state/block_notify.go @@ -7,9 +7,9 @@ import ( "errors" "sync" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/runtime" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/runtime" "github.com/google/uuid" ) diff --git a/internal/dot/state/block_notify_test.go b/internal/dot/state/block_notify_test.go index 7dbd6a9feed..92078621da2 100644 --- a/internal/dot/state/block_notify_test.go +++ b/internal/dot/state/block_notify_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/runtime" - runtimemocks "github.com/ChainSafe/gossamer/lib/runtime/mocks" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + runtimemocks "github.com/ChainSafe/gossamer/internal/lib/runtime/mocks" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/state/block_race_test.go b/internal/dot/state/block_race_test.go index 88443ecb4a5..ebee73e5d44 100644 --- a/internal/dot/state/block_race_test.go +++ b/internal/dot/state/block_race_test.go @@ -9,8 +9,8 @@ import ( "sync" "testing" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/chaindb" "github.com/stretchr/testify/require" diff --git a/internal/dot/state/block_test.go b/internal/dot/state/block_test.go index 4b8832dbc2b..074e189a297 100644 --- a/internal/dot/state/block_test.go +++ b/internal/dot/state/block_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" diff --git a/internal/dot/state/bloom.go b/internal/dot/state/bloom.go index 52c4015706b..8959db7c15c 100644 --- a/internal/dot/state/bloom.go +++ b/internal/dot/state/bloom.go @@ -7,7 +7,7 @@ import ( "encoding/binary" "errors" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" bloomfilter "github.com/holiman/bloomfilter/v2" ) diff --git a/internal/dot/state/epoch.go b/internal/dot/state/epoch.go index 57074e5f070..ef404e51bd3 100644 --- a/internal/dot/state/epoch.go +++ b/internal/dot/state/epoch.go @@ -11,7 +11,7 @@ import ( "time" "github.com/ChainSafe/chaindb" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/types" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/state/epoch_test.go b/internal/dot/state/epoch_test.go index 52c25386bf5..7137b33b923 100644 --- a/internal/dot/state/epoch_test.go +++ b/internal/dot/state/epoch_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/keystore" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/keystore" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" diff --git a/internal/dot/state/grandpa.go b/internal/dot/state/grandpa.go index 05248019929..445a736c223 100644 --- a/internal/dot/state/grandpa.go +++ b/internal/dot/state/grandpa.go @@ -9,8 +9,8 @@ import ( "math/big" "github.com/ChainSafe/chaindb" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/state/grandpa_test.go b/internal/dot/state/grandpa_test.go index 8464a7daaa9..2ff20ed7082 100644 --- a/internal/dot/state/grandpa_test.go +++ b/internal/dot/state/grandpa_test.go @@ -7,9 +7,9 @@ import ( "math/big" "testing" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/keystore" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/keystore" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/state/initialize.go b/internal/dot/state/initialize.go index 259a441c2c7..f2c66c526a3 100644 --- a/internal/dot/state/initialize.go +++ b/internal/dot/state/initialize.go @@ -8,14 +8,14 @@ import ( "path/filepath" "github.com/ChainSafe/chaindb" - "github.com/ChainSafe/gossamer/dot/state/pruner" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/runtime" - rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" - "github.com/ChainSafe/gossamer/lib/trie" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot/state/pruner" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + rtstorage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" + "github.com/ChainSafe/gossamer/internal/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/utils" ) // Initialise initialises the genesis state of the DB using the given storage trie. diff --git a/internal/dot/state/offline_pruner.go b/internal/dot/state/offline_pruner.go index c7389141706..0c096131094 100644 --- a/internal/dot/state/offline_pruner.go +++ b/internal/dot/state/offline_pruner.go @@ -9,10 +9,10 @@ import ( "strings" "github.com/ChainSafe/chaindb" - "github.com/ChainSafe/gossamer/dot/state/pruner" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/trie" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot/state/pruner" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/dgraph-io/badger/v2" "github.com/dgraph-io/badger/v2/pb" ) diff --git a/internal/dot/state/pruner/pruner.go b/internal/dot/state/pruner/pruner.go index 93cea85691c..fbf6f56f350 100644 --- a/internal/dot/state/pruner/pruner.go +++ b/internal/dot/state/pruner/pruner.go @@ -9,8 +9,8 @@ import ( "time" "github.com/ChainSafe/chaindb" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/state/service.go b/internal/dot/state/service.go index 1a633569ff8..f44eba1cf51 100644 --- a/internal/dot/state/service.go +++ b/internal/dot/state/service.go @@ -8,12 +8,12 @@ import ( "math/big" "path/filepath" - "github.com/ChainSafe/gossamer/dot/state/pruner" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/state/pruner" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/blocktree" + "github.com/ChainSafe/gossamer/internal/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/blocktree" - "github.com/ChainSafe/gossamer/lib/trie" - "github.com/ChainSafe/gossamer/lib/utils" "github.com/ChainSafe/chaindb" ) diff --git a/internal/dot/state/service_test.go b/internal/dot/state/service_test.go index 8ef45bce0be..e4f745bbb88 100644 --- a/internal/dot/state/service_test.go +++ b/internal/dot/state/service_test.go @@ -10,15 +10,15 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/metrics" - "github.com/ChainSafe/gossamer/dot/state/pruner" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/metrics" + "github.com/ChainSafe/gossamer/internal/dot/state/pruner" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/transaction" + "github.com/ChainSafe/gossamer/internal/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/transaction" - "github.com/ChainSafe/gossamer/lib/trie" - "github.com/ChainSafe/gossamer/lib/utils" "github.com/ChainSafe/chaindb" ethmetrics "github.com/ethereum/go-ethereum/metrics" diff --git a/internal/dot/state/storage.go b/internal/dot/state/storage.go index 93ced1ba13c..932ad4e6d68 100644 --- a/internal/dot/state/storage.go +++ b/internal/dot/state/storage.go @@ -9,11 +9,11 @@ import ( "sync" "github.com/ChainSafe/chaindb" - "github.com/ChainSafe/gossamer/dot/state/pruner" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/dot/state/pruner" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + rtstorage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/trie" ) // storagePrefix storage key prefix. diff --git a/internal/dot/state/storage_notify.go b/internal/dot/state/storage_notify.go index 8160813a3b5..4690a22e07c 100644 --- a/internal/dot/state/storage_notify.go +++ b/internal/dot/state/storage_notify.go @@ -8,7 +8,7 @@ import ( "reflect" "strings" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // KeyValue struct to hold key value pairs diff --git a/internal/dot/state/storage_notify_test.go b/internal/dot/state/storage_notify_test.go index 25c03ad0067..898a0990deb 100644 --- a/internal/dot/state/storage_notify_test.go +++ b/internal/dot/state/storage_notify_test.go @@ -12,7 +12,7 @@ import ( "time" "github.com/ChainSafe/chaindb" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/state/storage_test.go b/internal/dot/state/storage_test.go index c6e3c9fe151..6fd1a7d25b5 100644 --- a/internal/dot/state/storage_test.go +++ b/internal/dot/state/storage_test.go @@ -9,10 +9,10 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/state/pruner" - "github.com/ChainSafe/gossamer/dot/types" - runtime "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/dot/state/pruner" + "github.com/ChainSafe/gossamer/internal/dot/types" + runtime "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/state/test_helpers.go b/internal/dot/state/test_helpers.go index 3ea8c4fed40..8fdf23f881c 100644 --- a/internal/dot/state/test_helpers.go +++ b/internal/dot/state/test_helpers.go @@ -11,11 +11,11 @@ import ( "time" "github.com/ChainSafe/chaindb" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - runtime "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/trie" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + runtime "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/state/transaction.go b/internal/dot/state/transaction.go index 2eae056f46f..3f3af6e1337 100644 --- a/internal/dot/state/transaction.go +++ b/internal/dot/state/transaction.go @@ -6,11 +6,11 @@ package state import ( "sync" - "github.com/ChainSafe/gossamer/dot/telemetry" + "github.com/ChainSafe/gossamer/internal/dot/telemetry" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/transaction" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/transaction" ) // TransactionState represents the queue of transactions diff --git a/internal/dot/state/transaction_test.go b/internal/dot/state/transaction_test.go index 26805ca79bd..dcba2c4fdfa 100644 --- a/internal/dot/state/transaction_test.go +++ b/internal/dot/state/transaction_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/transaction" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/transaction" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/sync/block_queue.go b/internal/dot/sync/block_queue.go index 28720164502..0b3f291d705 100644 --- a/internal/dot/sync/block_queue.go +++ b/internal/dot/sync/block_queue.go @@ -6,8 +6,8 @@ package sync import ( "sync" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" ) type blockQueue struct { diff --git a/internal/dot/sync/bootstrap_syncer.go b/internal/dot/sync/bootstrap_syncer.go index b065db0a8b4..ac451ef6134 100644 --- a/internal/dot/sync/bootstrap_syncer.go +++ b/internal/dot/sync/bootstrap_syncer.go @@ -7,8 +7,8 @@ import ( "errors" "math/big" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/lib/common" ) var _ workHandler = &bootstrapSyncer{} diff --git a/internal/dot/sync/bootstrap_syncer_test.go b/internal/dot/sync/bootstrap_syncer_test.go index 57565359434..01027f36e6e 100644 --- a/internal/dot/sync/bootstrap_syncer_test.go +++ b/internal/dot/sync/bootstrap_syncer_test.go @@ -7,10 +7,10 @@ import ( "math/big" "testing" - syncmocks "github.com/ChainSafe/gossamer/dot/sync/mocks" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/trie" + syncmocks "github.com/ChainSafe/gossamer/internal/dot/sync/mocks" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/sync/chain_processor.go b/internal/dot/sync/chain_processor.go index f45ab8e9a7e..1e5ee49636b 100644 --- a/internal/dot/sync/chain_processor.go +++ b/internal/dot/sync/chain_processor.go @@ -9,9 +9,9 @@ import ( "errors" "fmt" - "github.com/ChainSafe/gossamer/dot/telemetry" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/blocktree" + "github.com/ChainSafe/gossamer/internal/dot/telemetry" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/blocktree" ) // ChainProcessor processes ready blocks. diff --git a/internal/dot/sync/chain_processor_test.go b/internal/dot/sync/chain_processor_test.go index 8f2c594b819..49b023dade2 100644 --- a/internal/dot/sync/chain_processor_test.go +++ b/internal/dot/sync/chain_processor_test.go @@ -9,11 +9,11 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common/variadic" - "github.com/ChainSafe/gossamer/lib/transaction" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common/variadic" + "github.com/ChainSafe/gossamer/internal/lib/transaction" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/sync/chain_sync.go b/internal/dot/sync/chain_sync.go index f211c4d451a..ba7ce6ee7fb 100644 --- a/internal/dot/sync/chain_sync.go +++ b/internal/dot/sync/chain_sync.go @@ -13,13 +13,13 @@ import ( "sync" "time" - "github.com/ChainSafe/gossamer/dot/peerset" + "github.com/ChainSafe/gossamer/internal/dot/peerset" "github.com/libp2p/go-libp2p-core/peer" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/common/variadic" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common/variadic" ) const ( diff --git a/internal/dot/sync/chain_sync_test.go b/internal/dot/sync/chain_sync_test.go index 232bd659539..f09ebf100f2 100644 --- a/internal/dot/sync/chain_sync_test.go +++ b/internal/dot/sync/chain_sync_test.go @@ -10,12 +10,12 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/network" - syncmocks "github.com/ChainSafe/gossamer/dot/sync/mocks" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/common/variadic" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/dot/network" + syncmocks "github.com/ChainSafe/gossamer/internal/dot/sync/mocks" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common/variadic" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/libp2p/go-libp2p-core/peer" diff --git a/internal/dot/sync/disjoint_block_set.go b/internal/dot/sync/disjoint_block_set.go index d7e33875d9f..9041cbc759f 100644 --- a/internal/dot/sync/disjoint_block_set.go +++ b/internal/dot/sync/disjoint_block_set.go @@ -9,8 +9,8 @@ import ( "sync" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" ) const ( diff --git a/internal/dot/sync/disjoint_block_set_test.go b/internal/dot/sync/disjoint_block_set_test.go index eb752851f6c..92a6b8cdf96 100644 --- a/internal/dot/sync/disjoint_block_set_test.go +++ b/internal/dot/sync/disjoint_block_set_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/sync/interface.go b/internal/dot/sync/interface.go index 7d22b6a8127..2b2e4a0805a 100644 --- a/internal/dot/sync/interface.go +++ b/internal/dot/sync/interface.go @@ -7,12 +7,12 @@ import ( "math/big" "sync" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/peerset" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/runtime" - rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/peerset" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + rtstorage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" "github.com/libp2p/go-libp2p-core/peer" ) diff --git a/internal/dot/sync/message.go b/internal/dot/sync/message.go index fe0d4761b6c..35edc5fdb45 100644 --- a/internal/dot/sync/message.go +++ b/internal/dot/sync/message.go @@ -7,9 +7,9 @@ import ( "fmt" "math/big" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" ) const ( diff --git a/internal/dot/sync/message_test.go b/internal/dot/sync/message_test.go index 2f7b4ffc12c..417f5d269bb 100644 --- a/internal/dot/sync/message_test.go +++ b/internal/dot/sync/message_test.go @@ -7,11 +7,11 @@ import ( "math/big" "testing" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common/variadic" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common/variadic" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/sync/mocks/babe_verifier.go b/internal/dot/sync/mocks/babe_verifier.go index 34477841ce8..85dc2792328 100644 --- a/internal/dot/sync/mocks/babe_verifier.go +++ b/internal/dot/sync/mocks/babe_verifier.go @@ -5,7 +5,7 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - types "github.com/ChainSafe/gossamer/dot/types" + types "github.com/ChainSafe/gossamer/internal/dot/types" ) // BabeVerifier is an autogenerated mock type for the BabeVerifier type diff --git a/internal/dot/sync/mocks/block_import_handler.go b/internal/dot/sync/mocks/block_import_handler.go index 342128f355c..d5b34a72930 100644 --- a/internal/dot/sync/mocks/block_import_handler.go +++ b/internal/dot/sync/mocks/block_import_handler.go @@ -3,10 +3,10 @@ package mocks import ( - storage "github.com/ChainSafe/gossamer/lib/runtime/storage" + storage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" mock "github.com/stretchr/testify/mock" - types "github.com/ChainSafe/gossamer/dot/types" + types "github.com/ChainSafe/gossamer/internal/dot/types" ) // BlockImportHandler is an autogenerated mock type for the BlockImportHandler type diff --git a/internal/dot/sync/mocks/block_state.go b/internal/dot/sync/mocks/block_state.go index a8ef319dc56..5f800a83971 100644 --- a/internal/dot/sync/mocks/block_state.go +++ b/internal/dot/sync/mocks/block_state.go @@ -5,12 +5,12 @@ package mocks import ( big "math/big" - common "github.com/ChainSafe/gossamer/lib/common" + common "github.com/ChainSafe/gossamer/internal/lib/common" mock "github.com/stretchr/testify/mock" - runtime "github.com/ChainSafe/gossamer/lib/runtime" + runtime "github.com/ChainSafe/gossamer/internal/lib/runtime" - types "github.com/ChainSafe/gossamer/dot/types" + types "github.com/ChainSafe/gossamer/internal/dot/types" ) // BlockState is an autogenerated mock type for the BlockState type diff --git a/internal/dot/sync/mocks/finality_gadget.go b/internal/dot/sync/mocks/finality_gadget.go index 752753ebf27..7e5349a7377 100644 --- a/internal/dot/sync/mocks/finality_gadget.go +++ b/internal/dot/sync/mocks/finality_gadget.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/ChainSafe/gossamer/lib/common" + common "github.com/ChainSafe/gossamer/internal/lib/common" mock "github.com/stretchr/testify/mock" ) diff --git a/internal/dot/sync/mocks/network.go b/internal/dot/sync/mocks/network.go index 6f506ec05cd..00076e5d3f7 100644 --- a/internal/dot/sync/mocks/network.go +++ b/internal/dot/sync/mocks/network.go @@ -3,14 +3,14 @@ package mocks import ( - common "github.com/ChainSafe/gossamer/lib/common" + common "github.com/ChainSafe/gossamer/internal/lib/common" mock "github.com/stretchr/testify/mock" - network "github.com/ChainSafe/gossamer/dot/network" + network "github.com/ChainSafe/gossamer/internal/dot/network" peer "github.com/libp2p/go-libp2p-core/peer" - peerset "github.com/ChainSafe/gossamer/dot/peerset" + peerset "github.com/ChainSafe/gossamer/internal/dot/peerset" ) // Network is an autogenerated mock type for the Network type diff --git a/internal/dot/sync/syncer.go b/internal/dot/sync/syncer.go index 70b7343e0fe..78f898903bf 100644 --- a/internal/dot/sync/syncer.go +++ b/internal/dot/sync/syncer.go @@ -7,8 +7,8 @@ import ( "math/big" "time" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/types" "github.com/ChainSafe/gossamer/internal/log" "github.com/libp2p/go-libp2p-core/peer" diff --git a/internal/dot/sync/syncer_test.go b/internal/dot/sync/syncer_test.go index dba8cf7c595..c4b09ea221f 100644 --- a/internal/dot/sync/syncer_test.go +++ b/internal/dot/sync/syncer_test.go @@ -11,20 +11,20 @@ import ( "github.com/stretchr/testify/mock" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/runtime" - rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" - "github.com/ChainSafe/gossamer/lib/trie" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + rtstorage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" + "github.com/ChainSafe/gossamer/internal/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" "github.com/stretchr/testify/require" - "github.com/ChainSafe/gossamer/dot/sync/mocks" + "github.com/ChainSafe/gossamer/internal/dot/sync/mocks" ) func TestMain(m *testing.M) { @@ -145,7 +145,7 @@ func newTestSyncer(t *testing.T) *Service { } func newTestGenesisWithTrieAndHeader(t *testing.T) (*genesis.Genesis, *trie.Trie, *types.Header) { - fp := "../../chain/gssmr/genesis.json" + const fp = "../../chain/gssmr/genesis.json" gen, err := genesis.NewGenesisFromJSONRaw(fp) require.NoError(t, err) diff --git a/internal/dot/sync/test_helpers.go b/internal/dot/sync/test_helpers.go index 4836e3cf301..672f6a6d556 100644 --- a/internal/dot/sync/test_helpers.go +++ b/internal/dot/sync/test_helpers.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/runtime" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/runtime" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" diff --git a/internal/dot/sync/tip_syncer.go b/internal/dot/sync/tip_syncer.go index f7fad5340d0..859854a22d9 100644 --- a/internal/dot/sync/tip_syncer.go +++ b/internal/dot/sync/tip_syncer.go @@ -7,8 +7,8 @@ import ( "errors" "math/big" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/lib/common" ) var _ workHandler = &tipSyncer{} diff --git a/internal/dot/sync/tip_syncer_test.go b/internal/dot/sync/tip_syncer_test.go index b12fada0dd8..a42fba7d834 100644 --- a/internal/dot/sync/tip_syncer_test.go +++ b/internal/dot/sync/tip_syncer_test.go @@ -7,11 +7,11 @@ import ( "math/big" "testing" - "github.com/ChainSafe/gossamer/dot/network" - syncmocks "github.com/ChainSafe/gossamer/dot/sync/mocks" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/dot/network" + syncmocks "github.com/ChainSafe/gossamer/internal/dot/sync/mocks" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/internal/dot/sync/worker.go b/internal/dot/sync/worker.go index 9d12d5a4e8c..093e96d952a 100644 --- a/internal/dot/sync/worker.go +++ b/internal/dot/sync/worker.go @@ -11,8 +11,8 @@ import ( "github.com/libp2p/go-libp2p-core/peer" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // workerState helps track the current worker set and set the upcoming worker ID diff --git a/internal/dot/system/service.go b/internal/dot/system/service.go index 608620a9510..a296fc361ff 100644 --- a/internal/dot/system/service.go +++ b/internal/dot/system/service.go @@ -4,8 +4,8 @@ package system import ( - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/genesis" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/genesis" ) // Service struct to hold rpc service data diff --git a/internal/dot/system/service_test.go b/internal/dot/system/service_test.go index 5b6ef6ca458..397fae7e6a2 100644 --- a/internal/dot/system/service_test.go +++ b/internal/dot/system/service_test.go @@ -6,8 +6,8 @@ package system import ( "testing" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/genesis" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/genesis" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/telemetry/afg_finalized_blocks_up_to.go b/internal/dot/telemetry/afg_finalized_blocks_up_to.go index 0b63c8559d5..f8a836a03c4 100644 --- a/internal/dot/telemetry/afg_finalized_blocks_up_to.go +++ b/internal/dot/telemetry/afg_finalized_blocks_up_to.go @@ -4,7 +4,7 @@ package telemetry import ( - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // afgFinalizedBlocksUpToTM holds telemetry message of type `afg.finalized_blocks_up_to`, diff --git a/internal/dot/telemetry/afg_received.go b/internal/dot/telemetry/afg_received.go index 299cd1e3cdf..774bde2d073 100644 --- a/internal/dot/telemetry/afg_received.go +++ b/internal/dot/telemetry/afg_received.go @@ -3,7 +3,7 @@ package telemetry -import "github.com/ChainSafe/gossamer/lib/common" +import "github.com/ChainSafe/gossamer/internal/lib/common" // AfG ("Al's Finality Gadget") is synonymous with GRANDPA. diff --git a/internal/dot/telemetry/block_import.go b/internal/dot/telemetry/block_import.go index 230fc5169fc..4e7d7a8c77e 100644 --- a/internal/dot/telemetry/block_import.go +++ b/internal/dot/telemetry/block_import.go @@ -6,7 +6,7 @@ package telemetry import ( "math/big" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // blockImportTM struct to hold block import telemetry messages diff --git a/internal/dot/telemetry/notify_finalized.go b/internal/dot/telemetry/notify_finalized.go index 75501d37de3..f409b58c41c 100644 --- a/internal/dot/telemetry/notify_finalized.go +++ b/internal/dot/telemetry/notify_finalized.go @@ -4,7 +4,7 @@ package telemetry import ( - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // notifyFinalizedTM holds `notify.finalized` telemetry message, which is diff --git a/internal/dot/telemetry/prepared_block_for_proposing.go b/internal/dot/telemetry/prepared_block_for_proposing.go index aa9a45d0148..5e2a82a72ae 100644 --- a/internal/dot/telemetry/prepared_block_for_proposing.go +++ b/internal/dot/telemetry/prepared_block_for_proposing.go @@ -4,7 +4,7 @@ package telemetry import ( - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // preparedBlockForProposingTM holds a 'prepared_block_for_proposing' telemetry diff --git a/internal/dot/telemetry/system_connected.go b/internal/dot/telemetry/system_connected.go index 993285f05ed..5376a959b28 100644 --- a/internal/dot/telemetry/system_connected.go +++ b/internal/dot/telemetry/system_connected.go @@ -3,7 +3,7 @@ package telemetry -import "github.com/ChainSafe/gossamer/lib/common" +import "github.com/ChainSafe/gossamer/internal/lib/common" // systemConnectedTM struct to hold system connected telemetry messages type systemConnectedTM struct { diff --git a/internal/dot/telemetry/system_interval.go b/internal/dot/telemetry/system_interval.go index fa6128ca357..bad600aa4a6 100644 --- a/internal/dot/telemetry/system_interval.go +++ b/internal/dot/telemetry/system_interval.go @@ -6,7 +6,7 @@ package telemetry import ( "math/big" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // systemIntervalTM struct to hold system interval telemetry messages diff --git a/internal/dot/telemetry/telemetry.go b/internal/dot/telemetry/telemetry.go index 6d4282ecae6..fb59e51a18e 100644 --- a/internal/dot/telemetry/telemetry.go +++ b/internal/dot/telemetry/telemetry.go @@ -9,8 +9,8 @@ import ( "sync" "time" + "github.com/ChainSafe/gossamer/internal/lib/genesis" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/genesis" "github.com/gorilla/websocket" ) diff --git a/internal/dot/telemetry/telemetry_test.go b/internal/dot/telemetry/telemetry_test.go index 98410ce6628..9c45d6d0381 100644 --- a/internal/dot/telemetry/telemetry_test.go +++ b/internal/dot/telemetry/telemetry_test.go @@ -15,8 +15,8 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/genesis" "github.com/gorilla/websocket" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/types/authority.go b/internal/dot/types/authority.go index 7d721d1d2d8..cd41a6a62a7 100644 --- a/internal/dot/types/authority.go +++ b/internal/dot/types/authority.go @@ -7,9 +7,9 @@ import ( "encoding/binary" "io" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" ) // Authority struct to hold authority data diff --git a/internal/dot/types/babe_digest.go b/internal/dot/types/babe_digest.go index b490d161814..208e3741c4e 100644 --- a/internal/dot/types/babe_digest.go +++ b/internal/dot/types/babe_digest.go @@ -6,7 +6,7 @@ package types import ( "errors" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/types/babe_digest_test.go b/internal/dot/types/babe_digest_test.go index a6dffb71fc2..bdf89728b7a 100644 --- a/internal/dot/types/babe_digest_test.go +++ b/internal/dot/types/babe_digest_test.go @@ -6,7 +6,7 @@ package types import ( "testing" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" diff --git a/internal/dot/types/babe_test.go b/internal/dot/types/babe_test.go index 7cce7fca80d..3515b8c5f41 100644 --- a/internal/dot/types/babe_test.go +++ b/internal/dot/types/babe_test.go @@ -7,8 +7,8 @@ import ( "bytes" "testing" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/keystore" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" diff --git a/internal/dot/types/block_data.go b/internal/dot/types/block_data.go index b698ccd9fae..a3761db461c 100644 --- a/internal/dot/types/block_data.go +++ b/internal/dot/types/block_data.go @@ -7,7 +7,7 @@ import ( "fmt" "math/big" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // BlockData is stored within the BlockDB diff --git a/internal/dot/types/block_data_test.go b/internal/dot/types/block_data_test.go index 448fec41379..9d5328e3cdc 100644 --- a/internal/dot/types/block_data_test.go +++ b/internal/dot/types/block_data_test.go @@ -7,7 +7,7 @@ import ( "math/big" "testing" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/types/block_test.go b/internal/dot/types/block_test.go index 36e76e61386..4ea63eb4e1c 100644 --- a/internal/dot/types/block_test.go +++ b/internal/dot/types/block_test.go @@ -8,7 +8,7 @@ import ( "math/big" "testing" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" diff --git a/internal/dot/types/body.go b/internal/dot/types/body.go index 9b00b05c7ca..48acc0bf752 100644 --- a/internal/dot/types/body.go +++ b/internal/dot/types/body.go @@ -8,7 +8,7 @@ import ( "fmt" "math/big" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/types/body_test.go b/internal/dot/types/body_test.go index d27f9f8048d..97367de49f0 100644 --- a/internal/dot/types/body_test.go +++ b/internal/dot/types/body_test.go @@ -7,7 +7,7 @@ import ( "fmt" "testing" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/types/consensus_digest_test.go b/internal/dot/types/consensus_digest_test.go index 475bc2edbeb..2764f96562b 100644 --- a/internal/dot/types/consensus_digest_test.go +++ b/internal/dot/types/consensus_digest_test.go @@ -6,9 +6,9 @@ package types import ( "testing" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/keystore" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" diff --git a/internal/dot/types/digest.go b/internal/dot/types/digest.go index 73894c160a9..109614010fe 100644 --- a/internal/dot/types/digest.go +++ b/internal/dot/types/digest.go @@ -6,7 +6,7 @@ package types import ( "fmt" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/types/digest_test.go b/internal/dot/types/digest_test.go index 70ae93266c3..c5d099b3710 100644 --- a/internal/dot/types/digest_test.go +++ b/internal/dot/types/digest_test.go @@ -7,7 +7,7 @@ import ( "bytes" "testing" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" ) diff --git a/internal/dot/types/extrinsic.go b/internal/dot/types/extrinsic.go index e4851fbbae0..80300096a21 100644 --- a/internal/dot/types/extrinsic.go +++ b/internal/dot/types/extrinsic.go @@ -6,7 +6,7 @@ package types import ( "bytes" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/centrifuge/go-substrate-rpc-client/v3/scale" ctypes "github.com/centrifuge/go-substrate-rpc-client/v3/types" ) diff --git a/internal/dot/types/grandpa.go b/internal/dot/types/grandpa.go index 6d098d834e2..92478f9e2e5 100644 --- a/internal/dot/types/grandpa.go +++ b/internal/dot/types/grandpa.go @@ -6,8 +6,8 @@ package types import ( "fmt" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/types/grandpa_test.go b/internal/dot/types/grandpa_test.go index 16f87cb6692..51cba044d63 100644 --- a/internal/dot/types/grandpa_test.go +++ b/internal/dot/types/grandpa_test.go @@ -6,7 +6,7 @@ package types import ( "testing" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" diff --git a/internal/dot/types/header.go b/internal/dot/types/header.go index b02e4bfe4b0..bb9c9e39655 100644 --- a/internal/dot/types/header.go +++ b/internal/dot/types/header.go @@ -8,7 +8,7 @@ import ( "fmt" "math/big" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/dot/types/header_test.go b/internal/dot/types/header_test.go index 3fd173b4626..6533f79c227 100644 --- a/internal/dot/types/header_test.go +++ b/internal/dot/types/header_test.go @@ -7,7 +7,7 @@ import ( "math/big" "testing" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" diff --git a/internal/dot/utils.go b/internal/dot/utils.go index efd38018034..2cfa495c9ee 100644 --- a/internal/dot/utils.go +++ b/internal/dot/utils.go @@ -13,12 +13,12 @@ import ( "strings" "testing" - ctoml "github.com/ChainSafe/gossamer/dot/config/toml" + ctoml "github.com/ChainSafe/gossamer/internal/dot/config/toml" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" - "github.com/ChainSafe/gossamer/lib/utils" "github.com/cosmos/go-bip39" "github.com/naoina/toml" "github.com/stretchr/testify/require" diff --git a/internal/dot/utils_test.go b/internal/dot/utils_test.go index 4cfa1aee828..29cae195630 100644 --- a/internal/dot/utils_test.go +++ b/internal/dot/utils_test.go @@ -7,9 +7,9 @@ import ( "os" "testing" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/trie" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/babe/babe.go b/internal/lib/babe/babe.go index 5e774015109..d597a5593e2 100644 --- a/internal/lib/babe/babe.go +++ b/internal/lib/babe/babe.go @@ -11,11 +11,11 @@ import ( "sync" "time" - "github.com/ChainSafe/gossamer/dot/telemetry" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/telemetry" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/runtime" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/runtime" ethmetrics "github.com/ethereum/go-ethereum/metrics" ) diff --git a/internal/lib/babe/babe_test.go b/internal/lib/babe/babe_test.go index 58f3a1a8c4a..88a19fe2e04 100644 --- a/internal/lib/babe/babe_test.go +++ b/internal/lib/babe/babe_test.go @@ -11,19 +11,19 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/core" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/core" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/babe/mocks" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + rtstorage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" + "github.com/ChainSafe/gossamer/internal/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/babe/mocks" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" - rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" - "github.com/ChainSafe/gossamer/lib/trie" - "github.com/ChainSafe/gossamer/lib/utils" "github.com/ChainSafe/gossamer/pkg/scale" mock "github.com/stretchr/testify/mock" diff --git a/internal/lib/babe/build.go b/internal/lib/babe/build.go index c24ff97ccd3..425dafde0ee 100644 --- a/internal/lib/babe/build.go +++ b/internal/lib/babe/build.go @@ -10,11 +10,11 @@ import ( "math/big" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/transaction" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/transaction" "github.com/ChainSafe/gossamer/pkg/scale" ethmetrics "github.com/ethereum/go-ethereum/metrics" ) diff --git a/internal/lib/babe/build_test.go b/internal/lib/babe/build_test.go index 111e34c0948..840b3ff6629 100644 --- a/internal/lib/babe/build_test.go +++ b/internal/lib/babe/build_test.go @@ -9,12 +9,12 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/transaction" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/transaction" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/ChainSafe/gossamer/internal/log" diff --git a/internal/lib/babe/crypto.go b/internal/lib/babe/crypto.go index f87a4800d25..a2c76f91702 100644 --- a/internal/lib/babe/crypto.go +++ b/internal/lib/babe/crypto.go @@ -9,8 +9,8 @@ import ( "math" "math/big" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/gtank/merlin" ) diff --git a/internal/lib/babe/epoch_test.go b/internal/lib/babe/epoch_test.go index 39876134eed..2bd3d0184ce 100644 --- a/internal/lib/babe/epoch_test.go +++ b/internal/lib/babe/epoch_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/babe/mocks/block_import_handler.go b/internal/lib/babe/mocks/block_import_handler.go index fcb01e9a0ed..420d8f1cc59 100644 --- a/internal/lib/babe/mocks/block_import_handler.go +++ b/internal/lib/babe/mocks/block_import_handler.go @@ -3,8 +3,8 @@ package mocks import ( - types "github.com/ChainSafe/gossamer/dot/types" - storage "github.com/ChainSafe/gossamer/lib/runtime/storage" + types "github.com/ChainSafe/gossamer/internal/dot/types" + storage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" mock "github.com/stretchr/testify/mock" ) diff --git a/internal/lib/babe/secondary.go b/internal/lib/babe/secondary.go index 16c145ae1e8..2541f2c561d 100644 --- a/internal/lib/babe/secondary.go +++ b/internal/lib/babe/secondary.go @@ -7,9 +7,9 @@ import ( "encoding/binary" "math/big" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" ) func getSecondarySlotAuthor(slot uint64, numAuths int, randomness Randomness) (uint32, error) { diff --git a/internal/lib/babe/secondary_test.go b/internal/lib/babe/secondary_test.go index b94d892d7b1..34db7cf94d2 100644 --- a/internal/lib/babe/secondary_test.go +++ b/internal/lib/babe/secondary_test.go @@ -6,8 +6,8 @@ package babe import ( "testing" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/babe/state.go b/internal/lib/babe/state.go index af9c9931b12..a6d44efdd00 100644 --- a/internal/lib/babe/state.go +++ b/internal/lib/babe/state.go @@ -8,11 +8,11 @@ import ( "sync" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/runtime" - rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/transaction" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + rtstorage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/transaction" ) // BlockState interface for block state methods diff --git a/internal/lib/babe/types.go b/internal/lib/babe/types.go index 30a5bd96c3d..e6864c9c037 100644 --- a/internal/lib/babe/types.go +++ b/internal/lib/babe/types.go @@ -7,8 +7,8 @@ import ( "fmt" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/lib/babe/verify.go b/internal/lib/babe/verify.go index 15fd8c85914..cb654a1adb0 100644 --- a/internal/lib/babe/verify.go +++ b/internal/lib/babe/verify.go @@ -9,9 +9,9 @@ import ( "math/big" "sync" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/lib/babe/verify_test.go b/internal/lib/babe/verify_test.go index d63e442a985..92d50cea325 100644 --- a/internal/lib/babe/verify_test.go +++ b/internal/lib/babe/verify_test.go @@ -9,12 +9,12 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/genesis" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/genesis" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/blocktree/blocktree.go b/internal/lib/blocktree/blocktree.go index f3aaf88da77..4a9a33ba994 100644 --- a/internal/lib/blocktree/blocktree.go +++ b/internal/lib/blocktree/blocktree.go @@ -9,9 +9,9 @@ import ( "sync" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/runtime" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/runtime" "github.com/disiqueira/gotree" ) diff --git a/internal/lib/blocktree/blocktree_test.go b/internal/lib/blocktree/blocktree_test.go index b7d2bc16395..4c59ae159e7 100644 --- a/internal/lib/blocktree/blocktree_test.go +++ b/internal/lib/blocktree/blocktree_test.go @@ -12,8 +12,8 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/blocktree/leaves.go b/internal/lib/blocktree/leaves.go index f7c1f4ecc0f..84d7c69b03d 100644 --- a/internal/lib/blocktree/leaves.go +++ b/internal/lib/blocktree/leaves.go @@ -8,7 +8,7 @@ import ( "math/big" "sync" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // leafMap provides quick lookup for existing leaves diff --git a/internal/lib/blocktree/node.go b/internal/lib/blocktree/node.go index 791584ffab7..a979ac69ebd 100644 --- a/internal/lib/blocktree/node.go +++ b/internal/lib/blocktree/node.go @@ -8,7 +8,7 @@ import ( "math/big" "time" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/disiqueira/gotree" ) diff --git a/internal/lib/common/hasher_test.go b/internal/lib/common/hasher_test.go index c347838030b..92c5ec86c97 100644 --- a/internal/lib/common/hasher_test.go +++ b/internal/lib/common/hasher_test.go @@ -6,7 +6,7 @@ package common_test import ( "testing" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/common/types/result.go b/internal/lib/common/types/result.go index 2bc663e2243..91a3acbf70f 100644 --- a/internal/lib/common/types/result.go +++ b/internal/lib/common/types/result.go @@ -7,7 +7,7 @@ import ( "errors" "io" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // Result represents a Result type. diff --git a/internal/lib/common/variadic/uint64OrHash.go b/internal/lib/common/variadic/uint64OrHash.go index 2e45a731bc0..642c61d6265 100644 --- a/internal/lib/common/variadic/uint64OrHash.go +++ b/internal/lib/common/variadic/uint64OrHash.go @@ -8,7 +8,7 @@ import ( "errors" "io" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // Uint64OrHash represents an optional interface type (int,hash). diff --git a/internal/lib/common/variadic/uint64OrHash_test.go b/internal/lib/common/variadic/uint64OrHash_test.go index 3ba4250bbbb..626ce5b7230 100644 --- a/internal/lib/common/variadic/uint64OrHash_test.go +++ b/internal/lib/common/variadic/uint64OrHash_test.go @@ -7,7 +7,7 @@ import ( "encoding/binary" "testing" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/crypto/ed25519/ed25519.go b/internal/lib/crypto/ed25519/ed25519.go index 28ab6c34d2d..e9caebb234d 100644 --- a/internal/lib/crypto/ed25519/ed25519.go +++ b/internal/lib/crypto/ed25519/ed25519.go @@ -11,8 +11,8 @@ import ( "fmt" "io" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" "github.com/ChainSafe/go-schnorrkel" ) diff --git a/internal/lib/crypto/ed25519/ed25519_test.go b/internal/lib/crypto/ed25519/ed25519_test.go index 765c4937418..46d7fac699a 100644 --- a/internal/lib/crypto/ed25519/ed25519_test.go +++ b/internal/lib/crypto/ed25519/ed25519_test.go @@ -9,8 +9,8 @@ import ( "reflect" "testing" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" bip39 "github.com/cosmos/go-bip39" "github.com/stretchr/testify/require" diff --git a/internal/lib/crypto/keypair.go b/internal/lib/crypto/keypair.go index 01f5038b221..cb077a88677 100644 --- a/internal/lib/crypto/keypair.go +++ b/internal/lib/crypto/keypair.go @@ -4,7 +4,7 @@ package crypto import ( - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/btcsuite/btcutil/base58" bip39 "github.com/cosmos/go-bip39" diff --git a/internal/lib/crypto/keypair_test.go b/internal/lib/crypto/keypair_test.go index 75ff1669504..d7dff3a714f 100644 --- a/internal/lib/crypto/keypair_test.go +++ b/internal/lib/crypto/keypair_test.go @@ -6,8 +6,8 @@ package crypto_test import ( "testing" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/crypto/secp256k1/secp256k1.go b/internal/lib/crypto/secp256k1/secp256k1.go index dc4790ae8c7..7c012cdba3b 100644 --- a/internal/lib/crypto/secp256k1/secp256k1.go +++ b/internal/lib/crypto/secp256k1/secp256k1.go @@ -9,8 +9,8 @@ import ( "errors" "fmt" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" secp256k1 "github.com/ethereum/go-ethereum/crypto" ) diff --git a/internal/lib/crypto/secp256k1/secp256k1_test.go b/internal/lib/crypto/secp256k1/secp256k1_test.go index a0aaecacc5f..e25cb358c20 100644 --- a/internal/lib/crypto/secp256k1/secp256k1_test.go +++ b/internal/lib/crypto/secp256k1/secp256k1_test.go @@ -8,8 +8,8 @@ import ( "reflect" "testing" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/crypto/sig_verifier_test.go b/internal/lib/crypto/sig_verifier_test.go index fcaec07b88f..c4c0c6ca4e4 100644 --- a/internal/lib/crypto/sig_verifier_test.go +++ b/internal/lib/crypto/sig_verifier_test.go @@ -7,11 +7,11 @@ import ( "io" "testing" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/secp256k1" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/secp256k1" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/crypto/sr25519/sr25519.go b/internal/lib/crypto/sr25519/sr25519.go index 799f720d543..70fbe8bf7e9 100644 --- a/internal/lib/crypto/sr25519/sr25519.go +++ b/internal/lib/crypto/sr25519/sr25519.go @@ -8,8 +8,8 @@ import ( "errors" "fmt" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" sr25519 "github.com/ChainSafe/go-schnorrkel" "github.com/gtank/merlin" diff --git a/internal/lib/crypto/sr25519/sr25519_test.go b/internal/lib/crypto/sr25519/sr25519_test.go index 53fbfe7e527..bf2c1702563 100644 --- a/internal/lib/crypto/sr25519/sr25519_test.go +++ b/internal/lib/crypto/sr25519/sr25519_test.go @@ -9,7 +9,7 @@ import ( "fmt" "testing" - "github.com/ChainSafe/gossamer/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto" bip39 "github.com/cosmos/go-bip39" "github.com/gtank/merlin" "github.com/stretchr/testify/require" diff --git a/internal/lib/genesis/genesis.go b/internal/lib/genesis/genesis.go index 9d27cd07993..bf6e54ef7a0 100644 --- a/internal/lib/genesis/genesis.go +++ b/internal/lib/genesis/genesis.go @@ -4,7 +4,7 @@ package genesis import ( - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // Genesis stores the data parsed from the genesis configuration file diff --git a/internal/lib/genesis/helpers.go b/internal/lib/genesis/helpers.go index 2f826ecd5b5..280013ee7f1 100644 --- a/internal/lib/genesis/helpers.go +++ b/internal/lib/genesis/helpers.go @@ -14,13 +14,13 @@ import ( "path/filepath" "reflect" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/lib/genesis/helpers_test.go b/internal/lib/genesis/helpers_test.go index 72c26bd9084..83b0ef3a913 100644 --- a/internal/lib/genesis/helpers_test.go +++ b/internal/lib/genesis/helpers_test.go @@ -9,9 +9,9 @@ import ( "os" "testing" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/genesis/test_utils.go b/internal/lib/genesis/test_utils.go index 1751812a8c4..a3845c4f8db 100644 --- a/internal/lib/genesis/test_utils.go +++ b/internal/lib/genesis/test_utils.go @@ -10,9 +10,10 @@ import ( "os" "testing" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/stretchr/testify/require" ) @@ -111,11 +112,9 @@ func CreateTestGenesisJSONFile(asRaw bool) (string, error) { // NewTestGenesisWithTrieAndHeader generates genesis, genesis trie and genesis header func NewTestGenesisWithTrieAndHeader(t *testing.T) (*Genesis, *trie.Trie, *types.Header) { - gen, err := NewGenesisFromJSONRaw("../../chain/gssmr/genesis.json") - if err != nil { - gen, err = NewGenesisFromJSONRaw("../../../chain/gssmr/genesis.json") - require.NoError(t, err) - } + genesisPath := utils.GetGssmrGenesisRawPath() + gen, err := NewGenesisFromJSONRaw(genesisPath) + require.NoError(t, err) tr, h := newGenesisTrieAndHeader(t, gen) return gen, tr, h @@ -123,11 +122,9 @@ func NewTestGenesisWithTrieAndHeader(t *testing.T) (*Genesis, *trie.Trie, *types // NewDevGenesisWithTrieAndHeader generates test dev genesis, genesis trie and genesis header func NewDevGenesisWithTrieAndHeader(t *testing.T) (*Genesis, *trie.Trie, *types.Header) { - gen, err := NewGenesisFromJSONRaw("../../chain/dev/genesis.json") - if err != nil { - gen, err = NewGenesisFromJSONRaw("../../../chain/dev/genesis.json") - require.NoError(t, err) - } + genesisPath := utils.GetDevGenesisPath() + gen, err := NewGenesisFromJSONRaw(genesisPath) + require.NoError(t, err) tr, h := newGenesisTrieAndHeader(t, gen) return gen, tr, h diff --git a/internal/lib/grandpa/errors.go b/internal/lib/grandpa/errors.go index 46ce29dbf68..791bc0273dc 100644 --- a/internal/lib/grandpa/errors.go +++ b/internal/lib/grandpa/errors.go @@ -7,7 +7,7 @@ import ( "errors" "fmt" - "github.com/ChainSafe/gossamer/lib/blocktree" + "github.com/ChainSafe/gossamer/internal/lib/blocktree" ) // errRoundMismatch is returned when trying to validate a vote message that isn't for the current round diff --git a/internal/lib/grandpa/grandpa.go b/internal/lib/grandpa/grandpa.go index 0955dcbb7f0..3bd42e2fea4 100644 --- a/internal/lib/grandpa/grandpa.go +++ b/internal/lib/grandpa/grandpa.go @@ -14,12 +14,12 @@ import ( "sync/atomic" "time" - "github.com/ChainSafe/gossamer/dot/telemetry" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/telemetry" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/blocktree" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/blocktree" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/lib/grandpa/grandpa_test.go b/internal/lib/grandpa/grandpa_test.go index 01d3c3f9c62..3829767e959 100644 --- a/internal/lib/grandpa/grandpa_test.go +++ b/internal/lib/grandpa/grandpa_test.go @@ -12,21 +12,21 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/metrics" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/keystore" - rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer" - "github.com/ChainSafe/gossamer/lib/trie" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/dot/metrics" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + rtstorage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer" + "github.com/ChainSafe/gossamer/internal/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/stretchr/testify/require" - "github.com/ChainSafe/gossamer/lib/grandpa/mocks" + "github.com/ChainSafe/gossamer/internal/lib/grandpa/mocks" ethmetrics "github.com/ethereum/go-ethereum/metrics" ) diff --git a/internal/lib/grandpa/message.go b/internal/lib/grandpa/message.go index 032462fea19..8b83d503459 100644 --- a/internal/lib/grandpa/message.go +++ b/internal/lib/grandpa/message.go @@ -6,10 +6,10 @@ package grandpa import ( "fmt" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/lib/grandpa/message_handler.go b/internal/lib/grandpa/message_handler.go index 12285fc8943..18d23b260fd 100644 --- a/internal/lib/grandpa/message_handler.go +++ b/internal/lib/grandpa/message_handler.go @@ -10,12 +10,12 @@ import ( "math/big" "reflect" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/telemetry" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/blocktree" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/telemetry" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/blocktree" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/libp2p/go-libp2p-core/peer" diff --git a/internal/lib/grandpa/message_handler_test.go b/internal/lib/grandpa/message_handler_test.go index a7cec946ca9..f52c0826457 100644 --- a/internal/lib/grandpa/message_handler_test.go +++ b/internal/lib/grandpa/message_handler_test.go @@ -8,12 +8,12 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/blocktree" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/keystore" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/blocktree" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/keystore" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" diff --git a/internal/lib/grandpa/message_test.go b/internal/lib/grandpa/message_test.go index cbb4b675634..fd9cf25c8d7 100644 --- a/internal/lib/grandpa/message_test.go +++ b/internal/lib/grandpa/message_test.go @@ -7,10 +7,10 @@ import ( "math/big" "testing" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" diff --git a/internal/lib/grandpa/message_tracker.go b/internal/lib/grandpa/message_tracker.go index d0fceea06bc..882d3fd337a 100644 --- a/internal/lib/grandpa/message_tracker.go +++ b/internal/lib/grandpa/message_tracker.go @@ -6,9 +6,9 @@ package grandpa import ( "sync" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" ) // tracker keeps track of messages that have been received that have failed to validate with ErrBlockDoesNotExist diff --git a/internal/lib/grandpa/message_tracker_test.go b/internal/lib/grandpa/message_tracker_test.go index e29c19eb5bc..d33a5e23014 100644 --- a/internal/lib/grandpa/message_tracker_test.go +++ b/internal/lib/grandpa/message_tracker_test.go @@ -8,10 +8,10 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/keystore" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/keystore" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/grandpa/mocks/network.go b/internal/lib/grandpa/mocks/network.go index e33e9f36295..c872a72fbad 100644 --- a/internal/lib/grandpa/mocks/network.go +++ b/internal/lib/grandpa/mocks/network.go @@ -3,10 +3,9 @@ package mocks import ( - network "github.com/ChainSafe/gossamer/dot/network" - mock "github.com/stretchr/testify/mock" - + network "github.com/ChainSafe/gossamer/internal/dot/network" peer "github.com/libp2p/go-libp2p-core/peer" + mock "github.com/stretchr/testify/mock" protocol "github.com/libp2p/go-libp2p-core/protocol" ) diff --git a/internal/lib/grandpa/network.go b/internal/lib/grandpa/network.go index a959d893a8b..1cdb9391c50 100644 --- a/internal/lib/grandpa/network.go +++ b/internal/lib/grandpa/network.go @@ -7,8 +7,8 @@ import ( "fmt" "time" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/libp2p/go-libp2p-core/peer" diff --git a/internal/lib/grandpa/network_test.go b/internal/lib/grandpa/network_test.go index 5ad81031dcf..9d431bc0e0e 100644 --- a/internal/lib/grandpa/network_test.go +++ b/internal/lib/grandpa/network_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/types" "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/require" diff --git a/internal/lib/grandpa/round_test.go b/internal/lib/grandpa/round_test.go index 8975cab25bb..ebedf05eae3 100644 --- a/internal/lib/grandpa/round_test.go +++ b/internal/lib/grandpa/round_test.go @@ -10,13 +10,13 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/keystore" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/keystore" "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/protocol" "github.com/stretchr/testify/require" diff --git a/internal/lib/grandpa/state.go b/internal/lib/grandpa/state.go index 7ba4087449f..14ec3cd196a 100644 --- a/internal/lib/grandpa/state.go +++ b/internal/lib/grandpa/state.go @@ -9,9 +9,9 @@ import ( "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/protocol" - "github.com/ChainSafe/gossamer/dot/network" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/network" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // BlockState is the interface required by GRANDPA into the block state diff --git a/internal/lib/grandpa/types.go b/internal/lib/grandpa/types.go index 3a7b911f223..59155d9d7a9 100644 --- a/internal/lib/grandpa/types.go +++ b/internal/lib/grandpa/types.go @@ -6,9 +6,9 @@ package grandpa import ( "bytes" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" ) //nolint:revive diff --git a/internal/lib/grandpa/types_test.go b/internal/lib/grandpa/types_test.go index 8487407e7b1..c0235a2318a 100644 --- a/internal/lib/grandpa/types_test.go +++ b/internal/lib/grandpa/types_test.go @@ -6,10 +6,10 @@ package grandpa import ( "testing" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/grandpa/testdata" - "github.com/ChainSafe/gossamer/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/grandpa/testdata" + "github.com/ChainSafe/gossamer/internal/lib/keystore" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/grandpa/vote_message.go b/internal/lib/grandpa/vote_message.go index b9b5c2bfb62..5541eb29453 100644 --- a/internal/lib/grandpa/vote_message.go +++ b/internal/lib/grandpa/vote_message.go @@ -9,9 +9,9 @@ import ( "errors" "fmt" - "github.com/ChainSafe/gossamer/dot/telemetry" - "github.com/ChainSafe/gossamer/lib/blocktree" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/dot/telemetry" + "github.com/ChainSafe/gossamer/internal/lib/blocktree" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/libp2p/go-libp2p-core/peer" diff --git a/internal/lib/grandpa/vote_message_test.go b/internal/lib/grandpa/vote_message_test.go index 5b05b0476dc..667b8e6943a 100644 --- a/internal/lib/grandpa/vote_message_test.go +++ b/internal/lib/grandpa/vote_message_test.go @@ -8,10 +8,10 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/state" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/keystore" + "github.com/ChainSafe/gossamer/internal/dot/state" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/keystore" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/keystore/basic_keystore.go b/internal/lib/keystore/basic_keystore.go index e0890ed156d..278283bd7c1 100644 --- a/internal/lib/keystore/basic_keystore.go +++ b/internal/lib/keystore/basic_keystore.go @@ -9,8 +9,8 @@ import ( "fmt" "sync" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" ) var ( diff --git a/internal/lib/keystore/basic_keystore_test.go b/internal/lib/keystore/basic_keystore_test.go index 6013826eeb7..3805344e128 100644 --- a/internal/lib/keystore/basic_keystore_test.go +++ b/internal/lib/keystore/basic_keystore_test.go @@ -9,8 +9,8 @@ import ( "strings" "testing" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" ) var testPassword = []byte("1234") diff --git a/internal/lib/keystore/encrypt.go b/internal/lib/keystore/encrypt.go index 7e132aa1b03..94399dee788 100644 --- a/internal/lib/keystore/encrypt.go +++ b/internal/lib/keystore/encrypt.go @@ -14,10 +14,10 @@ import ( "os" "path/filepath" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/secp256k1" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/secp256k1" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" "golang.org/x/crypto/blake2b" ) diff --git a/internal/lib/keystore/encrypt_test.go b/internal/lib/keystore/encrypt_test.go index 290abaa20f1..b74c96eb3c3 100644 --- a/internal/lib/keystore/encrypt_test.go +++ b/internal/lib/keystore/encrypt_test.go @@ -11,9 +11,9 @@ import ( "reflect" "testing" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/secp256k1" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/secp256k1" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" ) func TestEncryptAndDecrypt(t *testing.T) { diff --git a/internal/lib/keystore/generic_keystore.go b/internal/lib/keystore/generic_keystore.go index 9286f22bd64..52595b06981 100644 --- a/internal/lib/keystore/generic_keystore.go +++ b/internal/lib/keystore/generic_keystore.go @@ -7,11 +7,11 @@ import ( "bytes" "sync" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/secp256k1" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/secp256k1" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" ) // GenericKeystore holds keys of any type diff --git a/internal/lib/keystore/generic_keystore_test.go b/internal/lib/keystore/generic_keystore_test.go index 33029d3e42b..d95b611e522 100644 --- a/internal/lib/keystore/generic_keystore_test.go +++ b/internal/lib/keystore/generic_keystore_test.go @@ -9,10 +9,10 @@ import ( "strings" "testing" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/secp256k1" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/secp256k1" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" ) func TestGetSr25519PublicKeys(t *testing.T) { diff --git a/internal/lib/keystore/helpers.go b/internal/lib/keystore/helpers.go index a4161ae5b89..d0b71152c1d 100644 --- a/internal/lib/keystore/helpers.go +++ b/internal/lib/keystore/helpers.go @@ -12,12 +12,12 @@ import ( "path/filepath" "strings" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/secp256k1" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/secp256k1" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/utils" ) // PrivateKeyToKeypair returns a public, private keypair given a private key diff --git a/internal/lib/keystore/helpers_test.go b/internal/lib/keystore/helpers_test.go index dd7828a7bc1..1095f6c7f88 100644 --- a/internal/lib/keystore/helpers_test.go +++ b/internal/lib/keystore/helpers_test.go @@ -12,11 +12,11 @@ import ( "strings" "testing" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/keystore/keyring.go b/internal/lib/keystore/keyring.go index caae986fb2e..2295aca7f80 100644 --- a/internal/lib/keystore/keyring.go +++ b/internal/lib/keystore/keyring.go @@ -6,10 +6,10 @@ package keystore import ( "reflect" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" ) // private keys generated using `subkey inspect //Name` diff --git a/internal/lib/keystore/keyring_test.go b/internal/lib/keystore/keyring_test.go index 7ff06770b40..ca40e53c530 100644 --- a/internal/lib/keystore/keyring_test.go +++ b/internal/lib/keystore/keyring_test.go @@ -7,8 +7,8 @@ import ( "reflect" "testing" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/keystore/keystore.go b/internal/lib/keystore/keystore.go index e1e004ab09f..8187793da48 100644 --- a/internal/lib/keystore/keystore.go +++ b/internal/lib/keystore/keystore.go @@ -6,8 +6,8 @@ package keystore import ( "errors" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" ) var ( diff --git a/internal/lib/runtime/constants.go b/internal/lib/runtime/constants.go index e317bfa6888..36b653930cd 100644 --- a/internal/lib/runtime/constants.go +++ b/internal/lib/runtime/constants.go @@ -4,7 +4,7 @@ package runtime import ( - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) var runtimes = []string{HOST_API_TEST_RUNTIME, POLKADOT_RUNTIME, NODE_RUNTIME, DEV_RUNTIME} diff --git a/internal/lib/runtime/interface.go b/internal/lib/runtime/interface.go index 2f4bb78ad2a..a2f794bde6c 100644 --- a/internal/lib/runtime/interface.go +++ b/internal/lib/runtime/interface.go @@ -4,11 +4,11 @@ package runtime import ( - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/transaction" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/transaction" + "github.com/ChainSafe/gossamer/internal/lib/trie" ) //go:generate mockery --name Instance --structname Instance --case underscore --keeptree diff --git a/internal/lib/runtime/life/exports.go b/internal/lib/runtime/life/exports.go index 5e8f3caaee6..431f97e83a6 100644 --- a/internal/lib/runtime/life/exports.go +++ b/internal/lib/runtime/life/exports.go @@ -9,9 +9,9 @@ import ( "fmt" "strings" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/transaction" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/transaction" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/lib/runtime/life/exports_test.go b/internal/lib/runtime/life/exports_test.go index 30fb7533469..424a4e762a7 100644 --- a/internal/lib/runtime/life/exports_test.go +++ b/internal/lib/runtime/life/exports_test.go @@ -8,13 +8,13 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/runtime/life/instance.go b/internal/lib/runtime/life/instance.go index f5d50f2732a..34ec5c2f4af 100644 --- a/internal/lib/runtime/life/instance.go +++ b/internal/lib/runtime/life/instance.go @@ -10,11 +10,11 @@ import ( "path/filepath" "sync" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" "github.com/perlin-network/life/exec" wasm_validation "github.com/perlin-network/life/wasm-validation" diff --git a/internal/lib/runtime/life/resolver.go b/internal/lib/runtime/life/resolver.go index 08457fb3d26..1b4103293ba 100644 --- a/internal/lib/runtime/life/resolver.go +++ b/internal/lib/runtime/life/resolver.go @@ -10,14 +10,14 @@ import ( "fmt" "math/big" - "github.com/ChainSafe/gossamer/lib/common" - rtype "github.com/ChainSafe/gossamer/lib/common/types" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/secp256k1" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/common" + rtype "github.com/ChainSafe/gossamer/internal/lib/common/types" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/secp256k1" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/perlin-network/life/exec" ) diff --git a/internal/lib/runtime/life/resolver_test.go b/internal/lib/runtime/life/resolver_test.go index f8edf6c5a13..fc00e04da09 100644 --- a/internal/lib/runtime/life/resolver_test.go +++ b/internal/lib/runtime/life/resolver_test.go @@ -9,16 +9,16 @@ import ( "sort" "testing" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/common/types" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/secp256k1" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common/types" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/secp256k1" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/runtime/life/test_helpers.go b/internal/lib/runtime/life/test_helpers.go index b10fef20301..bdb2efbfd10 100644 --- a/internal/lib/runtime/life/test_helpers.go +++ b/internal/lib/runtime/life/test_helpers.go @@ -7,11 +7,11 @@ import ( "path/filepath" "testing" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/trie" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/runtime/mocks/instance.go b/internal/lib/runtime/mocks/instance.go index ca866f4d174..fcbb1c452f4 100644 --- a/internal/lib/runtime/mocks/instance.go +++ b/internal/lib/runtime/mocks/instance.go @@ -3,16 +3,16 @@ package mocks import ( - common "github.com/ChainSafe/gossamer/lib/common" - keystore "github.com/ChainSafe/gossamer/lib/keystore" + common "github.com/ChainSafe/gossamer/internal/lib/common" + keystore "github.com/ChainSafe/gossamer/internal/lib/keystore" mock "github.com/stretchr/testify/mock" - runtime "github.com/ChainSafe/gossamer/lib/runtime" + runtime "github.com/ChainSafe/gossamer/internal/lib/runtime" - transaction "github.com/ChainSafe/gossamer/lib/transaction" + transaction "github.com/ChainSafe/gossamer/internal/lib/transaction" - types "github.com/ChainSafe/gossamer/dot/types" + types "github.com/ChainSafe/gossamer/internal/dot/types" ) // Instance is an autogenerated mock type for the Instance type diff --git a/internal/lib/runtime/mocks/transaction_state.go b/internal/lib/runtime/mocks/transaction_state.go index 57dd453d06a..0b400ef2e82 100644 --- a/internal/lib/runtime/mocks/transaction_state.go +++ b/internal/lib/runtime/mocks/transaction_state.go @@ -3,10 +3,10 @@ package mocks import ( - common "github.com/ChainSafe/gossamer/lib/common" + common "github.com/ChainSafe/gossamer/internal/lib/common" mock "github.com/stretchr/testify/mock" - transaction "github.com/ChainSafe/gossamer/lib/transaction" + transaction "github.com/ChainSafe/gossamer/internal/lib/transaction" ) // TransactionState is an autogenerated mock type for the TransactionState type diff --git a/internal/lib/runtime/mocks/version.go b/internal/lib/runtime/mocks/version.go index 393d58564be..26b613bfea3 100644 --- a/internal/lib/runtime/mocks/version.go +++ b/internal/lib/runtime/mocks/version.go @@ -3,7 +3,7 @@ package mocks import ( - runtime "github.com/ChainSafe/gossamer/lib/runtime" + runtime "github.com/ChainSafe/gossamer/internal/lib/runtime" mock "github.com/stretchr/testify/mock" ) diff --git a/internal/lib/runtime/storage/trie.go b/internal/lib/runtime/storage/trie.go index bd57efd12c1..6df1ae2a584 100644 --- a/internal/lib/runtime/storage/trie.go +++ b/internal/lib/runtime/storage/trie.go @@ -8,8 +8,8 @@ import ( "sort" "sync" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/trie" ) // TrieState is a wrapper around a transient trie that is used during the course of executing some runtime call. diff --git a/internal/lib/runtime/storage/trie_test.go b/internal/lib/runtime/storage/trie_test.go index 364a378146f..3868f8d2cb2 100644 --- a/internal/lib/runtime/storage/trie_test.go +++ b/internal/lib/runtime/storage/trie_test.go @@ -9,8 +9,8 @@ import ( "sort" "testing" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/trie" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/runtime/test_helpers.go b/internal/lib/runtime/test_helpers.go index e9e7d0f5f9f..8c01cac9ef8 100644 --- a/internal/lib/runtime/test_helpers.go +++ b/internal/lib/runtime/test_helpers.go @@ -13,10 +13,10 @@ import ( "time" "github.com/ChainSafe/chaindb" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/utils" ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/runtime/types.go b/internal/lib/runtime/types.go index 312be14058c..4ae8df9e086 100644 --- a/internal/lib/runtime/types.go +++ b/internal/lib/runtime/types.go @@ -4,11 +4,11 @@ package runtime import ( + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime/offchain" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime/offchain" ) // NodeStorageType type to identify offchain storage type diff --git a/internal/lib/runtime/types_test.go b/internal/lib/runtime/types_test.go index 98627f241d5..264f55f066e 100644 --- a/internal/lib/runtime/types_test.go +++ b/internal/lib/runtime/types_test.go @@ -8,12 +8,12 @@ import ( "testing" "time" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/secp256k1" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/secp256k1" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/runtime/wasmer/exports.go b/internal/lib/runtime/wasmer/exports.go index 8d73b1d7756..0fb464aa600 100644 --- a/internal/lib/runtime/wasmer/exports.go +++ b/internal/lib/runtime/wasmer/exports.go @@ -7,9 +7,9 @@ import ( "fmt" "strings" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/transaction" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/transaction" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/lib/runtime/wasmer/exports_test.go b/internal/lib/runtime/wasmer/exports_test.go index 3bfaed746f7..c4c28af1550 100644 --- a/internal/lib/runtime/wasmer/exports_test.go +++ b/internal/lib/runtime/wasmer/exports_test.go @@ -12,15 +12,15 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/genesis" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer/testdata" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/genesis" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/runtime/wasmer/testdata" - "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/centrifuge/go-substrate-rpc-client/v3/signature" diff --git a/internal/lib/runtime/wasmer/imports.go b/internal/lib/runtime/wasmer/imports.go index 529f5ddb9c2..5bafae8bb54 100644 --- a/internal/lib/runtime/wasmer/imports.go +++ b/internal/lib/runtime/wasmer/imports.go @@ -108,17 +108,17 @@ import ( "time" "unsafe" + "github.com/ChainSafe/gossamer/internal/lib/common" + rtype "github.com/ChainSafe/gossamer/internal/lib/common/types" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/secp256k1" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + rtstorage "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/transaction" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - rtype "github.com/ChainSafe/gossamer/lib/common/types" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/secp256k1" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/runtime" - rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/transaction" - "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" wasm "github.com/wasmerio/go-ext-wasm/wasmer" diff --git a/internal/lib/runtime/wasmer/imports_test.go b/internal/lib/runtime/wasmer/imports_test.go index c86286e4d73..f7f32e1edaa 100644 --- a/internal/lib/runtime/wasmer/imports_test.go +++ b/internal/lib/runtime/wasmer/imports_test.go @@ -13,17 +13,17 @@ import ( "time" "github.com/ChainSafe/chaindb" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common/types" + "github.com/ChainSafe/gossamer/internal/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto/ed25519" + "github.com/ChainSafe/gossamer/internal/lib/crypto/secp256k1" + "github.com/ChainSafe/gossamer/internal/lib/crypto/sr25519" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/common/types" - "github.com/ChainSafe/gossamer/lib/crypto" - "github.com/ChainSafe/gossamer/lib/crypto/ed25519" - "github.com/ChainSafe/gossamer/lib/crypto/secp256k1" - "github.com/ChainSafe/gossamer/lib/crypto/sr25519" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/trie" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/internal/lib/runtime/wasmer/instance.go b/internal/lib/runtime/wasmer/instance.go index 7c87ceb2879..df9f7696212 100644 --- a/internal/lib/runtime/wasmer/instance.go +++ b/internal/lib/runtime/wasmer/instance.go @@ -8,14 +8,14 @@ import ( "fmt" "sync" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/runtime/offchain" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/runtime/offchain" - "github.com/ChainSafe/gossamer/lib/trie" - "github.com/ChainSafe/gossamer/lib/crypto" + "github.com/ChainSafe/gossamer/internal/lib/crypto" wasm "github.com/wasmerio/go-ext-wasm/wasmer" ) diff --git a/internal/lib/runtime/wasmer/instance_test.go b/internal/lib/runtime/wasmer/instance_test.go index 08e071223ec..71f995724f1 100644 --- a/internal/lib/runtime/wasmer/instance_test.go +++ b/internal/lib/runtime/wasmer/instance_test.go @@ -8,7 +8,7 @@ import ( "path/filepath" "testing" - "github.com/ChainSafe/gossamer/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/runtime" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/runtime/wasmer/test_helpers.go b/internal/lib/runtime/wasmer/test_helpers.go index dd2a5f39c6c..3c3ab1e1f26 100644 --- a/internal/lib/runtime/wasmer/test_helpers.go +++ b/internal/lib/runtime/wasmer/test_helpers.go @@ -7,13 +7,13 @@ import ( "path/filepath" "testing" + "github.com/ChainSafe/gossamer/internal/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/keystore" + "github.com/ChainSafe/gossamer/internal/lib/runtime" + "github.com/ChainSafe/gossamer/internal/lib/runtime/mocks" + "github.com/ChainSafe/gossamer/internal/lib/runtime/storage" + "github.com/ChainSafe/gossamer/internal/lib/trie" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/lib/keystore" - "github.com/ChainSafe/gossamer/lib/runtime" - "github.com/ChainSafe/gossamer/lib/runtime/mocks" - "github.com/ChainSafe/gossamer/lib/runtime/storage" - "github.com/ChainSafe/gossamer/lib/trie" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/services/services_test.go b/internal/lib/services/services_test.go index c83bf742813..042f888f586 100644 --- a/internal/lib/services/services_test.go +++ b/internal/lib/services/services_test.go @@ -7,8 +7,8 @@ import ( "io" "testing" + "github.com/ChainSafe/gossamer/internal/lib/services/mocks" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/services/mocks" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/transaction/pool.go b/internal/lib/transaction/pool.go index de4c44de0e2..d78a2d2f91a 100644 --- a/internal/lib/transaction/pool.go +++ b/internal/lib/transaction/pool.go @@ -6,7 +6,7 @@ package transaction import ( "sync" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // Pool represents the transaction pool diff --git a/internal/lib/transaction/pool_test.go b/internal/lib/transaction/pool_test.go index 860d35f6bc1..01828cbdaf2 100644 --- a/internal/lib/transaction/pool_test.go +++ b/internal/lib/transaction/pool_test.go @@ -7,7 +7,7 @@ import ( "sort" "testing" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/transaction/priority_queue.go b/internal/lib/transaction/priority_queue.go index 68ac1401660..57a1acf5ff7 100644 --- a/internal/lib/transaction/priority_queue.go +++ b/internal/lib/transaction/priority_queue.go @@ -8,8 +8,8 @@ import ( "errors" "sync" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // ErrTransactionExists is returned when trying to add a transaction to the queue that already exists diff --git a/internal/lib/transaction/types.go b/internal/lib/transaction/types.go index 5977dad0f79..d9f88ebe1ba 100644 --- a/internal/lib/transaction/types.go +++ b/internal/lib/transaction/types.go @@ -4,7 +4,7 @@ package transaction import ( - "github.com/ChainSafe/gossamer/dot/types" + "github.com/ChainSafe/gossamer/internal/dot/types" ) // Validity struct see diff --git a/internal/lib/trie/child_storage.go b/internal/lib/trie/child_storage.go index e0bc537710b..30a7c3253cd 100644 --- a/internal/lib/trie/child_storage.go +++ b/internal/lib/trie/child_storage.go @@ -6,7 +6,7 @@ package trie import ( "fmt" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) // ChildStorageKeyPrefix is the prefix for all child storage keys diff --git a/internal/lib/trie/database.go b/internal/lib/trie/database.go index 979c346cbaf..05bb9f0b9bd 100644 --- a/internal/lib/trie/database.go +++ b/internal/lib/trie/database.go @@ -8,9 +8,9 @@ import ( "errors" "fmt" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/internal/trie/codec" "github.com/ChainSafe/gossamer/internal/trie/node" - "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/chaindb" ) diff --git a/internal/lib/trie/database_test.go b/internal/lib/trie/database_test.go index f121573d418..4aa26df6c9a 100644 --- a/internal/lib/trie/database_test.go +++ b/internal/lib/trie/database_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/ChainSafe/chaindb" - "github.com/ChainSafe/gossamer/lib/utils" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/lib/trie/print.go b/internal/lib/trie/print.go index e39c8069f6e..58fa20cbc62 100644 --- a/internal/lib/trie/print.go +++ b/internal/lib/trie/print.go @@ -7,9 +7,9 @@ import ( "bytes" "fmt" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/internal/trie/node" "github.com/ChainSafe/gossamer/internal/trie/pools" - "github.com/ChainSafe/gossamer/lib/common" "github.com/disiqueira/gotree" ) diff --git a/internal/lib/trie/proof.go b/internal/lib/trie/proof.go index 4bd2b0c066c..4e78a7e8483 100644 --- a/internal/lib/trie/proof.go +++ b/internal/lib/trie/proof.go @@ -10,9 +10,9 @@ import ( "fmt" "github.com/ChainSafe/chaindb" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/internal/trie/codec" "github.com/ChainSafe/gossamer/internal/trie/record" - "github.com/ChainSafe/gossamer/lib/common" ) var ( diff --git a/internal/lib/trie/trie.go b/internal/lib/trie/trie.go index 65d1bddf53c..a108090faf8 100644 --- a/internal/lib/trie/trie.go +++ b/internal/lib/trie/trie.go @@ -7,10 +7,10 @@ import ( "bytes" "fmt" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/internal/trie/codec" "github.com/ChainSafe/gossamer/internal/trie/node" "github.com/ChainSafe/gossamer/internal/trie/pools" - "github.com/ChainSafe/gossamer/lib/common" ) // EmptyHash is the empty trie hash. diff --git a/internal/lib/trie/trie_test.go b/internal/lib/trie/trie_test.go index cc19116a50a..9057154ee2a 100644 --- a/internal/lib/trie/trie_test.go +++ b/internal/lib/trie/trie_test.go @@ -20,9 +20,9 @@ import ( "github.com/ChainSafe/chaindb" "github.com/stretchr/testify/require" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/internal/trie/codec" "github.com/ChainSafe/gossamer/internal/trie/node" - "github.com/ChainSafe/gossamer/lib/common" ) type commonPrefixTest struct { diff --git a/internal/lib/utils/utils.go b/internal/lib/utils/utils.go index c2f8404057a..c186142d71d 100644 --- a/internal/lib/utils/utils.go +++ b/internal/lib/utils/utils.go @@ -4,6 +4,7 @@ package utils import ( + "errors" "fmt" "os" "os/user" @@ -147,50 +148,68 @@ func KeystoreFilepaths(basepath string) ([]string, error) { // GetGssmrGenesisRawPath gets the gssmr raw genesis path func GetGssmrGenesisRawPath() string { - path1 := "../chain/gssmr/genesis.json" - path2 := "../../chain/gssmr/genesis.json" - - var fp string - - if PathExists(path1) { - fp, _ = filepath.Abs(path1) - } else if PathExists(path2) { - fp, _ = filepath.Abs(path2) + chainDir, err := locateChainDirectory() + if err != nil { + panic(err) } - return fp + return filepath.Join(chainDir, "gssmr/genesis.json") } // GetGssmrGenesisPath gets the gssmr human-readable genesis path func GetGssmrGenesisPath() string { - path1 := "../chain/gssmr/genesis-spec.json" - path2 := "../../chain/gssmr/genesis-spec.json" - - var fp string - - if PathExists(path1) { - fp, _ = filepath.Abs(path1) - } else if PathExists(path2) { - fp, _ = filepath.Abs(path2) + chainDir, err := locateChainDirectory() + if err != nil { + panic(err) } - return fp + return filepath.Join(chainDir, "gssmr/genesis-spec.json") } // GetKusamaGenesisPath gets the kusama genesis path func GetKusamaGenesisPath() string { - path1 := "../chain/kusama/genesis.json" - path2 := "../../chain/kusama/genesis.json" + chainDir, err := locateChainDirectory() + if err != nil { + panic(err) + } - var fp string + return filepath.Join(chainDir, "kusama/genesis.json") +} - if PathExists(path1) { - fp, _ = filepath.Abs(path1) - } else if PathExists(path2) { - fp, _ = filepath.Abs(path2) +// GetDevGenesisPath gets the dev genesis path +func GetDevGenesisPath() string { + chainDir, err := locateChainDirectory() + if err != nil { + panic(err) + } + + return filepath.Join(chainDir, "dev/genesis.json") +} + +var ( + ErrChainDirectoryPathNotValid = errors.New("chain directory path is not valid") + ErrChainDirectoryPathNotFound = errors.New("chain directory path not found") +) + +func locateChainDirectory() (chainDir string, err error) { + pathsToTry := []string{ + "../../internal/chain/", // from cmd/gossamer + "../chain/", // from internal/package + "../../chain/", // from internal/package/subpackage + "../../../chain/", // from internal/package/subpackage/subpackage + } + + for _, pathToTry := range pathsToTry { + if PathExists(pathToTry) { + path, err := filepath.Abs(pathToTry) + if err != nil { + return "", fmt.Errorf("%w: %s", ErrChainDirectoryPathNotValid, pathToTry) + } + return path, nil + } } - return fp + return "", ErrChainDirectoryPathNotFound } // LoadChainDB load the db at the given path. diff --git a/internal/tests/data/db/config.toml b/internal/tests/data/db/config.toml index 841fa35b2b5..a05133a677c 100644 --- a/internal/tests/data/db/config.toml +++ b/internal/tests/data/db/config.toml @@ -1,5 +1,5 @@ [global] -basepath = "../../tests/data/db" +basepath = "../../internal/tests/data/db" log = "info" metrics-port = 9876 @@ -14,7 +14,7 @@ grandpa = "" sync = "" [init] -genesis = "./chain/gssmr/genesis.json" +genesis = "./internal/chain/gssmr/genesis.json" [account] key = "" diff --git a/internal/tests/polkadotjs_test/start_polkadotjs_test.go b/internal/tests/polkadotjs_test/start_polkadotjs_test.go index c592193300d..604a91ef688 100644 --- a/internal/tests/polkadotjs_test/start_polkadotjs_test.go +++ b/internal/tests/polkadotjs_test/start_polkadotjs_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/tests/utils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/rpc/rpc_00_test.go b/internal/tests/rpc/rpc_00_test.go index 8dc17d7fb1b..23dbd6b9e5d 100644 --- a/internal/tests/rpc/rpc_00_test.go +++ b/internal/tests/rpc/rpc_00_test.go @@ -10,7 +10,7 @@ import ( "strconv" "testing" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/tests/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/rpc/rpc_01-system_test.go b/internal/tests/rpc/rpc_01-system_test.go index 70300822584..14fcc3278b1 100644 --- a/internal/tests/rpc/rpc_01-system_test.go +++ b/internal/tests/rpc/rpc_01-system_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/rpc/modules" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/tests/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/rpc/rpc_02-author_test.go b/internal/tests/rpc/rpc_02-author_test.go index f234a1c46be..75830fbda88 100644 --- a/internal/tests/rpc/rpc_02-author_test.go +++ b/internal/tests/rpc/rpc_02-author_test.go @@ -12,7 +12,7 @@ import ( "github.com/centrifuge/go-substrate-rpc-client/v3/scale" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/tests/utils" gsrpc "github.com/centrifuge/go-substrate-rpc-client/v3" "github.com/centrifuge/go-substrate-rpc-client/v3/signature" "github.com/centrifuge/go-substrate-rpc-client/v3/types" diff --git a/internal/tests/rpc/rpc_03-chain_test.go b/internal/tests/rpc/rpc_03-chain_test.go index 533b69b8f53..6e181135040 100644 --- a/internal/tests/rpc/rpc_03-chain_test.go +++ b/internal/tests/rpc/rpc_03-chain_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/rpc/modules" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/tests/utils" "github.com/gorilla/websocket" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/rpc/rpc_04-offchain_test.go b/internal/tests/rpc/rpc_04-offchain_test.go index 441cd4c7969..4d9253dc0df 100644 --- a/internal/tests/rpc/rpc_04-offchain_test.go +++ b/internal/tests/rpc/rpc_04-offchain_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/tests/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/rpc/rpc_05-state_test.go b/internal/tests/rpc/rpc_05-state_test.go index 2e6bdc7ac1f..56ebc13fb15 100644 --- a/internal/tests/rpc/rpc_05-state_test.go +++ b/internal/tests/rpc/rpc_05-state_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/rpc/modules" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/tests/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/rpc/rpc_06-engine_test.go b/internal/tests/rpc/rpc_06-engine_test.go index 77fc8a80350..b7259ecd897 100644 --- a/internal/tests/rpc/rpc_06-engine_test.go +++ b/internal/tests/rpc/rpc_06-engine_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/tests/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/rpc/rpc_07-payment_test.go b/internal/tests/rpc/rpc_07-payment_test.go index 055044c269c..bcef3a6f048 100644 --- a/internal/tests/rpc/rpc_07-payment_test.go +++ b/internal/tests/rpc/rpc_07-payment_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/tests/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/rpc/rpc_08-contracts_test.go b/internal/tests/rpc/rpc_08-contracts_test.go index 2b68ad64f4c..4bc9df6dad3 100644 --- a/internal/tests/rpc/rpc_08-contracts_test.go +++ b/internal/tests/rpc/rpc_08-contracts_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/tests/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/rpc/rpc_09-babe_test.go b/internal/tests/rpc/rpc_09-babe_test.go index 0269c966521..74cca559c43 100644 --- a/internal/tests/rpc/rpc_09-babe_test.go +++ b/internal/tests/rpc/rpc_09-babe_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/tests/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/rpc/system_integration_test.go b/internal/tests/rpc/system_integration_test.go index 51981a8b52f..8b7987efa61 100644 --- a/internal/tests/rpc/system_integration_test.go +++ b/internal/tests/rpc/system_integration_test.go @@ -8,8 +8,8 @@ import ( "strconv" "testing" - "github.com/ChainSafe/gossamer/dot/rpc/modules" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/tests/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/stress/grandpa_test.go b/internal/tests/stress/grandpa_test.go index dc0e9028434..4dd5f22e1b2 100644 --- a/internal/tests/stress/grandpa_test.go +++ b/internal/tests/stress/grandpa_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/tests/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/stress/helpers.go b/internal/tests/stress/helpers.go index c3841089ce8..57892d842b3 100644 --- a/internal/tests/stress/helpers.go +++ b/internal/tests/stress/helpers.go @@ -9,10 +9,10 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/tests/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/stress/network_test.go b/internal/tests/stress/network_test.go index b8115c9cf0b..01f85f7f035 100644 --- a/internal/tests/stress/network_test.go +++ b/internal/tests/stress/network_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/tests/utils" "github.com/ChainSafe/gossamer/internal/log" "github.com/stretchr/testify/require" diff --git a/internal/tests/stress/stress_test.go b/internal/tests/stress/stress_test.go index 3aa7ece8d4f..b081c6d3f19 100644 --- a/internal/tests/stress/stress_test.go +++ b/internal/tests/stress/stress_test.go @@ -19,10 +19,10 @@ import ( "github.com/gorilla/websocket" "github.com/stretchr/testify/require" - gosstypes "github.com/ChainSafe/gossamer/dot/types" + gosstypes "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/common" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/tests/utils" ) func TestMain(m *testing.M) { diff --git a/internal/tests/sync/sync_test.go b/internal/tests/sync/sync_test.go index ec8fba74c4d..28e05f68e25 100644 --- a/internal/tests/sync/sync_test.go +++ b/internal/tests/sync/sync_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/tests/utils" + "github.com/ChainSafe/gossamer/internal/tests/utils" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/utils/chain.go b/internal/tests/utils/chain.go index 4c6e5543060..49a57ef7628 100644 --- a/internal/tests/utils/chain.go +++ b/internal/tests/utils/chain.go @@ -9,9 +9,9 @@ import ( "strconv" "testing" - "github.com/ChainSafe/gossamer/dot/rpc/modules" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/utils/dev.go b/internal/tests/utils/dev.go index 1b16b4603f7..38fad343c1a 100644 --- a/internal/tests/utils/dev.go +++ b/internal/tests/utils/dev.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/utils/gossamer_utils.go b/internal/tests/utils/gossamer_utils.go index 0d76efd0d32..a5b63838006 100644 --- a/internal/tests/utils/gossamer_utils.go +++ b/internal/tests/utils/gossamer_utils.go @@ -15,11 +15,11 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot" - ctoml "github.com/ChainSafe/gossamer/dot/config/toml" - "github.com/ChainSafe/gossamer/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/dot" + ctoml "github.com/ChainSafe/gossamer/internal/dot/config/toml" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/lib/utils" "github.com/ChainSafe/gossamer/internal/log" - "github.com/ChainSafe/gossamer/lib/utils" "github.com/stretchr/testify/assert" ) @@ -39,7 +39,7 @@ var ( BaseWSPort = 8546 currentDir, _ = os.Getwd() - gossamerCMD = filepath.Join(currentDir, "../..", "bin/gossamer") + gossamerCMD = filepath.Join(currentDir, "../../..", "bin/gossamer") // GenesisOneAuth is the genesis file that has 1 authority GenesisOneAuth = filepath.Join(currentDir, "../utils/genesis_oneauth.json") @@ -428,7 +428,7 @@ func generateDefaultConfig() *ctoml.Config { SyncLvl: "info", }, Init: ctoml.InitConfig{ - Genesis: "./chain/gssmr/genesis.json", + Genesis: "./internal/chain/gssmr/genesis.json", }, Account: ctoml.AccountConfig{ Key: "", diff --git a/internal/tests/utils/header.go b/internal/tests/utils/header.go index 2e10645f60e..1a8d967a15b 100644 --- a/internal/tests/utils/header.go +++ b/internal/tests/utils/header.go @@ -7,9 +7,9 @@ import ( "math/big" "testing" - "github.com/ChainSafe/gossamer/dot/rpc/modules" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/utils/request_utils.go b/internal/tests/utils/request_utils.go index 2068c09d49f..01c27a9ac3d 100644 --- a/internal/tests/utils/request_utils.go +++ b/internal/tests/utils/request_utils.go @@ -14,8 +14,8 @@ import ( "testing" "time" - "github.com/ChainSafe/gossamer/dot/types" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/types" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/stretchr/testify/require" diff --git a/internal/tests/utils/state.go b/internal/tests/utils/state.go index f1719171c5d..abc21dd6bb3 100644 --- a/internal/tests/utils/state.go +++ b/internal/tests/utils/state.go @@ -6,7 +6,7 @@ package utils import ( "testing" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/stretchr/testify/require" ) diff --git a/internal/tests/utils/system.go b/internal/tests/utils/system.go index 3810cbe49eb..62dce75b9fc 100644 --- a/internal/tests/utils/system.go +++ b/internal/tests/utils/system.go @@ -6,8 +6,8 @@ package utils import ( "testing" - "github.com/ChainSafe/gossamer/dot/rpc/modules" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/dot/rpc/modules" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/stretchr/testify/require" ) diff --git a/internal/trie/node/branch.go b/internal/trie/node/branch.go index 6d059f93043..5039d9eea06 100644 --- a/internal/trie/node/branch.go +++ b/internal/trie/node/branch.go @@ -7,7 +7,7 @@ import ( "fmt" "sync" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) var _ Node = (*Branch)(nil) diff --git a/internal/trie/node/branch_encode.go b/internal/trie/node/branch_encode.go index badd3556f0a..428441faaaf 100644 --- a/internal/trie/node/branch_encode.go +++ b/internal/trie/node/branch_encode.go @@ -9,9 +9,9 @@ import ( "hash" "io" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/internal/trie/codec" "github.com/ChainSafe/gossamer/internal/trie/pools" - "github.com/ChainSafe/gossamer/lib/common" "github.com/ChainSafe/gossamer/pkg/scale" ) diff --git a/internal/trie/node/hash.go b/internal/trie/node/hash.go index 315ad9b738b..59d9bd67b11 100644 --- a/internal/trie/node/hash.go +++ b/internal/trie/node/hash.go @@ -6,8 +6,8 @@ package node import ( "bytes" + "github.com/ChainSafe/gossamer/internal/lib/common" "github.com/ChainSafe/gossamer/internal/trie/pools" - "github.com/ChainSafe/gossamer/lib/common" ) // SetEncodingAndHash sets the encoding and hash slices diff --git a/internal/trie/node/leaf.go b/internal/trie/node/leaf.go index bcaf4ba3ae4..df9b1d4d21e 100644 --- a/internal/trie/node/leaf.go +++ b/internal/trie/node/leaf.go @@ -7,7 +7,7 @@ import ( "fmt" "sync" - "github.com/ChainSafe/gossamer/lib/common" + "github.com/ChainSafe/gossamer/internal/lib/common" ) var _ Node = (*Leaf)(nil) diff --git a/scripts/docker-entrypoint.sh b/scripts/docker-entrypoint.sh index e268d21569e..ec91813f09d 100755 --- a/scripts/docker-entrypoint.sh +++ b/scripts/docker-entrypoint.sh @@ -22,7 +22,7 @@ BASE_PATH=~/gossamer-dev set -euxo pipefail if [ ! -f $BASE_PATH/genesis_created ]; then - /gossamer/bin/gossamer init --genesis=/gossamer/chain/gssmr/genesis.json + /gossamer/bin/gossamer init --genesis=/gossamer/internal/chaingssmr/genesis.json touch $BASE_PATH/genesis_created; fi; diff --git a/scripts/integration-test-all.sh b/scripts/integration-test-all.sh index 7c1cf9d81a8..359196ebb4a 100755 --- a/scripts/integration-test-all.sh +++ b/scripts/integration-test-all.sh @@ -84,7 +84,7 @@ if [[ -z $TEST || $TEST == "rpc" ]]; then for i in $(seq 1 "$TEST_QTD"); do echo "going to test gossamer node $(($RPC_PORT + $i))..." - MODE=$MODE NETWORK_SIZE=$QTD HOSTNAME=$HOSTNAME PORT=$(($RPC_PORT + $i)) go test ./tests/rpc/... -timeout=60s -v -count=1 + MODE=$MODE NETWORK_SIZE=$QTD HOSTNAME=$HOSTNAME PORT=$(($RPC_PORT + $i)) go test ./internal/tests/rpc/... -timeout=60s -v -count=1 RPC_FAIL=$? done