From d47ea5bc267a1d944ef3065e004f62bf185e1848 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Thu, 16 Nov 2023 16:12:38 -0600 Subject: [PATCH] switch from chainlink-relay to chainlink-common --- common/client/mock_rpc_test.go | 2 +- common/client/multi_node.go | 4 +- common/client/multi_node_test.go | 2 +- common/client/node.go | 2 +- common/client/node_lifecycle_test.go | 2 +- common/client/send_only_node.go | 2 +- common/client/send_only_node_test.go | 2 +- common/client/types.go | 2 +- common/headtracker/head_broadcaster.go | 2 +- common/headtracker/head_tracker.go | 2 +- common/txmgr/broadcaster.go | 4 +- common/txmgr/confirmer.go | 4 +- common/txmgr/resender.go | 2 +- common/txmgr/txmgr.go | 2 +- core/bridges/bridge_type.go | 2 +- core/bridges/bridge_type_test.go | 2 +- core/chains/chain_kv.go | 2 +- core/chains/chain_kv_test.go | 2 +- core/chains/evm/assets/assets.go | 4 +- core/chains/evm/assets/assets_test.go | 4 +- core/chains/evm/chain.go | 10 +-- core/chains/evm/client/chain_client.go | 4 +- core/chains/evm/client/client.go | 2 +- core/chains/evm/client/mocks/client.go | 2 +- core/chains/evm/client/node.go | 2 +- core/chains/evm/client/null_client.go | 2 +- core/chains/evm/client/pool.go | 2 +- core/chains/evm/client/rpc_client.go | 8 +-- core/chains/evm/client/send_only_node.go | 2 +- .../evm/client/simulated_backend_client.go | 2 +- core/chains/evm/config/chain_scoped.go | 2 +- core/chains/evm/config/config.go | 4 +- core/chains/evm/config/toml/config.go | 22 +++--- .../evm/forwarders/forwarder_manager.go | 2 +- core/chains/evm/gas/arbitrum_estimator.go | 2 +- .../chains/evm/gas/block_history_estimator.go | 2 +- core/chains/evm/gas/models.go | 2 +- .../evm/gas/rollups/l1_gas_price_oracle.go | 2 +- .../evm/gas/suggested_price_estimator.go | 2 +- .../evm/headtracker/head_tracker_test.go | 2 +- core/chains/evm/log/broadcaster.go | 2 +- core/chains/evm/logpoller/log_poller.go | 2 +- core/chains/evm/mocks/chain.go | 2 +- core/chains/evm/monitor/balance.go | 2 +- core/chains/evm/types/types.go | 2 +- core/cmd/cosmos_node_commands_test.go | 11 ++- core/cmd/cosmos_transaction_commands_test.go | 6 +- core/cmd/eth_keys_commands_test.go | 12 ++-- core/cmd/shell.go | 2 +- core/cmd/solana_node_commands_test.go | 2 +- core/cmd/solana_transaction_commands_test.go | 6 +- core/cmd/starknet_node_commands_test.go | 6 +- core/config/parse/parsers.go | 8 +-- core/internal/cltest/cltest.go | 2 +- core/internal/testutils/evmtest/evmtest.go | 2 +- core/logger/logger.go | 4 +- core/scripts/go.mod | 8 +-- core/scripts/go.sum | 16 ++--- core/services/blockhashstore/delegate.go | 2 +- core/services/blockheaderfeeder/delegate.go | 2 +- core/services/chainlink/application.go | 6 +- core/services/chainlink/config_test.go | 70 +++++++++---------- .../mocks/relayer_chain_interoperators.go | 4 +- .../chainlink/relayer_chain_interoperators.go | 4 +- .../relayer_chain_interoperators_test.go | 20 +++--- core/services/chainlink/relayer_factory.go | 2 +- core/services/directrequest/delegate.go | 4 +- core/services/directrequest/delegate_test.go | 2 +- core/services/directrequest/validate.go | 2 +- core/services/feeds/service.go | 2 +- core/services/fluxmonitorv2/config.go | 2 +- core/services/fluxmonitorv2/flux_monitor.go | 2 +- .../fluxmonitorv2/flux_monitor_test.go | 2 +- .../services/fluxmonitorv2/payment_checker.go | 2 +- .../fluxmonitorv2/payment_checker_test.go | 2 +- core/services/fluxmonitorv2/validate_test.go | 2 +- core/services/functions/connector_handler.go | 4 +- .../functions/connector_handler_test.go | 2 +- core/services/functions/listener.go | 2 +- core/services/gateway/connectionmanager.go | 2 +- core/services/gateway/connector/connector.go | 2 +- core/services/gateway/gateway.go | 2 +- .../gateway/handlers/functions/allowlist.go | 2 +- .../handlers/functions/handler.functions.go | 4 +- .../functions/handler.functions_test.go | 2 +- .../handlers/functions/subscriptions.go | 2 +- core/services/gateway/network/httpserver.go | 2 +- core/services/gateway/network/wsconnection.go | 2 +- core/services/gateway/network/wsserver.go | 2 +- core/services/health.go | 2 +- core/services/job/job_orm_test.go | 2 +- core/services/job/models.go | 8 +-- core/services/job/orm.go | 2 +- core/services/job/spawner.go | 8 +-- core/services/job/spawner_test.go | 4 +- .../keeper/registry_synchronizer_core.go | 2 +- core/services/keeper/upkeep_executer.go | 2 +- core/services/keystore/cosmos.go | 4 +- core/services/keystore/keys/ethkey/address.go | 2 +- core/services/keystore/starknet.go | 8 +-- core/services/mocks/checker.go | 2 +- core/services/multi.go | 2 +- core/services/nurse.go | 2 +- core/services/ocr/config_overrider.go | 2 +- core/services/ocr/contract_tracker.go | 2 +- core/services/ocr/delegate.go | 4 +- core/services/ocr2/delegate.go | 15 ++-- core/services/ocr2/delegate_test.go | 2 +- .../ocr2/plugins/functions/config/config.go | 2 +- .../services/ocr2/plugins/functions/plugin.go | 2 +- .../ocr2/plugins/functions/plugin_test.go | 2 +- .../ocr2/plugins/functions/reporting_test.go | 4 +- .../generic/pipeline_runner_adapter.go | 2 +- .../generic/pipeline_runner_adapter_test.go | 2 +- .../ocr2/plugins/generic/telemetry_adapter.go | 2 +- core/services/ocr2/plugins/median/plugin.go | 8 +-- core/services/ocr2/plugins/median/services.go | 4 +- .../ocr2/plugins/mercury/integration_test.go | 8 +-- core/services/ocr2/plugins/mercury/plugin.go | 10 +-- .../plugins/ocr2keeper/evm20/log_provider.go | 2 +- .../ocr2/plugins/ocr2keeper/evm20/registry.go | 2 +- .../ocr2keeper/evm21/block_subscriber.go | 2 +- .../ocr2keeper/evm21/logprovider/provider.go | 2 +- .../ocr2keeper/evm21/logprovider/recoverer.go | 2 +- .../evm21/mercury/streams/streams.go | 2 +- .../evm21/transmit/event_provider.go | 2 +- .../ocr2keeper/evm21/upkeepstate/store.go | 2 +- .../plugins/ocr2keeper/integration_21_test.go | 11 ++- .../plugins/ocr2keeper/integration_test.go | 10 +-- core/services/ocr2/plugins/ocr2keeper/util.go | 3 +- .../ocr2vrf/coordinator/coordinator_test.go | 12 ++-- core/services/ocr2/plugins/s4/factory_test.go | 4 +- .../ocr2/plugins/s4/integration_test.go | 4 +- core/services/ocr2/plugins/s4/plugin_test.go | 19 ++--- core/services/ocr2/validate/validate.go | 2 +- core/services/ocrbootstrap/delegate.go | 9 +-- core/services/ocrcommon/peer_wrapper.go | 7 +- core/services/ocrcommon/peerstore.go | 2 +- core/services/ocrcommon/run_saver.go | 2 +- core/services/ocrcommon/telemetry.go | 8 +-- core/services/ocrcommon/telemetry_test.go | 9 +-- core/services/periodicbackup/backup.go | 2 +- core/services/pg/event_broadcaster.go | 2 +- core/services/pg/q.go | 2 +- core/services/pg/sqlx.go | 2 +- core/services/pg/transaction.go | 2 +- core/services/pipeline/orm.go | 2 +- core/services/pipeline/runner.go | 2 +- core/services/promreporter/prom_reporter.go | 2 +- core/services/relay/evm/config_poller.go | 2 +- core/services/relay/evm/evm.go | 22 +++--- core/services/relay/evm/functions.go | 12 ++-- .../relay/evm/functions/logpoller_wrapper.go | 2 +- core/services/relay/evm/loop_impl.go | 2 +- .../relay/evm/mercury/persistence_manager.go | 2 +- core/services/relay/evm/mercury/queue.go | 2 +- .../services/relay/evm/mercury/transmitter.go | 5 +- .../relay/evm/mercury/v1/data_source.go | 4 +- .../relay/evm/mercury/v1/data_source_test.go | 4 +- .../mercury/v1/reportcodec/report_codec.go | 3 +- .../v1/reportcodec/report_codec_test.go | 2 +- .../relay/evm/mercury/v2/data_source.go | 4 +- .../relay/evm/mercury/v2/data_source_test.go | 4 +- .../mercury/v2/reportcodec/report_codec.go | 3 +- .../v2/reportcodec/report_codec_test.go | 2 +- .../relay/evm/mercury/v3/data_source.go | 4 +- .../relay/evm/mercury/v3/data_source_test.go | 4 +- .../mercury/v3/reportcodec/report_codec.go | 3 +- .../v3/reportcodec/report_codec_test.go | 2 +- .../relay/evm/mercury/wsrpc/client.go | 2 +- core/services/relay/evm/mercury_provider.go | 14 ++-- .../relay/evm/mocks/loop_relay_adapter.go | 2 +- core/services/relay/evm/ocr2keeper.go | 15 ++-- core/services/relay/evm/ocr2vrf.go | 17 ++--- core/services/relay/evm/relayer_extender.go | 8 +-- .../relay/evm/request_round_tracker.go | 3 +- core/services/relay/evm/types/types.go | 12 ++-- core/services/relay/grpc_provider_server.go | 4 +- .../relay/grpc_provider_server_test.go | 2 +- core/services/relay/relay.go | 4 +- core/services/relay/relay_test.go | 7 +- core/services/service.go | 2 +- .../telemetry_ingress_batch_client.go | 2 +- .../telemetry_ingress_client.go | 2 +- core/services/telemetry/manager.go | 2 +- core/services/telemetry/manager_test.go | 2 +- .../vrf_coordinator_interface.go | 2 +- core/services/vrf/v1/listener_v1.go | 2 +- core/services/vrf/v2/integration_v2_test.go | 4 +- core/services/vrf/v2/listener_v2.go | 2 +- core/store/migrate/migrate_test.go | 2 +- core/utils/big.go | 2 +- core/utils/config/validate.go | 2 +- core/utils/mailbox_prom.go | 2 +- core/utils/sleeper_task.go | 2 +- core/utils/utils.go | 2 +- core/web/bridge_types_controller.go | 2 +- core/web/bridge_types_controller_test.go | 2 +- core/web/chains_controller.go | 2 +- core/web/cosmos_chains_controller_test.go | 2 +- core/web/eth_keys_controller.go | 8 +-- core/web/eth_keys_controller_test.go | 2 +- core/web/loader/getters.go | 6 +- core/web/loader/loader_test.go | 22 +++--- core/web/loader/node.go | 2 +- core/web/loop_registry_test.go | 2 +- core/web/nodes_controller.go | 2 +- core/web/presenters/bridges.go | 2 +- core/web/presenters/bridges_test.go | 2 +- core/web/presenters/cosmos_chain.go | 2 +- core/web/presenters/eth_key.go | 20 +++--- core/web/presenters/eth_key_test.go | 6 +- core/web/presenters/evm_chain.go | 2 +- core/web/presenters/job.go | 6 +- core/web/presenters/job_test.go | 2 +- core/web/presenters/solana_chain.go | 2 +- core/web/presenters/starknet_chain.go | 2 +- core/web/resolver/bridge_test.go | 2 +- core/web/resolver/chain.go | 2 +- core/web/resolver/eth_key_test.go | 8 +-- core/web/resolver/helpers.go | 2 +- core/web/resolver/mutation.go | 2 +- core/web/resolver/node.go | 2 +- core/web/resolver/node_test.go | 2 +- core/web/resolver/query.go | 2 +- core/web/resolver/spec_test.go | 10 +-- core/web/solana_chains_controller_test.go | 8 +-- go.mod | 8 +-- go.sum | 16 ++--- .../actions/vrfv2plus/vrfv2plus_steps.go | 12 ++-- integration-tests/go.mod | 8 +-- integration-tests/go.sum | 16 ++--- integration-tests/types/config/node/core.go | 6 +- plugins/cmd/chainlink-median/main.go | 2 +- plugins/cmd/chainlink-medianpoc/main.go | 6 +- plugins/config.go | 2 +- plugins/loop_registry.go | 4 +- plugins/medianpoc/data_source.go | 4 +- plugins/medianpoc/data_source_test.go | 5 +- plugins/medianpoc/plugin.go | 10 +-- plugins/medianpoc/plugin_test.go | 2 +- 241 files changed, 551 insertions(+), 538 deletions(-) diff --git a/common/client/mock_rpc_test.go b/common/client/mock_rpc_test.go index 8f171302a2a..d5e8db82836 100644 --- a/common/client/mock_rpc_test.go +++ b/common/client/mock_rpc_test.go @@ -5,7 +5,7 @@ package client import ( big "math/big" - assets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + assets "github.com/smartcontractkit/chainlink-common/pkg/assets" context "context" diff --git a/common/client/multi_node.go b/common/client/multi_node.go index df91c61a9d8..acab47f0836 100644 --- a/common/client/multi_node.go +++ b/common/client/multi_node.go @@ -11,8 +11,8 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/common/config" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" diff --git a/common/client/multi_node_test.go b/common/client/multi_node_test.go index 3621d6d862d..4c0ebb1db93 100644 --- a/common/client/multi_node_test.go +++ b/common/client/multi_node_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap" - "github.com/smartcontractkit/chainlink-relay/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/v2/common/config" "github.com/smartcontractkit/chainlink/v2/common/types" diff --git a/common/client/node.go b/common/client/node.go index f28a171a558..5faaa5da627 100644 --- a/common/client/node.go +++ b/common/client/node.go @@ -11,7 +11,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/common/client/node_lifecycle_test.go b/common/client/node_lifecycle_test.go index 564c08bbdcc..0dffe935fe0 100644 --- a/common/client/node_lifecycle_test.go +++ b/common/client/node_lifecycle_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/mock" "go.uber.org/zap" - "github.com/smartcontractkit/chainlink-relay/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/common/types/mocks" diff --git a/common/client/send_only_node.go b/common/client/send_only_node.go index fa793a826a6..767fff5aee2 100644 --- a/common/client/send_only_node.go +++ b/common/client/send_only_node.go @@ -6,7 +6,7 @@ import ( "net/url" "sync" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/common/client/send_only_node_test.go b/common/client/send_only_node_test.go index bfe55153656..3034b3f0a11 100644 --- a/common/client/send_only_node_test.go +++ b/common/client/send_only_node_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap" - "github.com/smartcontractkit/chainlink-relay/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/common/client/types.go b/common/client/types.go index ef9f94dafea..6d3a22cee77 100644 --- a/common/client/types.go +++ b/common/client/types.go @@ -4,7 +4,7 @@ import ( "context" "math/big" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/utils" diff --git a/common/headtracker/head_broadcaster.go b/common/headtracker/head_broadcaster.go index e9ae93419bb..3efe64e1c3f 100644 --- a/common/headtracker/head_broadcaster.go +++ b/common/headtracker/head_broadcaster.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/utils" diff --git a/common/headtracker/head_tracker.go b/common/headtracker/head_tracker.go index 54262dd93f7..bf63675128f 100644 --- a/common/headtracker/head_tracker.go +++ b/common/headtracker/head_tracker.go @@ -10,7 +10,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" htrktypes "github.com/smartcontractkit/chainlink/v2/common/headtracker/types" "github.com/smartcontractkit/chainlink/v2/common/types" diff --git a/common/txmgr/broadcaster.go b/common/txmgr/broadcaster.go index 1e3b2fa0a95..ba01fb9e2ad 100644 --- a/common/txmgr/broadcaster.go +++ b/common/txmgr/broadcaster.go @@ -15,8 +15,8 @@ import ( "go.uber.org/multierr" "gopkg.in/guregu/null.v4" - "github.com/smartcontractkit/chainlink-relay/pkg/chains/label" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/chains/label" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/common/client" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" diff --git a/common/txmgr/confirmer.go b/common/txmgr/confirmer.go index 4d3626ffacd..bf356115828 100644 --- a/common/txmgr/confirmer.go +++ b/common/txmgr/confirmer.go @@ -14,8 +14,8 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" "go.uber.org/multierr" - "github.com/smartcontractkit/chainlink-relay/pkg/chains/label" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/chains/label" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/common/client" commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" diff --git a/common/txmgr/resender.go b/common/txmgr/resender.go index 75781c08407..e604a960bf8 100644 --- a/common/txmgr/resender.go +++ b/common/txmgr/resender.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - "github.com/smartcontractkit/chainlink-relay/pkg/chains/label" + "github.com/smartcontractkit/chainlink-common/pkg/chains/label" "github.com/smartcontractkit/chainlink/v2/common/client" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" diff --git a/common/txmgr/txmgr.go b/common/txmgr/txmgr.go index 5b7afd32242..24d2428f61a 100644 --- a/common/txmgr/txmgr.go +++ b/common/txmgr/txmgr.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" diff --git a/core/bridges/bridge_type.go b/core/bridges/bridge_type.go index 9031541f22b..b2e86df4b9f 100644 --- a/core/bridges/bridge_type.go +++ b/core/bridges/bridge_type.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/bridges/bridge_type_test.go b/core/bridges/bridge_type_test.go index c04aba5c2c7..6a719d5b539 100644 --- a/core/bridges/bridge_type_test.go +++ b/core/bridges/bridge_type_test.go @@ -11,7 +11,7 @@ import ( "github.com/ethereum/go-ethereum/common/math" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/store/models" diff --git a/core/chains/chain_kv.go b/core/chains/chain_kv.go index 5094f2885e5..4365a859bb2 100644 --- a/core/chains/chain_kv.go +++ b/core/chains/chain_kv.go @@ -6,7 +6,7 @@ import ( "golang.org/x/exp/maps" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) type ChainsKV[T types.ChainService] struct { diff --git a/core/chains/chain_kv_test.go b/core/chains/chain_kv_test.go index a30de3090b8..205ee693d6f 100644 --- a/core/chains/chain_kv_test.go +++ b/core/chains/chain_kv_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/chains" ) diff --git a/core/chains/evm/assets/assets.go b/core/chains/evm/assets/assets.go index c6c81b5ab48..377e92a855a 100644 --- a/core/chains/evm/assets/assets.go +++ b/core/chains/evm/assets/assets.go @@ -5,8 +5,8 @@ import ( "fmt" "math/big" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" - "github.com/smartcontractkit/chainlink-relay/pkg/utils/bytes" + "github.com/smartcontractkit/chainlink-common/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/utils/bytes" "github.com/smartcontractkit/chainlink/v2/core/utils" "github.com/shopspring/decimal" diff --git a/core/chains/evm/assets/assets_test.go b/core/chains/evm/assets/assets_test.go index 9496554f116..09eb7b6888f 100644 --- a/core/chains/evm/assets/assets_test.go +++ b/core/chains/evm/assets/assets_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" ) @@ -69,7 +69,7 @@ func TestAssets_Eth_UnmarshalJsonError(t *testing.T) { assert.EqualError(t, err, "assets: cannot unmarshal \"x\" into a *assets.Eth") err = json.Unmarshal([]byte(`1`), ð) - assert.Equal(t, relayassets.ErrNoQuotesForCurrency, err) + assert.Equal(t, commonassets.ErrNoQuotesForCurrency, err) } func TestAssets_NewEth(t *testing.T) { diff --git a/core/chains/evm/chain.go b/core/chains/evm/chain.go index f21bf2525a0..1e52bed5cb6 100644 --- a/core/chains/evm/chain.go +++ b/core/chains/evm/chain.go @@ -13,9 +13,9 @@ import ( "github.com/jmoiron/sqlx" - relaychains "github.com/smartcontractkit/chainlink-relay/pkg/chains" - "github.com/smartcontractkit/chainlink-relay/pkg/services" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + common "github.com/smartcontractkit/chainlink-common/pkg/chains" + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/types" commonconfig "github.com/smartcontractkit/chainlink/v2/common/config" "github.com/smartcontractkit/chainlink/v2/core/chains" @@ -422,7 +422,7 @@ func (c *chain) listNodeStatuses(start, end int) ([]types.NodeStatus, int, error nodes := c.cfg.Nodes() total := len(nodes) if start >= total { - return nil, total, relaychains.ErrOutOfRange + return nil, total, common.ErrOutOfRange } if end > total { end = total @@ -459,7 +459,7 @@ func (c *chain) listNodeStatuses(start, end int) ([]types.NodeStatus, int, error } func (c *chain) ListNodeStatuses(ctx context.Context, pageSize int32, pageToken string) (stats []types.NodeStatus, nextPageToken string, total int, err error) { - return relaychains.ListNodeStatuses(int(pageSize), pageToken, c.listNodeStatuses) + return common.ListNodeStatuses(int(pageSize), pageToken, c.listNodeStatuses) } func (c *chain) ID() *big.Int { return c.id } diff --git a/core/chains/evm/client/chain_client.go b/core/chains/evm/client/chain_client.go index 79a91dfc057..0f15b35ee9e 100644 --- a/core/chains/evm/client/chain_client.go +++ b/core/chains/evm/client/chain_client.go @@ -10,7 +10,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rpc" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/common/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" @@ -183,7 +183,7 @@ func (c *chainClient) IsL2() bool { return c.multiNode.IsL2() } -func (c *chainClient) LINKBalance(ctx context.Context, address common.Address, linkAddress common.Address) (*relayassets.Link, error) { +func (c *chainClient) LINKBalance(ctx context.Context, address common.Address, linkAddress common.Address) (*commonassets.Link, error) { return c.multiNode.LINKBalance(ctx, address, linkAddress) } diff --git a/core/chains/evm/client/client.go b/core/chains/evm/client/client.go index 988a7404c9b..5263c74de15 100644 --- a/core/chains/evm/client/client.go +++ b/core/chains/evm/client/client.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/common/config" htrktypes "github.com/smartcontractkit/chainlink/v2/common/headtracker/types" diff --git a/core/chains/evm/client/mocks/client.go b/core/chains/evm/client/mocks/client.go index f1ff5fab456..22498370a2a 100644 --- a/core/chains/evm/client/mocks/client.go +++ b/core/chains/evm/client/mocks/client.go @@ -5,7 +5,7 @@ package mocks import ( big "math/big" - assets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + assets "github.com/smartcontractkit/chainlink-common/pkg/assets" common "github.com/ethereum/go-ethereum/common" diff --git a/core/chains/evm/client/node.go b/core/chains/evm/client/node.go index 80bac25448d..b6907202409 100644 --- a/core/chains/evm/client/node.go +++ b/core/chains/evm/client/node.go @@ -19,7 +19,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/core/chains/evm/client/null_client.go b/core/chains/evm/client/null_client.go index 45876d9259c..e25fed6d964 100644 --- a/core/chains/evm/client/null_client.go +++ b/core/chains/evm/client/null_client.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rpc" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" commonclient "github.com/smartcontractkit/chainlink/v2/common/client" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/core/chains/evm/client/pool.go b/core/chains/evm/client/pool.go index 473ab6d1eb0..18f59b172d7 100644 --- a/core/chains/evm/client/pool.go +++ b/core/chains/evm/client/pool.go @@ -15,7 +15,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/common/config" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" diff --git a/core/chains/evm/client/rpc_client.go b/core/chains/evm/client/rpc_client.go index f952c04d5bb..785acbb2b7d 100644 --- a/core/chains/evm/client/rpc_client.go +++ b/core/chains/evm/client/rpc_client.go @@ -17,7 +17,7 @@ import ( "github.com/google/uuid" "github.com/pkg/errors" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" commonclient "github.com/smartcontractkit/chainlink/v2/common/client" commontypes "github.com/smartcontractkit/chainlink/v2/common/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" @@ -869,12 +869,12 @@ func (r *rpcClient) TokenBalance(ctx context.Context, address common.Address, co } // LINKBalance returns the balance of LINK at the given address -func (r *rpcClient) LINKBalance(ctx context.Context, address common.Address, linkAddress common.Address) (*relayassets.Link, error) { +func (r *rpcClient) LINKBalance(ctx context.Context, address common.Address, linkAddress common.Address) (*commonassets.Link, error) { balance, err := r.TokenBalance(ctx, address, linkAddress) if err != nil { - return relayassets.NewLinkFromJuels(0), err + return commonassets.NewLinkFromJuels(0), err } - return (*relayassets.Link)(balance), nil + return (*commonassets.Link)(balance), nil } func (r *rpcClient) FilterEvents(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) { diff --git a/core/chains/evm/client/send_only_node.go b/core/chains/evm/client/send_only_node.go index 3f2481c1899..beb12dbc4da 100644 --- a/core/chains/evm/client/send_only_node.go +++ b/core/chains/evm/client/send_only_node.go @@ -14,7 +14,7 @@ import ( "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/rpc" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/chains/evm/client/simulated_backend_client.go b/core/chains/evm/client/simulated_backend_client.go index 33ecc3d0d5f..e922715eb9c 100644 --- a/core/chains/evm/client/simulated_backend_client.go +++ b/core/chains/evm/client/simulated_backend_client.go @@ -18,7 +18,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rpc" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" commonclient "github.com/smartcontractkit/chainlink/v2/common/client" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/core/chains/evm/config/chain_scoped.go b/core/chains/evm/config/chain_scoped.go index 6030991179b..804c354e0ef 100644 --- a/core/chains/evm/config/chain_scoped.go +++ b/core/chains/evm/config/chain_scoped.go @@ -9,7 +9,7 @@ import ( ocr "github.com/smartcontractkit/libocr/offchainreporting" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting/types" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" commonconfig "github.com/smartcontractkit/chainlink/v2/common/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" "github.com/smartcontractkit/chainlink/v2/core/config" diff --git a/core/chains/evm/config/config.go b/core/chains/evm/config/config.go index ec90797d7fa..2dd2d4704c3 100644 --- a/core/chains/evm/config/config.go +++ b/core/chains/evm/config/config.go @@ -6,7 +6,7 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" commonconfig "github.com/smartcontractkit/chainlink/v2/common/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/config" @@ -34,7 +34,7 @@ type EVM interface { LogBackfillBatchSize() uint32 LogKeepBlocksDepth() uint32 LogPollInterval() time.Duration - MinContractPayment() *relayassets.Link + MinContractPayment() *commonassets.Link MinIncomingConfirmations() uint32 NonceAutoSync() bool OperatorFactoryAddress() string diff --git a/core/chains/evm/config/toml/config.go b/core/chains/evm/config/toml/config.go index ae0fb41c5ea..26587cd3b0e 100644 --- a/core/chains/evm/config/toml/config.go +++ b/core/chains/evm/config/toml/config.go @@ -12,8 +12,8 @@ import ( "go.uber.org/multierr" "gopkg.in/guregu/null.v4" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" - relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/common/config" "github.com/smartcontractkit/chainlink/v2/core/chains" @@ -107,7 +107,7 @@ func (cs EVMConfigs) totalChains() int { } return total } -func (cs EVMConfigs) Chains(ids ...relay.ChainID) (r []relaytypes.ChainStatus, total int, err error) { +func (cs EVMConfigs) Chains(ids ...relay.ChainID) (r []commontypes.ChainStatus, total int, err error) { total = cs.totalChains() for _, ch := range cs { if ch == nil { @@ -126,7 +126,7 @@ func (cs EVMConfigs) Chains(ids ...relay.ChainID) (r []relaytypes.ChainStatus, t continue } } - ch2 := relaytypes.ChainStatus{ + ch2 := commontypes.ChainStatus{ ID: ch.ChainID.String(), Enabled: ch.IsEnabled(), } @@ -150,7 +150,7 @@ func (cs EVMConfigs) Node(name string) (types.Node, error) { return types.Node{}, fmt.Errorf("node %s: %w", name, chains.ErrNotFound) } -func (cs EVMConfigs) NodeStatus(name string) (relaytypes.NodeStatus, error) { +func (cs EVMConfigs) NodeStatus(name string) (commontypes.NodeStatus, error) { for i := range cs { for _, n := range cs[i].Nodes { if n.Name != nil && *n.Name == name { @@ -158,7 +158,7 @@ func (cs EVMConfigs) NodeStatus(name string) (relaytypes.NodeStatus, error) { } } } - return relaytypes.NodeStatus{}, fmt.Errorf("node %s: %w", name, chains.ErrNotFound) + return commontypes.NodeStatus{}, fmt.Errorf("node %s: %w", name, chains.ErrNotFound) } func legacyNode(n *Node, chainID *utils.Big) (v2 types.Node) { @@ -179,13 +179,13 @@ func legacyNode(n *Node, chainID *utils.Big) (v2 types.Node) { return } -func nodeStatus(n *Node, chainID relay.ChainID) (relaytypes.NodeStatus, error) { - var s relaytypes.NodeStatus +func nodeStatus(n *Node, chainID relay.ChainID) (commontypes.NodeStatus, error) { + var s commontypes.NodeStatus s.ChainID = chainID s.Name = *n.Name b, err := toml.Marshal(n) if err != nil { - return relaytypes.NodeStatus{}, err + return commontypes.NodeStatus{}, err } s.Config = string(b) return s, nil @@ -220,7 +220,7 @@ func (cs EVMConfigs) Nodes(chainID relay.ChainID) (ns []types.Node, err error) { return } -func (cs EVMConfigs) NodeStatuses(chainIDs ...relay.ChainID) (ns []relaytypes.NodeStatus, err error) { +func (cs EVMConfigs) NodeStatuses(chainIDs ...relay.ChainID) (ns []commontypes.NodeStatus, err error) { if len(chainIDs) == 0 { for i := range cs { for _, n := range cs[i].Nodes { @@ -355,7 +355,7 @@ type Chain struct { LogPollInterval *models.Duration LogKeepBlocksDepth *uint32 MinIncomingConfirmations *uint32 - MinContractPayment *relayassets.Link + MinContractPayment *commonassets.Link NonceAutoSync *bool NoNewHeadsThreshold *models.Duration OperatorFactoryAddress *ethkey.EIP55Address diff --git a/core/chains/evm/forwarders/forwarder_manager.go b/core/chains/evm/forwarders/forwarder_manager.go index 934da487fd7..819fb31951e 100644 --- a/core/chains/evm/forwarders/forwarder_manager.go +++ b/core/chains/evm/forwarders/forwarder_manager.go @@ -12,7 +12,7 @@ import ( "github.com/jmoiron/sqlx" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" evmlogpoller "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" diff --git a/core/chains/evm/gas/arbitrum_estimator.go b/core/chains/evm/gas/arbitrum_estimator.go index 860126a5888..c79202c7312 100644 --- a/core/chains/evm/gas/arbitrum_estimator.go +++ b/core/chains/evm/gas/arbitrum_estimator.go @@ -13,7 +13,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" diff --git a/core/chains/evm/gas/block_history_estimator.go b/core/chains/evm/gas/block_history_estimator.go index eb35cd27511..a3f3520b365 100644 --- a/core/chains/evm/gas/block_history_estimator.go +++ b/core/chains/evm/gas/block_history_estimator.go @@ -15,7 +15,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/common/config" commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" diff --git a/core/chains/evm/gas/models.go b/core/chains/evm/gas/models.go index 50cbddcd9bc..b6f34ab87a5 100644 --- a/core/chains/evm/gas/models.go +++ b/core/chains/evm/gas/models.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/common/config" commonfee "github.com/smartcontractkit/chainlink/v2/common/fee" diff --git a/core/chains/evm/gas/rollups/l1_gas_price_oracle.go b/core/chains/evm/gas/rollups/l1_gas_price_oracle.go index 09244e9d319..88c61c49344 100644 --- a/core/chains/evm/gas/rollups/l1_gas_price_oracle.go +++ b/core/chains/evm/gas/rollups/l1_gas_price_oracle.go @@ -12,7 +12,7 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/common/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" diff --git a/core/chains/evm/gas/suggested_price_estimator.go b/core/chains/evm/gas/suggested_price_estimator.go index 24cf20f172e..dadec6210c7 100644 --- a/core/chains/evm/gas/suggested_price_estimator.go +++ b/core/chains/evm/gas/suggested_price_estimator.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" diff --git a/core/chains/evm/headtracker/head_tracker_test.go b/core/chains/evm/headtracker/head_tracker_test.go index 8af344098f8..d734b230e1b 100644 --- a/core/chains/evm/headtracker/head_tracker_test.go +++ b/core/chains/evm/headtracker/head_tracker_test.go @@ -20,7 +20,7 @@ import ( "github.com/jmoiron/sqlx" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" commonmocks "github.com/smartcontractkit/chainlink/v2/common/types/mocks" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" diff --git a/core/chains/evm/log/broadcaster.go b/core/chains/evm/log/broadcaster.go index 9c4050fd796..11c282a4d2e 100644 --- a/core/chains/evm/log/broadcaster.go +++ b/core/chains/evm/log/broadcaster.go @@ -12,7 +12,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" httypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker/types" diff --git a/core/chains/evm/logpoller/log_poller.go b/core/chains/evm/logpoller/log_poller.go index b86ede5dbcb..6676b694b0f 100644 --- a/core/chains/evm/logpoller/log_poller.go +++ b/core/chains/evm/logpoller/log_poller.go @@ -20,7 +20,7 @@ import ( "github.com/pkg/errors" "golang.org/x/exp/maps" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" diff --git a/core/chains/evm/mocks/chain.go b/core/chains/evm/mocks/chain.go index f0f202b0938..3a686887d76 100644 --- a/core/chains/evm/mocks/chain.go +++ b/core/chains/evm/mocks/chain.go @@ -30,7 +30,7 @@ import ( txmgr "github.com/smartcontractkit/chainlink/v2/common/txmgr" - types "github.com/smartcontractkit/chainlink-relay/pkg/types" + types "github.com/smartcontractkit/chainlink-common/pkg/types" ) // Chain is an autogenerated mock type for the Chain type diff --git a/core/chains/evm/monitor/balance.go b/core/chains/evm/monitor/balance.go index 476d3c7019d..b12346ac008 100644 --- a/core/chains/evm/monitor/balance.go +++ b/core/chains/evm/monitor/balance.go @@ -13,7 +13,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" diff --git a/core/chains/evm/types/types.go b/core/chains/evm/types/types.go index 7d756485d00..d0e7292b204 100644 --- a/core/chains/evm/types/types.go +++ b/core/chains/evm/types/types.go @@ -12,7 +12,7 @@ import ( "github.com/pkg/errors" "gopkg.in/guregu/null.v4" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/services/relay" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/cmd/cosmos_node_commands_test.go b/core/cmd/cosmos_node_commands_test.go index 591160629ec..728be9396f9 100644 --- a/core/cmd/cosmos_node_commands_test.go +++ b/core/cmd/cosmos_node_commands_test.go @@ -9,9 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config" + "github.com/smartcontractkit/chainlink-common/pkg/config" coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config" - relaycfg "github.com/smartcontractkit/chainlink-relay/pkg/config" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" @@ -33,14 +32,14 @@ func TestShell_IndexCosmosNodes(t *testing.T) { t.Parallel() chainID := cosmostest.RandomChainID() - node := config.Node{ + node := coscfg.Node{ Name: ptr("second"), - TendermintURL: relaycfg.MustParseURL("http://tender.mint.test/bombay-12"), + TendermintURL: config.MustParseURL("http://tender.mint.test/bombay-12"), } - chain := config.TOMLConfig{ + chain := coscfg.TOMLConfig{ ChainID: ptr(chainID), Enabled: ptr(true), - Nodes: config.Nodes{&node}, + Nodes: coscfg.Nodes{&node}, } app := cosmosStartNewApplication(t, &chain) client, r := app.NewShellAndRenderer() diff --git a/core/cmd/cosmos_transaction_commands_test.go b/core/cmd/cosmos_transaction_commands_test.go index 67b014af2c1..f54ccaf4a68 100644 --- a/core/cmd/cosmos_transaction_commands_test.go +++ b/core/cmd/cosmos_transaction_commands_test.go @@ -13,16 +13,16 @@ import ( "github.com/stretchr/testify/require" "github.com/urfave/cli" + "github.com/smartcontractkit/chainlink-common/pkg/config" cosmosclient "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/client" coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config" cosmosdb "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/db" "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/denom" "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/params" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/cosmostest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" ) @@ -50,7 +50,7 @@ func TestShell_SendCosmosCoins(t *testing.T) { nodes := coscfg.Nodes{ &coscfg.Node{ Name: ptr("random"), - TendermintURL: utils.MustParseURL(url), + TendermintURL: config.MustParseURL(url), }, } chainConfig := coscfg.TOMLConfig{ChainID: &chainID, Enabled: ptr(true), Chain: cosmosChain, Nodes: nodes} diff --git a/core/cmd/eth_keys_commands_test.go b/core/cmd/eth_keys_commands_test.go index d74ae231d72..293a2d3f6da 100644 --- a/core/cmd/eth_keys_commands_test.go +++ b/core/cmd/eth_keys_commands_test.go @@ -12,7 +12,7 @@ import ( "github.com/pkg/errors" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" @@ -35,7 +35,7 @@ func TestEthKeysPresenter_RenderTable(t *testing.T) { var ( address = "0x5431F5F973781809D18643b87B44921b11355d81" ethBalance = assets.NewEth(1) - linkBalance = relayassets.NewLinkFromJuels(2) + linkBalance = commonassets.NewLinkFromJuels(2) isDisabled = true createdAt = time.Now() updatedAt = time.Now().Add(time.Second) @@ -90,7 +90,7 @@ func TestShell_ListETHKeys(t *testing.T) { ethClient := newEthMock(t) ethClient.On("BalanceAt", mock.Anything, mock.Anything, mock.Anything).Return(big.NewInt(42), nil) - ethClient.On("LINKBalance", mock.Anything, mock.Anything, mock.Anything).Return(relayassets.NewLinkFromJuels(13), nil) + ethClient.On("LINKBalance", mock.Anything, mock.Anything, mock.Anything).Return(commonassets.NewLinkFromJuels(13), nil) ethClient.On("PendingNonceAt", mock.Anything, mock.Anything).Return(uint64(0), nil) app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { c.EVM[0].Enabled = ptr(true) @@ -169,7 +169,7 @@ func TestShell_CreateETHKey(t *testing.T) { ethClient := newEthMock(t) ethClient.On("BalanceAt", mock.Anything, mock.Anything, mock.Anything).Return(big.NewInt(42), nil) - ethClient.On("LINKBalance", mock.Anything, mock.Anything, mock.Anything).Return(relayassets.NewLinkFromJuels(42), nil) + ethClient.On("LINKBalance", mock.Anything, mock.Anything, mock.Anything).Return(commonassets.NewLinkFromJuels(42), nil) ethClient.On("PendingNonceAt", mock.Anything, mock.Anything).Return(uint64(0), nil) app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -244,7 +244,7 @@ func TestShell_ImportExportETHKey_NoChains(t *testing.T) { ethClient := newEthMock(t) ethClient.On("BalanceAt", mock.Anything, mock.Anything, mock.Anything).Return(big.NewInt(42), nil) - ethClient.On("LINKBalance", mock.Anything, mock.Anything, mock.Anything).Return(relayassets.NewLinkFromJuels(42), nil) + ethClient.On("LINKBalance", mock.Anything, mock.Anything, mock.Anything).Return(commonassets.NewLinkFromJuels(42), nil) ethClient.On("PendingNonceAt", mock.Anything, mock.Anything).Return(uint64(0), nil) app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { c.EVM[0].Enabled = ptr(true) @@ -362,7 +362,7 @@ func TestShell_ImportExportETHKey_WithChains(t *testing.T) { ethClient.On("Dial", mock.Anything).Maybe() ethClient.On("BalanceAt", mock.Anything, mock.Anything, mock.Anything).Return(big.NewInt(42), nil) - ethClient.On("LINKBalance", mock.Anything, mock.Anything, mock.Anything).Return(relayassets.NewLinkFromJuels(42), nil) + ethClient.On("LINKBalance", mock.Anything, mock.Anything, mock.Anything).Return(commonassets.NewLinkFromJuels(42), nil) set := flag.NewFlagSet("test", 0) cltest.FlagSetApplyFromAction(client.RemoteLogin, set, "") diff --git a/core/cmd/shell.go b/core/cmd/shell.go index 07cd2185dc2..52c90907362 100644 --- a/core/cmd/shell.go +++ b/core/cmd/shell.go @@ -31,7 +31,7 @@ import ( "github.com/jmoiron/sqlx" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink/v2/core/build" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" diff --git a/core/cmd/solana_node_commands_test.go b/core/cmd/solana_node_commands_test.go index 7c88557c6de..316cf16212d 100644 --- a/core/cmd/solana_node_commands_test.go +++ b/core/cmd/solana_node_commands_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/config" solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" "github.com/smartcontractkit/chainlink-solana/pkg/solana" diff --git a/core/cmd/solana_transaction_commands_test.go b/core/cmd/solana_transaction_commands_test.go index cdb182cba41..f019616cb85 100644 --- a/core/cmd/solana_transaction_commands_test.go +++ b/core/cmd/solana_transaction_commands_test.go @@ -15,11 +15,11 @@ import ( "github.com/stretchr/testify/require" "github.com/urfave/cli" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-solana/pkg/solana" solanaClient "github.com/smartcontractkit/chainlink-solana/pkg/solana/client" solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" - "github.com/smartcontractkit/chainlink-solana/pkg/solana" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" ) @@ -29,7 +29,7 @@ func TestShell_SolanaSendSol(t *testing.T) { url := solanaClient.SetupLocalSolNode(t) node := solcfg.Node{ Name: ptr(t.Name()), - URL: utils.MustParseURL(url), + URL: config.MustParseURL(url), } cfg := solana.TOMLConfig{ ChainID: &chainID, diff --git a/core/cmd/starknet_node_commands_test.go b/core/cmd/starknet_node_commands_test.go index 9d7c6fcaf4c..0347cdd18f7 100644 --- a/core/cmd/starknet_node_commands_test.go +++ b/core/cmd/starknet_node_commands_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - relaycfg "github.com/smartcontractkit/chainlink-relay/pkg/config" + commoncfg "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config" "github.com/smartcontractkit/chainlink/v2/core/cmd" @@ -34,11 +34,11 @@ func TestShell_IndexStarkNetNodes(t *testing.T) { id := "starknet chain ID" node1 := config.Node{ Name: ptr("first"), - URL: relaycfg.MustParseURL("https://starknet1.example"), + URL: commoncfg.MustParseURL("https://starknet1.example"), } node2 := config.Node{ Name: ptr("second"), - URL: relaycfg.MustParseURL("https://starknet2.example"), + URL: commoncfg.MustParseURL("https://starknet2.example"), } chain := config.TOMLConfig{ ChainID: &id, diff --git a/core/config/parse/parsers.go b/core/config/parse/parsers.go index e2f6978187c..6243b74dd52 100644 --- a/core/config/parse/parsers.go +++ b/core/config/parse/parsers.go @@ -13,7 +13,7 @@ import ( "github.com/pkg/errors" "go.uber.org/zap/zapcore" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/static" "github.com/smartcontractkit/chainlink/v2/core/utils" @@ -23,10 +23,10 @@ func String(str string) (string, error) { return str, nil } -func Link(str string) (*relayassets.Link, error) { - i, ok := new(relayassets.Link).SetString(str, 10) +func Link(str string) (*commonassets.Link, error) { + i, ok := new(commonassets.Link).SetString(str, 10) if !ok { - return i, fmt.Errorf("unable to parse '%v' into *relayassets.Link(base 10)", str) + return i, fmt.Errorf("unable to parse '%s'", str) } return i, nil } diff --git a/core/internal/cltest/cltest.go b/core/internal/cltest/cltest.go index 83a97833bd1..02aa2de0cc0 100644 --- a/core/internal/cltest/cltest.go +++ b/core/internal/cltest/cltest.go @@ -43,7 +43,7 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting/types" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink/v2/common/client" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" diff --git a/core/internal/testutils/evmtest/evmtest.go b/core/internal/testutils/evmtest/evmtest.go index 80237d218d7..7674650c010 100644 --- a/core/internal/testutils/evmtest/evmtest.go +++ b/core/internal/testutils/evmtest/evmtest.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v4" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" commonmocks "github.com/smartcontractkit/chainlink/v2/common/types/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains" diff --git a/core/logger/logger.go b/core/logger/logger.go index 8e847a99ac0..1feaf0f5d6d 100644 --- a/core/logger/logger.go +++ b/core/logger/logger.go @@ -12,7 +12,7 @@ import ( "go.uber.org/zap/zapcore" "gopkg.in/natefinch/lumberjack.v2" - relaylogger "github.com/smartcontractkit/chainlink-relay/pkg/logger" + common "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/v2/core/static" "github.com/smartcontractkit/chainlink/v2/core/utils" @@ -49,7 +49,7 @@ func init() { } } -var _ relaylogger.Logger = (Logger)(nil) +var _ common.Logger = (Logger)(nil) //go:generate mockery --quiet --name Logger --output . --filename logger_mock_test.go --inpackage --case=underscore //go:generate mockery --quiet --name Logger --output ./mocks/ --case=underscore diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 7bf60aff8b4..1d8ba40b82f 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -303,10 +303,10 @@ require ( github.com/shirou/gopsutil/v3 v3.23.9 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect - github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255 // indirect - github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231115124244-8303409abccd // indirect - github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05 // indirect - github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb // indirect + github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e // indirect + github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542 // indirect + github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231117191230-aa6640f2edd1 // indirect + github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231117204155-b253a2f56664 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 // indirect github.com/smartcontractkit/wsrpc v0.7.2 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 7139f0efa4e..13496adb7a2 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1462,14 +1462,14 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumvbfM1u/etVq42Afwq/jtNSBSOA8n5jntnNPo= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255 h1:Pt6c7bJU9wIN6PQQnmN8UmYYH6lpfiQ6U/B8yEC2s5s= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255/go.mod h1:EHppaccd/LTlTMI2o4dmBHe4BknEgEFFDjDGMNuGb3k= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231115124244-8303409abccd h1:PRVJxNK67pQWufXuB1cxckH/xZkcQFDy8KjN9ZYqong= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231115124244-8303409abccd/go.mod h1:rOayi690YxLlkQy959PD8INhOAIAUi9LoN0G+J/CEf4= -github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05 h1:DaPSVnxe7oz1QJ+AVIhQWs1W3ubQvwvGo9NbHpMs1OQ= -github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05/go.mod h1:o0Pn1pbaUluboaK6/yhf8xf7TiFCkyFl6WUOdwqamuU= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb h1:HiluOfEVGOQTM6BTDImOqYdMZZ7qq7fkZ3TJdmItNr8= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb/go.mod h1:/30flFG4L/iCYAFeA3DUzR0xuHSxAMONiWTzyzvsNwo= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e h1:Fsx5IJDD14wdCAe2lEI1xgztIvzjiE2iVHvYzg/grew= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e/go.mod h1:Hrru9i7n+WEYyW2aIt3/YGPhxLX+HEGWnhk3yVXeDF8= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542 h1:oewYJtdRkJKUHCNDCj5C2LQe6Oq6qy975g931nfG0cc= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542/go.mod h1:EpvRoycRD+kniYlz+pCpRT5e+fmPm0mSD/vmND+0oMg= +github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231117191230-aa6640f2edd1 h1:D7yb4kgNGVAiD5lFYqm/LW8d5jU66TXyYvSskDiW9yg= +github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231117191230-aa6640f2edd1/go.mod h1:UfW7/PZKon+iDEHtrHOfvMnS5GfYOW/SdMZ6P97rPEk= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231117204155-b253a2f56664 h1:yxaHuDTtj2xxtsR8b+LJw8xDvyr6v/F6GP3InsP4wPI= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231117204155-b253a2f56664/go.mod h1:3Fa+HQTZ3R3fPC0hUqugvoo+NEeo8Y4J2WOnQfi7O34= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= diff --git a/core/services/blockhashstore/delegate.go b/core/services/blockhashstore/delegate.go index c8e55e47c3c..1a84323b6f0 100644 --- a/core/services/blockhashstore/delegate.go +++ b/core/services/blockhashstore/delegate.go @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/blockhash_store" v1 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/solidity_vrf_coordinator_interface" diff --git a/core/services/blockheaderfeeder/delegate.go b/core/services/blockheaderfeeder/delegate.go index 971a691d773..3de42d7a9e9 100644 --- a/core/services/blockheaderfeeder/delegate.go +++ b/core/services/blockheaderfeeder/delegate.go @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" "go.uber.org/multierr" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/batch_blockhash_store" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/blockhash_store" diff --git a/core/services/chainlink/application.go b/core/services/chainlink/application.go index 0d479b1f1ab..29679ee92fb 100644 --- a/core/services/chainlink/application.go +++ b/core/services/chainlink/application.go @@ -18,8 +18,8 @@ import ( "github.com/jmoiron/sqlx" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - relayservices "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + commonservices "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/build" @@ -417,7 +417,7 @@ func NewApplication(opts ApplicationOpts) (Application, error) { globalLogger.Debug("Off-chain reporting v2 disabled") } - healthChecker := relayservices.NewChecker() + healthChecker := commonservices.NewChecker() var lbs []utils.DependentAwaiter for _, c := range legacyEVMChains.Slice() { diff --git a/core/services/chainlink/config_test.go b/core/services/chainlink/config_test.go index fbadb379cad..891c0a490fb 100644 --- a/core/services/chainlink/config_test.go +++ b/core/services/chainlink/config_test.go @@ -16,9 +16,9 @@ import ( ocrcommontypes "github.com/smartcontractkit/libocr/commontypes" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" + commoncfg "github.com/smartcontractkit/chainlink-common/pkg/config" coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" - relaycfg "github.com/smartcontractkit/chainlink-relay/pkg/config" "github.com/smartcontractkit/chainlink-solana/pkg/solana" solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" stkcfg "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config" @@ -145,7 +145,7 @@ var ( MaxMsgsPerBatch: ptr[int64](13), }, Nodes: []*coscfg.Node{ - {Name: ptr("primary"), TendermintURL: relaycfg.MustParseURL("http://columbus.cosmos.com")}, + {Name: ptr("primary"), TendermintURL: commoncfg.MustParseURL("http://columbus.cosmos.com")}, }}, { ChainID: ptr("Malaga-420"), @@ -153,7 +153,7 @@ var ( BlocksUntilTxTimeout: ptr[int64](20), }, Nodes: []*coscfg.Node{ - {Name: ptr("secondary"), TendermintURL: relaycfg.MustParseURL("http://bombay.cosmos.com")}, + {Name: ptr("secondary"), TendermintURL: commoncfg.MustParseURL("http://bombay.cosmos.com")}, }}, }, Solana: []*solana.TOMLConfig{ @@ -163,16 +163,16 @@ var ( MaxRetries: ptr[int64](12), }, Nodes: []*solcfg.Node{ - {Name: ptr("primary"), URL: relaycfg.MustParseURL("http://mainnet.solana.com")}, + {Name: ptr("primary"), URL: commoncfg.MustParseURL("http://mainnet.solana.com")}, }, }, { ChainID: ptr("testnet"), Chain: solcfg.Chain{ - OCR2CachePollPeriod: relaycfg.MustNewDuration(time.Minute), + OCR2CachePollPeriod: commoncfg.MustNewDuration(time.Minute), }, Nodes: []*solcfg.Node{ - {Name: ptr("secondary"), URL: relaycfg.MustParseURL("http://testnet.solana.com")}, + {Name: ptr("secondary"), URL: commoncfg.MustParseURL("http://testnet.solana.com")}, }, }, }, @@ -180,10 +180,10 @@ var ( { ChainID: ptr("foobar"), Chain: stkcfg.Chain{ - ConfirmationPoll: relaycfg.MustNewDuration(time.Hour), + ConfirmationPoll: commoncfg.MustNewDuration(time.Hour), }, Nodes: []*stkcfg.Node{ - {Name: ptr("primary"), URL: relaycfg.MustParseURL("http://stark.node")}, + {Name: ptr("primary"), URL: commoncfg.MustParseURL("http://stark.node")}, }, }, }, @@ -538,7 +538,7 @@ func TestConfig_Marshal(t *testing.T) { LogBackfillBatchSize: ptr[uint32](17), LogPollInterval: &minute, LogKeepBlocksDepth: ptr[uint32](100000), - MinContractPayment: relayassets.NewLinkFromJuels(math.MaxInt64), + MinContractPayment: commonassets.NewLinkFromJuels(math.MaxInt64), MinIncomingConfirmations: ptr[uint32](13), NonceAutoSync: ptr(true), NoNewHeadsThreshold: &minute, @@ -603,13 +603,13 @@ func TestConfig_Marshal(t *testing.T) { ChainID: ptr("mainnet"), Enabled: ptr(false), Chain: solcfg.Chain{ - BalancePollPeriod: relaycfg.MustNewDuration(time.Minute), - ConfirmPollPeriod: relaycfg.MustNewDuration(time.Second), - OCR2CachePollPeriod: relaycfg.MustNewDuration(time.Minute), - OCR2CacheTTL: relaycfg.MustNewDuration(time.Hour), - TxTimeout: relaycfg.MustNewDuration(time.Hour), - TxRetryTimeout: relaycfg.MustNewDuration(time.Minute), - TxConfirmTimeout: relaycfg.MustNewDuration(time.Second), + BalancePollPeriod: commoncfg.MustNewDuration(time.Minute), + ConfirmPollPeriod: commoncfg.MustNewDuration(time.Second), + OCR2CachePollPeriod: commoncfg.MustNewDuration(time.Minute), + OCR2CacheTTL: commoncfg.MustNewDuration(time.Hour), + TxTimeout: commoncfg.MustNewDuration(time.Hour), + TxRetryTimeout: commoncfg.MustNewDuration(time.Minute), + TxConfirmTimeout: commoncfg.MustNewDuration(time.Second), SkipPreflight: ptr(true), Commitment: ptr("banana"), MaxRetries: ptr[int64](7), @@ -617,12 +617,12 @@ func TestConfig_Marshal(t *testing.T) { ComputeUnitPriceMax: ptr[uint64](1000), ComputeUnitPriceMin: ptr[uint64](10), ComputeUnitPriceDefault: ptr[uint64](100), - FeeBumpPeriod: relaycfg.MustNewDuration(time.Minute), + FeeBumpPeriod: commoncfg.MustNewDuration(time.Minute), }, Nodes: []*solcfg.Node{ - {Name: ptr("primary"), URL: relaycfg.MustParseURL("http://solana.web")}, - {Name: ptr("foo"), URL: relaycfg.MustParseURL("http://solana.foo")}, - {Name: ptr("bar"), URL: relaycfg.MustParseURL("http://solana.bar")}, + {Name: ptr("primary"), URL: commoncfg.MustParseURL("http://solana.web")}, + {Name: ptr("foo"), URL: commoncfg.MustParseURL("http://solana.foo")}, + {Name: ptr("bar"), URL: commoncfg.MustParseURL("http://solana.bar")}, }, }, } @@ -631,14 +631,14 @@ func TestConfig_Marshal(t *testing.T) { ChainID: ptr("foobar"), Enabled: ptr(true), Chain: stkcfg.Chain{ - OCR2CachePollPeriod: relaycfg.MustNewDuration(6 * time.Hour), - OCR2CacheTTL: relaycfg.MustNewDuration(3 * time.Minute), - RequestTimeout: relaycfg.MustNewDuration(time.Minute + 3*time.Second), - TxTimeout: relaycfg.MustNewDuration(13 * time.Second), - ConfirmationPoll: relaycfg.MustNewDuration(42 * time.Second), + OCR2CachePollPeriod: commoncfg.MustNewDuration(6 * time.Hour), + OCR2CacheTTL: commoncfg.MustNewDuration(3 * time.Minute), + RequestTimeout: commoncfg.MustNewDuration(time.Minute + 3*time.Second), + TxTimeout: commoncfg.MustNewDuration(13 * time.Second), + ConfirmationPoll: commoncfg.MustNewDuration(42 * time.Second), }, Nodes: []*stkcfg.Node{ - {Name: ptr("primary"), URL: relaycfg.MustParseURL("http://stark.node")}, + {Name: ptr("primary"), URL: commoncfg.MustParseURL("http://stark.node")}, }, }, } @@ -648,21 +648,21 @@ func TestConfig_Marshal(t *testing.T) { Enabled: ptr(true), Chain: coscfg.Chain{ Bech32Prefix: ptr("wasm"), - BlockRate: relaycfg.MustNewDuration(time.Minute), + BlockRate: commoncfg.MustNewDuration(time.Minute), BlocksUntilTxTimeout: ptr[int64](12), - ConfirmPollPeriod: relaycfg.MustNewDuration(time.Second), + ConfirmPollPeriod: commoncfg.MustNewDuration(time.Second), FallbackGasPrice: mustDecimal("0.001"), GasToken: ptr("ucosm"), GasLimitMultiplier: mustDecimal("1.2"), MaxMsgsPerBatch: ptr[int64](17), - OCR2CachePollPeriod: relaycfg.MustNewDuration(time.Minute), - OCR2CacheTTL: relaycfg.MustNewDuration(time.Hour), - TxMsgTimeout: relaycfg.MustNewDuration(time.Second), + OCR2CachePollPeriod: commoncfg.MustNewDuration(time.Minute), + OCR2CacheTTL: commoncfg.MustNewDuration(time.Hour), + TxMsgTimeout: commoncfg.MustNewDuration(time.Second), }, Nodes: []*coscfg.Node{ - {Name: ptr("primary"), TendermintURL: relaycfg.MustParseURL("http://tender.mint")}, - {Name: ptr("foo"), TendermintURL: relaycfg.MustParseURL("http://foo.url")}, - {Name: ptr("bar"), TendermintURL: relaycfg.MustParseURL("http://bar.web")}, + {Name: ptr("primary"), TendermintURL: commoncfg.MustParseURL("http://tender.mint")}, + {Name: ptr("foo"), TendermintURL: commoncfg.MustParseURL("http://foo.url")}, + {Name: ptr("bar"), TendermintURL: commoncfg.MustParseURL("http://bar.web")}, }, }, } diff --git a/core/services/chainlink/mocks/relayer_chain_interoperators.go b/core/services/chainlink/mocks/relayer_chain_interoperators.go index 81f112f7663..f778f61b0cb 100644 --- a/core/services/chainlink/mocks/relayer_chain_interoperators.go +++ b/core/services/chainlink/mocks/relayer_chain_interoperators.go @@ -9,11 +9,11 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/chains/evm" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink/v2/core/services/relay" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) // FakeRelayerChainInteroperators is a fake chainlink.RelayerChainInteroperators. diff --git a/core/services/chainlink/relayer_chain_interoperators.go b/core/services/chainlink/relayer_chain_interoperators.go index 1183277ac0b..3be1395694d 100644 --- a/core/services/chainlink/relayer_chain_interoperators.go +++ b/core/services/chainlink/relayer_chain_interoperators.go @@ -7,10 +7,10 @@ import ( "sort" "sync" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos" "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/adapters" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/chains" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" diff --git a/core/services/chainlink/relayer_chain_interoperators_test.go b/core/services/chainlink/relayer_chain_interoperators_test.go index 293cc298c8d..da1246c7bfe 100644 --- a/core/services/chainlink/relayer_chain_interoperators_test.go +++ b/core/services/chainlink/relayer_chain_interoperators_test.go @@ -9,9 +9,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + commoncfg "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/loop" coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config" - relaycfg "github.com/smartcontractkit/chainlink-relay/pkg/config" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" stkcfg "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config" @@ -84,7 +84,7 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { Chain: solcfg.Chain{}, Nodes: []*solcfg.Node{{ Name: ptr("solana chain 1 node 1"), - URL: ((*relaycfg.URL)(models.MustParseURL("http://localhost:8547").URL())), + URL: ((*commoncfg.URL)(models.MustParseURL("http://localhost:8547").URL())), }}, }, &solana.TOMLConfig{ @@ -93,7 +93,7 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { Chain: solcfg.Chain{}, Nodes: []*solcfg.Node{{ Name: ptr("solana chain 2 node 1"), - URL: ((*relaycfg.URL)(models.MustParseURL("http://localhost:8527").URL())), + URL: ((*commoncfg.URL)(models.MustParseURL("http://localhost:8527").URL())), }}, }, } @@ -106,15 +106,15 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { Nodes: []*stkcfg.Node{ { Name: ptr("starknet chain 1 node 1"), - URL: ((*relaycfg.URL)(models.MustParseURL("http://localhost:8547").URL())), + URL: ((*commoncfg.URL)(models.MustParseURL("http://localhost:8547").URL())), }, { Name: ptr("starknet chain 1 node 2"), - URL: ((*relaycfg.URL)(models.MustParseURL("http://localhost:8548").URL())), + URL: ((*commoncfg.URL)(models.MustParseURL("http://localhost:8548").URL())), }, { Name: ptr("starknet chain 1 node 3"), - URL: ((*relaycfg.URL)(models.MustParseURL("http://localhost:8549").URL())), + URL: ((*commoncfg.URL)(models.MustParseURL("http://localhost:8549").URL())), }, }, }, @@ -125,7 +125,7 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { Nodes: []*stkcfg.Node{ { Name: ptr("starknet chain 2 node 1"), - URL: ((*relaycfg.URL)(models.MustParseURL("http://localhost:3547").URL())), + URL: ((*commoncfg.URL)(models.MustParseURL("http://localhost:3547").URL())), }, }, }, @@ -143,7 +143,7 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { Nodes: coscfg.Nodes{ &coscfg.Node{ Name: ptr("cosmos chain 1 node 1"), - TendermintURL: (*relaycfg.URL)(models.MustParseURL("http://localhost:9548").URL()), + TendermintURL: (*commoncfg.URL)(models.MustParseURL("http://localhost:9548").URL()), }, }, }, @@ -158,7 +158,7 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { Nodes: coscfg.Nodes{ &coscfg.Node{ Name: ptr("cosmos chain 2 node 1"), - TendermintURL: (*relaycfg.URL)(models.MustParseURL("http://localhost:9598").URL()), + TendermintURL: (*commoncfg.URL)(models.MustParseURL("http://localhost:9598").URL()), }, }, }, diff --git a/core/services/chainlink/relayer_factory.go b/core/services/chainlink/relayer_factory.go index 4bbabea4c82..6376839c700 100644 --- a/core/services/chainlink/relayer_factory.go +++ b/core/services/chainlink/relayer_factory.go @@ -9,9 +9,9 @@ import ( "github.com/jmoiron/sqlx" + "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos" coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" "github.com/smartcontractkit/chainlink-solana/pkg/solana" pkgsolana "github.com/smartcontractkit/chainlink-solana/pkg/solana" pkgstarknet "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink" diff --git a/core/services/directrequest/delegate.go b/core/services/directrequest/delegate.go index 10943308b39..9da84fd3ee5 100644 --- a/core/services/directrequest/delegate.go +++ b/core/services/directrequest/delegate.go @@ -9,8 +9,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log" diff --git a/core/services/directrequest/delegate_test.go b/core/services/directrequest/delegate_test.go index 1c7929d94d3..56c28e57458 100644 --- a/core/services/directrequest/delegate_test.go +++ b/core/services/directrequest/delegate_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log" log_mocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log/mocks" diff --git a/core/services/directrequest/validate.go b/core/services/directrequest/validate.go index cdb478e8aae..bc31f09b685 100644 --- a/core/services/directrequest/validate.go +++ b/core/services/directrequest/validate.go @@ -4,7 +4,7 @@ import ( "github.com/pelletier/go-toml" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/null" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" diff --git a/core/services/feeds/service.go b/core/services/feeds/service.go index f6e8952d6b1..da19a33abc8 100644 --- a/core/services/feeds/service.go +++ b/core/services/feeds/service.go @@ -17,7 +17,7 @@ import ( "github.com/jmoiron/sqlx" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/core/services/fluxmonitorv2/config.go b/core/services/fluxmonitorv2/config.go index 0360e9ce03a..2680f30a777 100644 --- a/core/services/fluxmonitorv2/config.go +++ b/core/services/fluxmonitorv2/config.go @@ -3,7 +3,7 @@ package fluxmonitorv2 import ( "time" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/store/models" ) diff --git a/core/services/fluxmonitorv2/flux_monitor.go b/core/services/fluxmonitorv2/flux_monitor.go index 5dbeaeafc31..ea853d879d4 100644 --- a/core/services/fluxmonitorv2/flux_monitor.go +++ b/core/services/fluxmonitorv2/flux_monitor.go @@ -15,7 +15,7 @@ import ( "github.com/jmoiron/sqlx" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/bridges" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" diff --git a/core/services/fluxmonitorv2/flux_monitor_test.go b/core/services/fluxmonitorv2/flux_monitor_test.go index e8bbf739bbb..1a14fb8bd0a 100644 --- a/core/services/fluxmonitorv2/flux_monitor_test.go +++ b/core/services/fluxmonitorv2/flux_monitor_test.go @@ -20,7 +20,7 @@ import ( "github.com/jmoiron/sqlx" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log" logmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log/mocks" diff --git a/core/services/fluxmonitorv2/payment_checker.go b/core/services/fluxmonitorv2/payment_checker.go index b5dbd73c064..e4cc40c96a3 100644 --- a/core/services/fluxmonitorv2/payment_checker.go +++ b/core/services/fluxmonitorv2/payment_checker.go @@ -3,7 +3,7 @@ package fluxmonitorv2 import ( "math/big" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" ) // MinFundedRounds defines the minimum number of rounds that needs to be paid diff --git a/core/services/fluxmonitorv2/payment_checker_test.go b/core/services/fluxmonitorv2/payment_checker_test.go index 48a06553cb9..baec5642339 100644 --- a/core/services/fluxmonitorv2/payment_checker_test.go +++ b/core/services/fluxmonitorv2/payment_checker_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2" ) diff --git a/core/services/fluxmonitorv2/validate_test.go b/core/services/fluxmonitorv2/validate_test.go index b397e6d3749..94dc8b6b709 100644 --- a/core/services/fluxmonitorv2/validate_test.go +++ b/core/services/fluxmonitorv2/validate_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/v2/core/utils/tomlutils" diff --git a/core/services/functions/connector_handler.go b/core/services/functions/connector_handler.go index 5b67e333d2b..343980afdd5 100644 --- a/core/services/functions/connector_handler.go +++ b/core/services/functions/connector_handler.go @@ -10,8 +10,8 @@ import ( ethCommon "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/api" diff --git a/core/services/functions/connector_handler_test.go b/core/services/functions/connector_handler_test.go index 1bf9f8e5938..82c3dab3afc 100644 --- a/core/services/functions/connector_handler_test.go +++ b/core/services/functions/connector_handler_test.go @@ -7,7 +7,7 @@ import ( "math/big" "testing" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/functions" diff --git a/core/services/functions/listener.go b/core/services/functions/listener.go index efb40330cb4..3a308431807 100644 --- a/core/services/functions/listener.go +++ b/core/services/functions/listener.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/libocr/commontypes" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/cbor" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/core/services/gateway/connectionmanager.go b/core/services/gateway/connectionmanager.go index 278c4beaaae..ce4a54f4c2b 100644 --- a/core/services/gateway/connectionmanager.go +++ b/core/services/gateway/connectionmanager.go @@ -15,7 +15,7 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" "go.uber.org/multierr" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/api" diff --git a/core/services/gateway/connector/connector.go b/core/services/gateway/connector/connector.go index 55786819448..0694e9ad15f 100644 --- a/core/services/gateway/connector/connector.go +++ b/core/services/gateway/connector/connector.go @@ -10,7 +10,7 @@ import ( "github.com/gorilla/websocket" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/api" diff --git a/core/services/gateway/gateway.go b/core/services/gateway/gateway.go index 42e03107f3e..79ddf0a5c69 100644 --- a/core/services/gateway/gateway.go +++ b/core/services/gateway/gateway.go @@ -13,7 +13,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/api" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/config" diff --git a/core/services/gateway/handlers/functions/allowlist.go b/core/services/gateway/handlers/functions/allowlist.go index 914a933eb15..3ba9a65d57a 100644 --- a/core/services/gateway/handlers/functions/allowlist.go +++ b/core/services/gateway/handlers/functions/allowlist.go @@ -13,7 +13,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/functions/generated/functions_allow_list" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/functions/generated/functions_router" diff --git a/core/services/gateway/handlers/functions/handler.functions.go b/core/services/gateway/handlers/functions/handler.functions.go index a4301ef7e9c..32a132c075f 100644 --- a/core/services/gateway/handlers/functions/handler.functions.go +++ b/core/services/gateway/handlers/functions/handler.functions.go @@ -13,8 +13,8 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" "go.uber.org/multierr" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/api" diff --git a/core/services/gateway/handlers/functions/handler.functions_test.go b/core/services/gateway/handlers/functions/handler.functions_test.go index 4c8ba5bec3c..00334d30682 100644 --- a/core/services/gateway/handlers/functions/handler.functions_test.go +++ b/core/services/gateway/handlers/functions/handler.functions_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/api" diff --git a/core/services/gateway/handlers/functions/subscriptions.go b/core/services/gateway/handlers/functions/subscriptions.go index c7a6519e693..7a59e05731e 100644 --- a/core/services/gateway/handlers/functions/subscriptions.go +++ b/core/services/gateway/handlers/functions/subscriptions.go @@ -11,7 +11,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/functions/generated/functions_router" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/core/services/gateway/network/httpserver.go b/core/services/gateway/network/httpserver.go index 3cae8dc2763..d4340a92e98 100644 --- a/core/services/gateway/network/httpserver.go +++ b/core/services/gateway/network/httpserver.go @@ -8,7 +8,7 @@ import ( "net/http" "time" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" ) diff --git a/core/services/gateway/network/wsconnection.go b/core/services/gateway/network/wsconnection.go index 9215d183d18..813b644282f 100644 --- a/core/services/gateway/network/wsconnection.go +++ b/core/services/gateway/network/wsconnection.go @@ -5,7 +5,7 @@ import ( "errors" "sync/atomic" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/gorilla/websocket" diff --git a/core/services/gateway/network/wsserver.go b/core/services/gateway/network/wsserver.go index 86812a313eb..58b2dfe663c 100644 --- a/core/services/gateway/network/wsserver.go +++ b/core/services/gateway/network/wsserver.go @@ -10,7 +10,7 @@ import ( "github.com/gorilla/websocket" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" ) diff --git a/core/services/health.go b/core/services/health.go index 568823fa324..32e97fd8db3 100644 --- a/core/services/health.go +++ b/core/services/health.go @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" ) diff --git a/core/services/job/job_orm_test.go b/core/services/job/job_orm_test.go index c2fc425918a..87ee15873d5 100644 --- a/core/services/job/job_orm_test.go +++ b/core/services/job/job_orm_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v4" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" diff --git a/core/services/job/models.go b/core/services/job/models.go index 0b3e622f59b..05dcab831f1 100644 --- a/core/services/job/models.go +++ b/core/services/job/models.go @@ -14,8 +14,8 @@ import ( "github.com/pkg/errors" "gopkg.in/guregu/null.v4" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" @@ -434,7 +434,7 @@ type DirectRequestSpec struct { ContractAddress ethkey.EIP55Address `toml:"contractAddress"` MinIncomingConfirmations clnull.Uint32 `toml:"minIncomingConfirmations"` Requesters models.AddressCollection `toml:"requesters"` - MinContractPayment *relayassets.Link `toml:"minContractPaymentLinkJuels"` + MinContractPayment *commonassets.Link `toml:"minContractPaymentLinkJuels"` EVMChainID *utils.Big `toml:"evmChainID"` CreatedAt time.Time `toml:"-"` UpdatedAt time.Time `toml:"-"` @@ -475,7 +475,7 @@ type FluxMonitorSpec struct { DrumbeatSchedule string DrumbeatRandomDelay time.Duration DrumbeatEnabled bool - MinPayment *relayassets.Link + MinPayment *commonassets.Link EVMChainID *utils.Big `toml:"evmChainID"` CreatedAt time.Time `toml:"-"` UpdatedAt time.Time `toml:"-"` diff --git a/core/services/job/orm.go b/core/services/job/orm.go index fb897bc9281..ba102c6bb8b 100644 --- a/core/services/job/orm.go +++ b/core/services/job/orm.go @@ -18,7 +18,7 @@ import ( "github.com/jmoiron/sqlx" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/bridges" evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" diff --git a/core/services/job/spawner.go b/core/services/job/spawner.go index 03ee8cee13a..5656011e14d 100644 --- a/core/services/job/spawner.go +++ b/core/services/job/spawner.go @@ -11,7 +11,7 @@ import ( "github.com/jmoiron/sqlx" - relayservices "github.com/smartcontractkit/chainlink-relay/pkg/services" + commonservices "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services" @@ -43,7 +43,7 @@ type ( } spawner struct { - relayservices.StateMachine + commonservices.StateMachine orm ORM config Config checker services.Checker @@ -170,7 +170,7 @@ func (js *spawner) stopService(jobID int32) { for i := len(aj.services) - 1; i >= 0; i-- { service := aj.services[i] sLggr := lggr.With("subservice", i, "serviceType", reflect.TypeOf(service)) - if c, ok := service.(relayservices.HealthReporter); ok { + if c, ok := service.(commonservices.HealthReporter); ok { if err := js.checker.Unregister(c.Name()); err != nil { sLggr.Warnw("Failed to unregister service from health checker", "err", err) } @@ -230,7 +230,7 @@ func (js *spawner) StartService(ctx context.Context, jb Job, qopts ...pg.QOpt) e lggr.Criticalw("Error starting service for job", "err", err) return err } - if c, ok := srv.(relayservices.HealthReporter); ok { + if c, ok := srv.(commonservices.HealthReporter); ok { err = js.checker.Register(c) if err != nil { lggr.Errorw("Error registering service with health checker", "err", err) diff --git a/core/services/job/spawner_test.go b/core/services/job/spawner_test.go index cfe646d8660..0ad76491438 100644 --- a/core/services/job/spawner_test.go +++ b/core/services/job/spawner_test.go @@ -11,8 +11,8 @@ import ( "github.com/jmoiron/sqlx" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/bridges" mocklp "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" diff --git a/core/services/keeper/registry_synchronizer_core.go b/core/services/keeper/registry_synchronizer_core.go index 761958ce194..db7cca1763f 100644 --- a/core/services/keeper/registry_synchronizer_core.go +++ b/core/services/keeper/registry_synchronizer_core.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" diff --git a/core/services/keeper/upkeep_executer.go b/core/services/keeper/upkeep_executer.go index 30e9f363579..ece6f85b068 100644 --- a/core/services/keeper/upkeep_executer.go +++ b/core/services/keeper/upkeep_executer.go @@ -12,7 +12,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" diff --git a/core/services/keystore/cosmos.go b/core/services/keystore/cosmos.go index c06dfcdbcea..e3549fdb932 100644 --- a/core/services/keystore/cosmos.go +++ b/core/services/keystore/cosmos.go @@ -6,7 +6,7 @@ import ( "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" ) @@ -147,7 +147,7 @@ func (ks *cosmos) getByID(id string) (cosmoskey.Key, error) { return key, nil } -// CosmosLoopKeystore implements the [github.com/smartcontractkit/chainlink-relay/pkg/loop.Keystore] interface and +// CosmosLoopKeystore implements the [github.com/smartcontractkit/chainlink-common/pkg/loop.Keystore] interface and // handles signing for Cosmos messages. type CosmosLoopKeystore struct { Cosmos diff --git a/core/services/keystore/keys/ethkey/address.go b/core/services/keystore/keys/ethkey/address.go index c14b602c597..1b26413f634 100644 --- a/core/services/keystore/keys/ethkey/address.go +++ b/core/services/keystore/keys/ethkey/address.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/chainlink-relay/pkg/utils/bytes" + "github.com/smartcontractkit/chainlink-common/pkg/utils/bytes" ) // EIP55Address is a new type for string which persists an ethereum address in diff --git a/core/services/keystore/starknet.go b/core/services/keystore/starknet.go index 7bf454004d0..251c74d0e00 100644 --- a/core/services/keystore/starknet.go +++ b/core/services/keystore/starknet.go @@ -9,8 +9,8 @@ import ( "github.com/smartcontractkit/caigo" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - adapters "github.com/smartcontractkit/chainlink-relay/pkg/loop/adapters/starknet" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + adapters "github.com/smartcontractkit/chainlink-common/pkg/loop/adapters/starknet" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" ) @@ -155,7 +155,7 @@ func (ks *starknet) getByID(id string) (starkkey.Key, error) { return key, nil } -// StarknetLooppSigner implements [github.com/smartcontractkit/chainlink-relay/pkg/loop.Keystore] interface and the requirements +// StarknetLooppSigner implements [github.com/smartcontractkit/chainlink-common/pkg/loop.Keystore] interface and the requirements // of signature d/encoding of the [github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/txm.NewKeystoreAdapter] type StarknetLooppSigner struct { StarkNet @@ -165,7 +165,7 @@ var _ loop.Keystore = &StarknetLooppSigner{} // Sign implements [loop.Keystore] // hash is expected to be the byte representation of big.Int -// the returned []byte is an encoded [github.com/smartcontractkit/chainlink-relay/pkg/loop/adapters/starknet.Signature]. +// the returned []byte is an encoded [github.com/smartcontractkit/chainlink-common/pkg/loop/adapters/starknet.Signature]. // this enables compatibility with [github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/txm.NewKeystoreAdapter] func (lk *StarknetLooppSigner) Sign(ctx context.Context, id string, hash []byte) ([]byte, error) { diff --git a/core/services/mocks/checker.go b/core/services/mocks/checker.go index 354812d0212..e0c209d8afb 100644 --- a/core/services/mocks/checker.go +++ b/core/services/mocks/checker.go @@ -3,7 +3,7 @@ package mocks import ( - pkgservices "github.com/smartcontractkit/chainlink-relay/pkg/services" + pkgservices "github.com/smartcontractkit/chainlink-common/pkg/services" mock "github.com/stretchr/testify/mock" ) diff --git a/core/services/multi.go b/core/services/multi.go index 4ea263f5a30..1e465d5e724 100644 --- a/core/services/multi.go +++ b/core/services/multi.go @@ -3,7 +3,7 @@ package services import ( "io" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" ) // StartClose is a subset of the ServiceCtx interface. diff --git a/core/services/nurse.go b/core/services/nurse.go index e414ca280e7..3d896a80ff3 100644 --- a/core/services/nurse.go +++ b/core/services/nurse.go @@ -17,7 +17,7 @@ import ( "github.com/google/pprof/profile" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/v2/core/utils" diff --git a/core/services/ocr/config_overrider.go b/core/services/ocr/config_overrider.go index 5b2ac20c00c..b1acf9a7d73 100644 --- a/core/services/ocr/config_overrider.go +++ b/core/services/ocr/config_overrider.go @@ -12,7 +12,7 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/utils" diff --git a/core/services/ocr/contract_tracker.go b/core/services/ocr/contract_tracker.go index 3e614fef4ae..5fecbe86288 100644 --- a/core/services/ocr/contract_tracker.go +++ b/core/services/ocr/contract_tracker.go @@ -20,7 +20,7 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting/confighelper" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/common/config" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" diff --git a/core/services/ocr/delegate.go b/core/services/ocr/delegate.go index 0559469abb4..c8de3ec33c4 100644 --- a/core/services/ocr/delegate.go +++ b/core/services/ocr/delegate.go @@ -11,7 +11,7 @@ import ( "github.com/jmoiron/sqlx" - relaylogger "github.com/smartcontractkit/chainlink-relay/pkg/logger" + commonlogger "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/libocr/gethwrappers/offchainaggregator" ocrnetworking "github.com/smartcontractkit/libocr/networking" @@ -167,7 +167,7 @@ func (d *Delegate) ServicesForSpec(jb job.Job) (services []job.ServiceCtx, err e v2Bootstrappers = peerWrapper.P2PConfig().V2().DefaultBootstrappers() } - ocrLogger := relaylogger.NewOCRWrapper(lggr, chain.Config().OCR().TraceLogging(), func(msg string) { + ocrLogger := commonlogger.NewOCRWrapper(lggr, chain.Config().OCR().TraceLogging(), func(msg string) { d.jobORM.TryRecordError(jb.ID, msg) }) diff --git a/core/services/ocr2/delegate.go b/core/services/ocr2/delegate.go index 944c04c8d44..4b5932cd703 100644 --- a/core/services/ocr2/delegate.go +++ b/core/services/ocr2/delegate.go @@ -15,6 +15,7 @@ import ( "github.com/pkg/errors" "github.com/jmoiron/sqlx" + "github.com/smartcontractkit/libocr/commontypes" libocr2 "github.com/smartcontractkit/libocr/offchainreporting2plus" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" @@ -29,10 +30,10 @@ import ( dkgpkg "github.com/smartcontractkit/ocr2vrf/dkg" "github.com/smartcontractkit/ocr2vrf/ocr2vrf" - relaylogger "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/reportingplugins" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + commonlogger "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop/reportingplugins" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" @@ -387,7 +388,7 @@ func (d *Delegate) ServicesForSpec(jb job.Job) ([]job.ServiceCtx, error) { return nil, errors.New("peerWrapper is not started. OCR2 jobs require a started and running p2p v2 peer") } - ocrLogger := relaylogger.NewOCRWrapper(lggr, d.cfg.OCR2().TraceLogging(), func(msg string) { + ocrLogger := commonlogger.NewOCRWrapper(lggr, d.cfg.OCR2().TraceLogging(), func(msg string) { lggr.ErrorIf(d.jobORM.RecordError(jb.ID, msg), "unable to record error") }) @@ -958,11 +959,11 @@ func (d *Delegate) newServicesOCR2VRF( "jobName", jb.Name.ValueOrZero(), "jobID", jb.ID, ) - vrfLogger := relaylogger.NewOCRWrapper(l.With( + vrfLogger := commonlogger.NewOCRWrapper(l.With( "vrfContractID", spec.ContractID), d.cfg.OCR2().TraceLogging(), func(msg string) { lggr.ErrorIf(d.jobORM.RecordError(jb.ID, msg), "unable to record error") }) - dkgLogger := relaylogger.NewOCRWrapper(l.With( + dkgLogger := commonlogger.NewOCRWrapper(l.With( "dkgContractID", cfg.DKGContractAddress), d.cfg.OCR2().TraceLogging(), func(msg string) { lggr.ErrorIf(d.jobORM.RecordError(jb.ID, msg), "unable to record error") }) diff --git a/core/services/ocr2/delegate_test.go b/core/services/ocr2/delegate_test.go index daffac3f96b..b55e128119d 100644 --- a/core/services/ocr2/delegate_test.go +++ b/core/services/ocr2/delegate_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v4" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" evmcfg "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" txmmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr/mocks" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" diff --git a/core/services/ocr2/plugins/functions/config/config.go b/core/services/ocr2/plugins/functions/config/config.go index a179a22ce44..13e02042506 100644 --- a/core/services/ocr2/plugins/functions/config/config.go +++ b/core/services/ocr2/plugins/functions/config/config.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2/types" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/common" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/functions" diff --git a/core/services/ocr2/plugins/functions/plugin.go b/core/services/ocr2/plugins/functions/plugin.go index 14d7415cab5..475cf0a2af7 100644 --- a/core/services/ocr2/plugins/functions/plugin.go +++ b/core/services/ocr2/plugins/functions/plugin.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/libocr/commontypes" libocr2 "github.com/smartcontractkit/libocr/offchainreporting2plus" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/core/services/ocr2/plugins/functions/plugin_test.go b/core/services/ocr2/plugins/functions/plugin_test.go index eea751789a0..453d4b67aa8 100644 --- a/core/services/ocr2/plugins/functions/plugin_test.go +++ b/core/services/ocr2/plugins/functions/plugin_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector" hc "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/common" diff --git a/core/services/ocr2/plugins/functions/reporting_test.go b/core/services/ocr2/plugins/functions/reporting_test.go index 860492bfc52..5b9f59ccb23 100644 --- a/core/services/ocr2/plugins/functions/reporting_test.go +++ b/core/services/ocr2/plugins/functions/reporting_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/libocr/commontypes" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - relaylogger "github.com/smartcontractkit/chainlink-relay/pkg/logger" + commonlogger "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" functions_srv "github.com/smartcontractkit/chainlink/v2/core/services/functions" @@ -24,7 +24,7 @@ import ( func preparePlugin(t *testing.T, batchSize uint32, maxTotalGasLimit uint32) (types.ReportingPlugin, *functions_mocks.ORM, encoding.ReportCodec, *functions_mocks.OffchainTransmitter) { lggr := logger.TestLogger(t) - ocrLogger := relaylogger.NewOCRWrapper(lggr, true, func(msg string) {}) + ocrLogger := commonlogger.NewOCRWrapper(lggr, true, func(msg string) {}) orm := functions_mocks.NewORM(t) offchainTransmitter := functions_mocks.NewOffchainTransmitter(t) factory := functions.FunctionsReportingPluginFactory{ diff --git a/core/services/ocr2/plugins/generic/pipeline_runner_adapter.go b/core/services/ocr2/plugins/generic/pipeline_runner_adapter.go index def33114e8c..872f83d3c35 100644 --- a/core/services/ocr2/plugins/generic/pipeline_runner_adapter.go +++ b/core/services/ocr2/plugins/generic/pipeline_runner_adapter.go @@ -4,7 +4,7 @@ import ( "context" "time" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" diff --git a/core/services/ocr2/plugins/generic/pipeline_runner_adapter_test.go b/core/services/ocr2/plugins/generic/pipeline_runner_adapter_test.go index ef0e7421b50..f70e0dd443a 100644 --- a/core/services/ocr2/plugins/generic/pipeline_runner_adapter_test.go +++ b/core/services/ocr2/plugins/generic/pipeline_runner_adapter_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v4" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" _ "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" diff --git a/core/services/ocr2/plugins/generic/telemetry_adapter.go b/core/services/ocr2/plugins/generic/telemetry_adapter.go index 51d94f5cfe7..a2ec6ba20cf 100644 --- a/core/services/ocr2/plugins/generic/telemetry_adapter.go +++ b/core/services/ocr2/plugins/generic/telemetry_adapter.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/synchronization" "github.com/smartcontractkit/chainlink/v2/core/services/telemetry" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) var _ types.TelemetryService = (*TelemetryAdapter)(nil) diff --git a/core/services/ocr2/plugins/median/plugin.go b/core/services/ocr2/plugins/median/plugin.go index f8517386b36..4f83c4b5dda 100644 --- a/core/services/ocr2/plugins/median/plugin.go +++ b/core/services/ocr2/plugins/median/plugin.go @@ -6,10 +6,10 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/services" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/services/ocr2/plugins/median/services.go b/core/services/ocr2/plugins/median/services.go index 8d121083f3f..9d65921ef2b 100644 --- a/core/services/ocr2/plugins/median/services.go +++ b/core/services/ocr2/plugins/median/services.go @@ -9,8 +9,8 @@ import ( libocr "github.com/smartcontractkit/libocr/offchainreporting2plus" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/config/env" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/core/services/ocr2/plugins/mercury/integration_test.go b/core/services/ocr2/plugins/mercury/integration_test.go index ae2b4ca9742..e8adb55b397 100644 --- a/core/services/ocr2/plugins/mercury/integration_test.go +++ b/core/services/ocr2/plugins/mercury/integration_test.go @@ -34,10 +34,10 @@ import ( ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/wsrpc/credentials" - relaymercury "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" - relaycodecv1 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v1" - relaycodecv2 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v2" - relaycodecv3 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v3" + relaymercury "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" + relaycodecv1 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v1" + relaycodecv2 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v2" + relaycodecv3 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v3" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" diff --git a/core/services/ocr2/plugins/mercury/plugin.go b/core/services/ocr2/plugins/mercury/plugin.go index ddef1374a4c..bd68ccd8b72 100644 --- a/core/services/ocr2/plugins/mercury/plugin.go +++ b/core/services/ocr2/plugins/mercury/plugin.go @@ -7,10 +7,10 @@ import ( libocr2 "github.com/smartcontractkit/libocr/offchainreporting2plus" - relaymercuryv1 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v1" - relaymercuryv2 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v2" - relaymercuryv3 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v3" - relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" + relaymercuryv1 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v1" + relaymercuryv2 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v2" + relaymercuryv3 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v3" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" @@ -30,7 +30,7 @@ type Config interface { func NewServices( jb job.Job, - ocr2Provider relaytypes.MercuryProvider, + ocr2Provider commontypes.MercuryProvider, pipelineRunner pipeline.Runner, runResults chan *pipeline.Run, lggr logger.Logger, diff --git a/core/services/ocr2/plugins/ocr2keeper/evm20/log_provider.go b/core/services/ocr2/plugins/ocr2keeper/evm20/log_provider.go index 4044bb5f2a4..d8941d505be 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm20/log_provider.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm20/log_provider.go @@ -15,7 +15,7 @@ import ( ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v2" "github.com/smartcontractkit/ocr2keepers/pkg/v2/encoding" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/keeper_registry_wrapper2_0" diff --git a/core/services/ocr2/plugins/ocr2keeper/evm20/registry.go b/core/services/ocr2/plugins/ocr2keeper/evm20/registry.go index 2d49a91e98f..7fe4087cfa2 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm20/registry.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm20/registry.go @@ -19,7 +19,7 @@ import ( ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v2" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/block_subscriber.go b/core/services/ocr2/plugins/ocr2keeper/evm21/block_subscriber.go index 6cc19a4d02e..ae407b0ea95 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/block_subscriber.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/block_subscriber.go @@ -11,7 +11,7 @@ import ( ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" httypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/provider.go b/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/provider.go index 349db2902b6..d3f069a9bf9 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/provider.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/provider.go @@ -18,7 +18,7 @@ import ( ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_utils_2_1" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/recoverer.go b/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/recoverer.go index d6e7ad51d13..c6566568158 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/recoverer.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/logprovider/recoverer.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/ocr2keepers/pkg/v3/random" ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/mercury/streams/streams.go b/core/services/ocr2/plugins/ocr2keeper/evm21/mercury/streams/streams.go index b83aca8a02a..d34787f501e 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/mercury/streams/streams.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/mercury/streams/streams.go @@ -17,7 +17,7 @@ import ( ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" iregistry21 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_keeper_registry_master_wrapper_2_1" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/transmit/event_provider.go b/core/services/ocr2/plugins/ocr2keeper/evm21/transmit/event_provider.go index 8f84ca1495c..000d40f4072 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/transmit/event_provider.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/transmit/event_provider.go @@ -10,7 +10,7 @@ import ( ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" iregistry21 "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/i_keeper_registry_master_wrapper_2_1" diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/upkeepstate/store.go b/core/services/ocr2/plugins/ocr2keeper/evm21/upkeepstate/store.go index 6c5f767bd36..f5e3969bc79 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/upkeepstate/store.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/upkeepstate/store.go @@ -10,7 +10,7 @@ import ( ocr2keepers "github.com/smartcontractkit/ocr2keepers/pkg/v3/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evm21/core" "github.com/smartcontractkit/chainlink/v2/core/services/pg" diff --git a/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go b/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go index f4fbf24f419..109a644ca09 100644 --- a/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go @@ -18,7 +18,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" + gethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/hashicorp/consul/sdk/freeport" "github.com/onsi/gomega" @@ -34,10 +34,9 @@ import ( ocrTypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/ocr2keepers/pkg/v3/config" - relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" automationForwarderLogic "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_forwarder_logic" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/basic_upkeep_contract" @@ -67,7 +66,7 @@ func TestFilterNamesFromSpec21(t *testing.T) { address := common.HexToAddress(hexutil.Encode(b)) spec := &job.OCR2OracleSpec{ - PluginType: relaytypes.OCR2Keeper, + PluginType: types.OCR2Keeper, ContractID: address.String(), // valid contract addr } @@ -79,7 +78,7 @@ func TestFilterNamesFromSpec21(t *testing.T) { assert.Equal(t, logpoller.FilterName("KeeperRegistry Events", address), names[1]) spec = &job.OCR2OracleSpec{ - PluginType: relaytypes.OCR2Keeper, + PluginType: types.OCR2Keeper, ContractID: "0x5431", // invalid contract addr } _, err = ocr2keeper.FilterNamesFromSpec21(spec) @@ -723,7 +722,7 @@ func deployKeeper21Registry( return registryMaster } -func getUpkeepIdFromTx21(t *testing.T, registry *iregistry21.IKeeperRegistryMaster, registrationTx *types.Transaction, backend *backends.SimulatedBackend) *big.Int { +func getUpkeepIdFromTx21(t *testing.T, registry *iregistry21.IKeeperRegistryMaster, registrationTx *gethtypes.Transaction, backend *backends.SimulatedBackend) *big.Int { receipt, err := backend.TransactionReceipt(testutils.Context(t), registrationTx.Hash()) require.NoError(t, err) parsedLog, err := registry.ParseUpkeepRegistered(*receipt.Logs[0]) diff --git a/core/services/ocr2/plugins/ocr2keeper/integration_test.go b/core/services/ocr2/plugins/ocr2keeper/integration_test.go index 569dc20753b..a2184d92aec 100644 --- a/core/services/ocr2/plugins/ocr2keeper/integration_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/integration_test.go @@ -19,7 +19,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" + gethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/hashicorp/consul/sdk/freeport" "github.com/onsi/gomega" @@ -62,7 +62,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/v2/core/utils" - relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) const ( @@ -196,7 +196,7 @@ func accountsToAddress(accounts []ocrTypes.Account) (addresses []common.Address, return addresses, nil } -func getUpkeepIdFromTx(t *testing.T, registry *keeper_registry_wrapper2_0.KeeperRegistry, registrationTx *types.Transaction, backend *backends.SimulatedBackend) *big.Int { +func getUpkeepIdFromTx(t *testing.T, registry *keeper_registry_wrapper2_0.KeeperRegistry, registrationTx *gethtypes.Transaction, backend *backends.SimulatedBackend) *big.Int { receipt, err := backend.TransactionReceipt(testutils.Context(t), registrationTx.Hash()) require.NoError(t, err) parsedLog, err := registry.ParseUpkeepRegistered(*receipt.Logs[0]) @@ -714,7 +714,7 @@ func TestFilterNamesFromSpec20(t *testing.T) { address := common.HexToAddress(hexutil.Encode(b)) spec := &job.OCR2OracleSpec{ - PluginType: relaytypes.OCR2Keeper, + PluginType: types.OCR2Keeper, ContractID: address.String(), // valid contract addr } @@ -726,7 +726,7 @@ func TestFilterNamesFromSpec20(t *testing.T) { assert.Equal(t, logpoller.FilterName("EvmRegistry - Upkeep events for", address), names[1]) spec = &job.OCR2OracleSpec{ - PluginType: relaytypes.OCR2Keeper, + PluginType: types.OCR2Keeper, ContractID: "0x5431", // invalid contract addr } _, err = ocr2keeper.FilterNamesFromSpec20(spec) diff --git a/core/services/ocr2/plugins/ocr2keeper/util.go b/core/services/ocr2/plugins/ocr2keeper/util.go index fca98d87005..504b6267c60 100644 --- a/core/services/ocr2/plugins/ocr2keeper/util.go +++ b/core/services/ocr2/plugins/ocr2keeper/util.go @@ -4,13 +4,14 @@ import ( "fmt" "github.com/jmoiron/sqlx" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ocr2keepers20 "github.com/smartcontractkit/ocr2keepers/pkg/v2" ocr2keepers20coordinator "github.com/smartcontractkit/ocr2keepers/pkg/v2/coordinator" ocr2keepers20polling "github.com/smartcontractkit/ocr2keepers/pkg/v2/observer/polling" ocr2keepers20runner "github.com/smartcontractkit/ocr2keepers/pkg/v2/runner" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ocr2keepers21 "github.com/smartcontractkit/ocr2keepers/pkg/v3/types" diff --git a/core/services/ocr2/plugins/ocr2vrf/coordinator/coordinator_test.go b/core/services/ocr2/plugins/ocr2vrf/coordinator/coordinator_test.go index dc489b4958a..f634ee0c01a 100644 --- a/core/services/ocr2/plugins/ocr2vrf/coordinator/coordinator_test.go +++ b/core/services/ocr2/plugins/ocr2vrf/coordinator/coordinator_test.go @@ -12,7 +12,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" + gethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/pkg/errors" "github.com/stretchr/testify/assert" @@ -25,7 +25,7 @@ import ( "github.com/smartcontractkit/ocr2vrf/ocr2vrf" ocr2vrftypes "github.com/smartcontractkit/ocr2vrf/types" - relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" evmclimocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" @@ -1469,7 +1469,7 @@ func newRandomnessRequestedLog( SubID: big.NewInt(1), CostJuels: big.NewInt(50_000), NewSubBalance: big.NewInt(100_000), - Raw: types.Log{ + Raw: gethtypes.Log{ BlockNumber: requestBlock, }, } @@ -1544,7 +1544,7 @@ func newRandomnessFulfillmentRequestedLog( Requester: common.HexToAddress("0x1234567890"), CostJuels: big.NewInt(50_000), NewSubBalance: big.NewInt(100_000), - Raw: types.Log{ + Raw: gethtypes.Log{ BlockNumber: requestBlock, }, } @@ -1763,7 +1763,7 @@ func TestFilterNamesFromSpec(t *testing.T) { spec := &job.OCR2OracleSpec{ ContractID: beaconAddress.String(), - PluginType: relaytypes.OCR2VRF, + PluginType: types.OCR2VRF, PluginConfig: job.JSONConfig{ "VRFCoordinatorAddress": coordinatorAddress.String(), "DKGContractAddress": dkgAddress.String(), @@ -1777,7 +1777,7 @@ func TestFilterNamesFromSpec(t *testing.T) { assert.Equal(t, logpoller.FilterName("VRF Coordinator", beaconAddress, coordinatorAddress, dkgAddress), names[0]) spec = &job.OCR2OracleSpec{ - PluginType: relaytypes.OCR2VRF, + PluginType: types.OCR2VRF, ContractID: beaconAddress.String(), PluginConfig: nil, // missing coordinator & dkg addresses } diff --git a/core/services/ocr2/plugins/s4/factory_test.go b/core/services/ocr2/plugins/s4/factory_test.go index 1b75988d83d..13a36a53823 100644 --- a/core/services/ocr2/plugins/s4/factory_test.go +++ b/core/services/ocr2/plugins/s4/factory_test.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/s4" s4_mocks "github.com/smartcontractkit/chainlink/v2/core/services/s4/mocks" - relaylogger "github.com/smartcontractkit/chainlink-relay/pkg/logger" + commonlogger "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/libocr/offchainreporting2/types" @@ -18,7 +18,7 @@ import ( func TestS4ReportingPluginFactory_NewReportingPlugin(t *testing.T) { t.Parallel() - logger := relaylogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) + logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) orm := s4_mocks.NewORM(t) f := s4.S4ReportingPluginFactory{ diff --git a/core/services/ocr2/plugins/s4/integration_test.go b/core/services/ocr2/plugins/s4/integration_test.go index 98ccd312e4b..54f0f02ad98 100644 --- a/core/services/ocr2/plugins/s4/integration_test.go +++ b/core/services/ocr2/plugins/s4/integration_test.go @@ -18,7 +18,7 @@ import ( s4_svc "github.com/smartcontractkit/chainlink/v2/core/services/s4" "github.com/smartcontractkit/chainlink/v2/core/utils" - relaylogger "github.com/smartcontractkit/chainlink-relay/pkg/logger" + commonlogger "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/libocr/commontypes" "github.com/smartcontractkit/libocr/offchainreporting2/types" @@ -56,7 +56,7 @@ func newDON(t *testing.T, size int, config *s4.PluginConfig) *don { orm := s4_svc.NewPostgresORM(db, logger, pgtest.NewQConfig(false), s4_svc.SharedTableName, ns) orms[i] = orm - ocrLogger := relaylogger.NewOCRWrapper(logger, true, func(msg string) {}) + ocrLogger := commonlogger.NewOCRWrapper(logger, true, func(msg string) {}) plugin, err := s4.NewReportingPlugin(ocrLogger, config, orm) require.NoError(t, err) plugins[i] = plugin diff --git a/core/services/ocr2/plugins/s4/plugin_test.go b/core/services/ocr2/plugins/s4/plugin_test.go index 94c876a4f7f..e2b5d21b847 100644 --- a/core/services/ocr2/plugins/s4/plugin_test.go +++ b/core/services/ocr2/plugins/s4/plugin_test.go @@ -13,13 +13,14 @@ import ( s4_mocks "github.com/smartcontractkit/chainlink/v2/core/services/s4/mocks" "github.com/smartcontractkit/chainlink/v2/core/utils" - relaylogger "github.com/smartcontractkit/chainlink-relay/pkg/logger" + commonlogger "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "google.golang.org/protobuf/proto" + + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ) func createPluginConfig(maxEntries uint) *s4.PluginConfig { @@ -121,7 +122,7 @@ func rowsToShapshotRows(rows []*s4_svc.Row) []*s4_svc.SnapshotRow { func TestPlugin_NewReportingPlugin(t *testing.T) { t.Parallel() - logger := relaylogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) + logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) orm := s4_mocks.NewORM(t) t.Run("ErrInvalidIntervals", func(t *testing.T) { @@ -167,7 +168,7 @@ func TestPlugin_NewReportingPlugin(t *testing.T) { func TestPlugin_Close(t *testing.T) { t.Parallel() - logger := relaylogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) + logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) config := createPluginConfig(10) orm := s4_mocks.NewORM(t) plugin, err := s4.NewReportingPlugin(logger, config, orm) @@ -180,7 +181,7 @@ func TestPlugin_Close(t *testing.T) { func TestPlugin_ShouldTransmitAcceptedReport(t *testing.T) { t.Parallel() - logger := relaylogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) + logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) config := createPluginConfig(10) orm := s4_mocks.NewORM(t) plugin, err := s4.NewReportingPlugin(logger, config, orm) @@ -194,7 +195,7 @@ func TestPlugin_ShouldTransmitAcceptedReport(t *testing.T) { func TestPlugin_ShouldAcceptFinalizedReport(t *testing.T) { t.Parallel() - logger := relaylogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) + logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) config := createPluginConfig(10) orm := s4_mocks.NewORM(t) plugin, err := s4.NewReportingPlugin(logger, config, orm) @@ -255,7 +256,7 @@ func TestPlugin_ShouldAcceptFinalizedReport(t *testing.T) { func TestPlugin_Query(t *testing.T) { t.Parallel() - logger := relaylogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) + logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) config := createPluginConfig(10) orm := s4_mocks.NewORM(t) plugin, err := s4.NewReportingPlugin(logger, config, orm) @@ -332,7 +333,7 @@ func TestPlugin_Query(t *testing.T) { func TestPlugin_Observation(t *testing.T) { t.Parallel() - logger := relaylogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) + logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) config := createPluginConfig(10) orm := s4_mocks.NewORM(t) plugin, err := s4.NewReportingPlugin(logger, config, orm) @@ -465,7 +466,7 @@ func TestPlugin_Observation(t *testing.T) { func TestPlugin_Report(t *testing.T) { t.Parallel() - logger := relaylogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) + logger := commonlogger.NewOCRWrapper(logger.TestLogger(t), true, func(msg string) {}) config := createPluginConfig(10) orm := s4_mocks.NewORM(t) plugin, err := s4.NewReportingPlugin(logger, config, orm) diff --git a/core/services/ocr2/validate/validate.go b/core/services/ocr2/validate/validate.go index 65b95cb31a1..c97d23dca09 100644 --- a/core/services/ocr2/validate/validate.go +++ b/core/services/ocr2/validate/validate.go @@ -12,7 +12,7 @@ import ( libocr2 "github.com/smartcontractkit/libocr/offchainreporting2plus" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/services/job" dkgconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/dkg/config" mercuryconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/mercury/config" diff --git a/core/services/ocrbootstrap/delegate.go b/core/services/ocrbootstrap/delegate.go index 34e3ee0a710..7912741802c 100644 --- a/core/services/ocrbootstrap/delegate.go +++ b/core/services/ocrbootstrap/delegate.go @@ -8,11 +8,12 @@ import ( "github.com/pkg/errors" "github.com/jmoiron/sqlx" + ocr "github.com/smartcontractkit/libocr/offchainreporting2plus" - relaylogger "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + commonlogger "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" @@ -165,7 +166,7 @@ func (d *Delegate) ServicesForSpec(jb job.Job) (services []job.ServiceCtx, err e ContractConfigTracker: configProvider.ContractConfigTracker(), Database: NewDB(d.db.DB, spec.ID, lggr), LocalConfig: lc, - Logger: relaylogger.NewOCRWrapper(lggr.Named("OCRBootstrap"), d.ocr2Cfg.TraceLogging(), func(msg string) { + Logger: commonlogger.NewOCRWrapper(lggr.Named("OCRBootstrap"), d.ocr2Cfg.TraceLogging(), func(msg string) { logger.Sugared(lggr).ErrorIf(d.jobORM.RecordError(jb.ID, msg), "unable to record error") }), OffchainConfigDigester: configProvider.OffchainConfigDigester(), diff --git a/core/services/ocrcommon/peer_wrapper.go b/core/services/ocrcommon/peer_wrapper.go index 1daa84b7212..a7d510ef901 100644 --- a/core/services/ocrcommon/peer_wrapper.go +++ b/core/services/ocrcommon/peer_wrapper.go @@ -12,13 +12,14 @@ import ( "go.uber.org/multierr" "github.com/jmoiron/sqlx" + ocrnetworking "github.com/smartcontractkit/libocr/networking" ocrnetworkingtypes "github.com/smartcontractkit/libocr/networking/types" ocr1types "github.com/smartcontractkit/libocr/offchainreporting/types" ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - relaylogger "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + commonlogger "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -194,7 +195,7 @@ func (p *SingletonPeerWrapper) peerConfig() (ocrnetworking.PeerConfig, error) { peerConfig := ocrnetworking.PeerConfig{ NetworkingStack: config.NetworkStack(), PrivKey: key.PrivKey, - Logger: relaylogger.NewOCRWrapper(p.lggr, p.ocrCfg.TraceLogging(), func(string) {}), + Logger: commonlogger.NewOCRWrapper(p.lggr, p.ocrCfg.TraceLogging(), func(string) {}), // V1 config V1ListenIP: config.V1().ListenIP(), V1ListenPort: p2pPort, diff --git a/core/services/ocrcommon/peerstore.go b/core/services/ocrcommon/peerstore.go index 02a4d90f578..1d859184ab5 100644 --- a/core/services/ocrcommon/peerstore.go +++ b/core/services/ocrcommon/peerstore.go @@ -14,7 +14,7 @@ import ( "github.com/jmoiron/sqlx" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/recovery" diff --git a/core/services/ocrcommon/run_saver.go b/core/services/ocrcommon/run_saver.go index d8dcc343588..184226605fe 100644 --- a/core/services/ocrcommon/run_saver.go +++ b/core/services/ocrcommon/run_saver.go @@ -3,7 +3,7 @@ package ocrcommon import ( "context" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) diff --git a/core/services/ocrcommon/telemetry.go b/core/services/ocrcommon/telemetry.go index be139723ef2..c9d3e85cd2c 100644 --- a/core/services/ocrcommon/telemetry.go +++ b/core/services/ocrcommon/telemetry.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/libocr/commontypes" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" @@ -21,9 +21,9 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/synchronization/telem" "github.com/smartcontractkit/chainlink/v2/core/utils" - relaymercuryv1 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v1" - relaymercuryv2 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v2" - relaymercuryv3 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v3" + relaymercuryv1 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v1" + relaymercuryv2 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v2" + relaymercuryv3 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v3" ) type eaTelemetry struct { diff --git a/core/services/ocrcommon/telemetry_test.go b/core/services/ocrcommon/telemetry_test.go index 9e3dedce8a8..24c798259d9 100644 --- a/core/services/ocrcommon/telemetry_test.go +++ b/core/services/ocrcommon/telemetry_test.go @@ -6,16 +6,17 @@ import ( "testing" "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "go.uber.org/zap" "google.golang.org/protobuf/proto" - "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" - mercuryv1 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v1" - mercury_v2 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v2" + "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + + "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" + mercuryv1 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v1" + mercury_v2 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v2" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/core/services/periodicbackup/backup.go b/core/services/periodicbackup/backup.go index f43698bbdb0..b1bcf40ee32 100644 --- a/core/services/periodicbackup/backup.go +++ b/core/services/periodicbackup/backup.go @@ -11,7 +11,7 @@ import ( "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/core/services/pg/event_broadcaster.go b/core/services/pg/event_broadcaster.go index f18ac3251a8..70008f4c0de 100644 --- a/core/services/pg/event_broadcaster.go +++ b/core/services/pg/event_broadcaster.go @@ -11,7 +11,7 @@ import ( "github.com/lib/pq" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/static" diff --git a/core/services/pg/q.go b/core/services/pg/q.go index 9c9c15d9838..050606c7937 100644 --- a/core/services/pg/q.go +++ b/core/services/pg/q.go @@ -17,7 +17,7 @@ import ( "github.com/jmoiron/sqlx" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) var promSQLQueryTime = promauto.NewHistogram(prometheus.HistogramOpts{ diff --git a/core/services/pg/sqlx.go b/core/services/pg/sqlx.go index c371c292138..c252edf9f5a 100644 --- a/core/services/pg/sqlx.go +++ b/core/services/pg/sqlx.go @@ -9,7 +9,7 @@ import ( "github.com/jmoiron/sqlx" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) type Queryer interface { diff --git a/core/services/pg/transaction.go b/core/services/pg/transaction.go index 74841d010bf..fd7e74baca3 100644 --- a/core/services/pg/transaction.go +++ b/core/services/pg/transaction.go @@ -11,7 +11,7 @@ import ( "github.com/pkg/errors" "go.uber.org/multierr" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" corelogger "github.com/smartcontractkit/chainlink/v2/core/logger" ) diff --git a/core/services/pipeline/orm.go b/core/services/pipeline/orm.go index 056a7deab28..eb242e62765 100644 --- a/core/services/pipeline/orm.go +++ b/core/services/pipeline/orm.go @@ -13,7 +13,7 @@ import ( "github.com/jmoiron/sqlx" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/pg" diff --git a/core/services/pipeline/runner.go b/core/services/pipeline/runner.go index d33913b4753..edb1d337afd 100644 --- a/core/services/pipeline/runner.go +++ b/core/services/pipeline/runner.go @@ -14,7 +14,7 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" "gopkg.in/guregu/null.v4" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" diff --git a/core/services/promreporter/prom_reporter.go b/core/services/promreporter/prom_reporter.go index fd6afeeb8ea..2306640bea6 100644 --- a/core/services/promreporter/prom_reporter.go +++ b/core/services/promreporter/prom_reporter.go @@ -13,7 +13,7 @@ import ( "go.uber.org/multierr" "gopkg.in/guregu/null.v4" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/utils" diff --git a/core/services/relay/evm/config_poller.go b/core/services/relay/evm/config_poller.go index daccf400ea7..fe39ed0e343 100644 --- a/core/services/relay/evm/config_poller.go +++ b/core/services/relay/evm/config_poller.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/libocr/gethwrappers2/ocrconfigurationstoreevmsimple" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/logger" diff --git a/core/services/relay/evm/evm.go b/core/services/relay/evm/evm.go index aa1d1d774bd..e8267c9a842 100644 --- a/core/services/relay/evm/evm.go +++ b/core/services/relay/evm/evm.go @@ -20,8 +20,8 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" - relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/services" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" @@ -44,7 +44,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" ) -var _ relaytypes.Relayer = &Relayer{} //nolint:staticcheck +var _ commontypes.Relayer = &Relayer{} //nolint:staticcheck type Relayer struct { db *sqlx.DB @@ -130,7 +130,7 @@ func (r *Relayer) HealthReport() (report map[string]error) { return } -func (r *Relayer) NewMercuryProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MercuryProvider, error) { +func (r *Relayer) NewMercuryProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.MercuryProvider, error) { lggr := r.lggr.Named("MercuryProvider").Named(rargs.ExternalJobID.String()) relayOpts := types.NewRelayOpts(rargs) relayConfig, err := relayOpts.RelayConfig() @@ -193,13 +193,13 @@ func (r *Relayer) NewMercuryProvider(rargs relaytypes.RelayArgs, pargs relaytype return NewMercuryProvider(cw, transmitter, reportCodecV1, reportCodecV2, reportCodecV3, chainReader, lggr), nil } -func (r *Relayer) NewFunctionsProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.FunctionsProvider, error) { +func (r *Relayer) NewFunctionsProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.FunctionsProvider, error) { lggr := r.lggr.Named("FunctionsProvider").Named(rargs.ExternalJobID.String()) // TODO(FUN-668): Not ready yet (doesn't implement FunctionsEvents() properly) return NewFunctionsProvider(r.chain, rargs, pargs, lggr, r.ks.Eth(), functions.FunctionsPlugin) } -func (r *Relayer) NewConfigProvider(args relaytypes.RelayArgs) (relaytypes.ConfigProvider, error) { +func (r *Relayer) NewConfigProvider(args commontypes.RelayArgs) (commontypes.ConfigProvider, error) { lggr := r.lggr.Named("ConfigProvider").Named(args.ExternalJobID.String()) relayOpts := types.NewRelayOpts(args) relayConfig, err := relayOpts.RelayConfig() @@ -219,7 +219,7 @@ func (r *Relayer) NewConfigProvider(args relaytypes.RelayArgs) (relaytypes.Confi return configProvider, err } -func FilterNamesFromRelayArgs(args relaytypes.RelayArgs) (filterNames []string, err error) { +func FilterNamesFromRelayArgs(args commontypes.RelayArgs) (filterNames []string, err error) { var addr ethkey.EIP55Address if addr, err = ethkey.NewEIP55Address(args.ContractID); err != nil { return nil, err @@ -373,7 +373,7 @@ func newConfigProvider(lggr logger.Logger, chain evm.Chain, opts *types.RelayOpt return newConfigWatcher(lggr, aggregatorAddress, contractABI, offchainConfigDigester, cp, chain, relayConfig.FromBlock, opts.New), nil } -func newContractTransmitter(lggr logger.Logger, rargs relaytypes.RelayArgs, transmitterID string, configWatcher *configWatcher, ethKeystore keystore.Eth) (*contractTransmitter, error) { +func newContractTransmitter(lggr logger.Logger, rargs commontypes.RelayArgs, transmitterID string, configWatcher *configWatcher, ethKeystore keystore.Eth) (*contractTransmitter, error) { var relayConfig types.RelayConfig if err := json.Unmarshal(rargs.RelayConfig, &relayConfig); err != nil { return nil, err @@ -442,7 +442,7 @@ func newContractTransmitter(lggr logger.Logger, rargs relaytypes.RelayArgs, tran ) } -func newPipelineContractTransmitter(lggr logger.Logger, rargs relaytypes.RelayArgs, transmitterID string, pluginGasLimit *uint32, configWatcher *configWatcher, spec job.Job, pr pipeline.Runner) (*contractTransmitter, error) { +func newPipelineContractTransmitter(lggr logger.Logger, rargs commontypes.RelayArgs, transmitterID string, pluginGasLimit *uint32, configWatcher *configWatcher, spec job.Job, pr pipeline.Runner) (*contractTransmitter, error) { var relayConfig types.RelayConfig if err := json.Unmarshal(rargs.RelayConfig, &relayConfig); err != nil { return nil, err @@ -491,7 +491,7 @@ func newPipelineContractTransmitter(lggr logger.Logger, rargs relaytypes.RelayAr ) } -func (r *Relayer) NewMedianProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MedianProvider, error) { +func (r *Relayer) NewMedianProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (commontypes.MedianProvider, error) { lggr := r.lggr.Named("MedianProvider").Named(rargs.ExternalJobID.String()) relayOpts := types.NewRelayOpts(rargs) relayConfig, err := relayOpts.RelayConfig() @@ -526,7 +526,7 @@ func (r *Relayer) NewMedianProvider(rargs relaytypes.RelayArgs, pargs relaytypes }, nil } -var _ relaytypes.MedianProvider = (*medianProvider)(nil) +var _ commontypes.MedianProvider = (*medianProvider)(nil) type medianProvider struct { configWatcher *configWatcher diff --git a/core/services/relay/evm/functions.go b/core/services/relay/evm/functions.go index fdd6201c697..88f9d22099e 100644 --- a/core/services/relay/evm/functions.go +++ b/core/services/relay/evm/functions.go @@ -16,8 +16,8 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" - relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/services" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" txm "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" @@ -46,7 +46,7 @@ func (p *functionsProvider) LogPollerWrapper() evmRelayTypes.LogPollerWrapper { return p.logPollerWrapper } -func (p *functionsProvider) FunctionsEvents() relaytypes.FunctionsEvents { +func (p *functionsProvider) FunctionsEvents() commontypes.FunctionsEvents { // TODO (FUN-668): implement return nil } @@ -85,7 +85,7 @@ func (p *functionsProvider) Name() string { return p.configWatcher.Name() } -func NewFunctionsProvider(chain evm.Chain, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs, lggr logger.Logger, ethKeystore keystore.Eth, pluginType functionsRelay.FunctionsPluginType) (evmRelayTypes.FunctionsProvider, error) { +func NewFunctionsProvider(chain evm.Chain, rargs commontypes.RelayArgs, pargs commontypes.PluginArgs, lggr logger.Logger, ethKeystore keystore.Eth, pluginType functionsRelay.FunctionsPluginType) (evmRelayTypes.FunctionsProvider, error) { relayOpts := evmRelayTypes.NewRelayOpts(rargs) relayConfig, err := relayOpts.RelayConfig() if err != nil { @@ -130,7 +130,7 @@ func NewFunctionsProvider(chain evm.Chain, rargs relaytypes.RelayArgs, pargs rel }, nil } -func newFunctionsConfigProvider(pluginType functionsRelay.FunctionsPluginType, chain evm.Chain, args relaytypes.RelayArgs, fromBlock uint64, logPollerWrapper evmRelayTypes.LogPollerWrapper, lggr logger.Logger) (*configWatcher, error) { +func newFunctionsConfigProvider(pluginType functionsRelay.FunctionsPluginType, chain evm.Chain, args commontypes.RelayArgs, fromBlock uint64, logPollerWrapper evmRelayTypes.LogPollerWrapper, lggr logger.Logger) (*configWatcher, error) { if !common.IsHexAddress(args.ContractID) { return nil, errors.Errorf("invalid contractID, expected hex address") } @@ -153,7 +153,7 @@ func newFunctionsConfigProvider(pluginType functionsRelay.FunctionsPluginType, c return newConfigWatcher(lggr, routerContractAddress, contractABI, offchainConfigDigester, cp, chain, fromBlock, args.New), nil } -func newFunctionsContractTransmitter(contractVersion uint32, rargs relaytypes.RelayArgs, transmitterID string, configWatcher *configWatcher, ethKeystore keystore.Eth, logPollerWrapper evmRelayTypes.LogPollerWrapper, lggr logger.Logger) (ContractTransmitter, error) { +func newFunctionsContractTransmitter(contractVersion uint32, rargs commontypes.RelayArgs, transmitterID string, configWatcher *configWatcher, ethKeystore keystore.Eth, logPollerWrapper evmRelayTypes.LogPollerWrapper, lggr logger.Logger) (ContractTransmitter, error) { var relayConfig evmRelayTypes.RelayConfig if err := json.Unmarshal(rargs.RelayConfig, &relayConfig); err != nil { return nil, err diff --git a/core/services/relay/evm/functions/logpoller_wrapper.go b/core/services/relay/evm/functions/logpoller_wrapper.go index 6193f4ba862..230185d0ad7 100644 --- a/core/services/relay/evm/functions/logpoller_wrapper.go +++ b/core/services/relay/evm/functions/logpoller_wrapper.go @@ -10,7 +10,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/functions/generated/functions_coordinator" diff --git a/core/services/relay/evm/loop_impl.go b/core/services/relay/evm/loop_impl.go index f69660373e6..309b5e24f62 100644 --- a/core/services/relay/evm/loop_impl.go +++ b/core/services/relay/evm/loop_impl.go @@ -1,7 +1,7 @@ package evm import ( - "github.com/smartcontractkit/chainlink-relay/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" "github.com/smartcontractkit/chainlink/v2/core/services/relay" diff --git a/core/services/relay/evm/mercury/persistence_manager.go b/core/services/relay/evm/mercury/persistence_manager.go index 9de1f80c6b5..69dfce9c16d 100644 --- a/core/services/relay/evm/mercury/persistence_manager.go +++ b/core/services/relay/evm/mercury/persistence_manager.go @@ -7,7 +7,7 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/pg" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" diff --git a/core/services/relay/evm/mercury/queue.go b/core/services/relay/evm/mercury/queue.go index 3d20b3f2b0c..07ef8a97426 100644 --- a/core/services/relay/evm/mercury/queue.go +++ b/core/services/relay/evm/mercury/queue.go @@ -13,7 +13,7 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" diff --git a/core/services/relay/evm/mercury/transmitter.go b/core/services/relay/evm/mercury/transmitter.go index 269f28b122d..73aa10243f8 100644 --- a/core/services/relay/evm/mercury/transmitter.go +++ b/core/services/relay/evm/mercury/transmitter.go @@ -17,11 +17,12 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" "github.com/jmoiron/sqlx" + "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - relaymercury "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + relaymercury "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/pg" diff --git a/core/services/relay/evm/mercury/v1/data_source.go b/core/services/relay/evm/mercury/v1/data_source.go index 0bdfb67de78..79eb32af441 100644 --- a/core/services/relay/evm/mercury/v1/data_source.go +++ b/core/services/relay/evm/mercury/v1/data_source.go @@ -13,8 +13,8 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - relaymercury "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" - relaymercuryv1 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v1" + relaymercury "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" + relaymercuryv1 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v1" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" diff --git a/core/services/relay/evm/mercury/v1/data_source_test.go b/core/services/relay/evm/mercury/v1/data_source_test.go index 3aea503ae6a..635658d7863 100644 --- a/core/services/relay/evm/mercury/v1/data_source_test.go +++ b/core/services/relay/evm/mercury/v1/data_source_test.go @@ -15,8 +15,8 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - relaymercury "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" - relaymercuryv1 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v1" + relaymercury "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" + relaymercuryv1 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v1" commonmocks "github.com/smartcontractkit/chainlink/v2/common/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" diff --git a/core/services/relay/evm/mercury/v1/reportcodec/report_codec.go b/core/services/relay/evm/mercury/v1/reportcodec/report_codec.go index fefddd6395b..28688e3b17a 100644 --- a/core/services/relay/evm/mercury/v1/reportcodec/report_codec.go +++ b/core/services/relay/evm/mercury/v1/reportcodec/report_codec.go @@ -8,9 +8,10 @@ import ( "github.com/ethereum/go-ethereum/common" pkgerrors "github.com/pkg/errors" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - reportcodec "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v1" + reportcodec "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v1" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" diff --git a/core/services/relay/evm/mercury/v1/reportcodec/report_codec_test.go b/core/services/relay/evm/mercury/v1/reportcodec/report_codec_test.go index 3f4838c3e7c..f630b4522b4 100644 --- a/core/services/relay/evm/mercury/v1/reportcodec/report_codec_test.go +++ b/core/services/relay/evm/mercury/v1/reportcodec/report_codec_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - relaymercuryv1 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v1" + relaymercuryv1 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v1" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/services/relay/evm/mercury/v2/data_source.go b/core/services/relay/evm/mercury/v2/data_source.go index 17bc4a6670c..f7b78925130 100644 --- a/core/services/relay/evm/mercury/v2/data_source.go +++ b/core/services/relay/evm/mercury/v2/data_source.go @@ -10,8 +10,8 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - relaymercury "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" - relaymercuryv2 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v2" + relaymercury "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" + relaymercuryv2 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v2" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" diff --git a/core/services/relay/evm/mercury/v2/data_source_test.go b/core/services/relay/evm/mercury/v2/data_source_test.go index b66355ac7fb..02492031939 100644 --- a/core/services/relay/evm/mercury/v2/data_source_test.go +++ b/core/services/relay/evm/mercury/v2/data_source_test.go @@ -8,8 +8,8 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/assert" - relaymercury "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" - relaymercuryv2 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v2" + relaymercury "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" + relaymercuryv2 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v2" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" diff --git a/core/services/relay/evm/mercury/v2/reportcodec/report_codec.go b/core/services/relay/evm/mercury/v2/reportcodec/report_codec.go index 0e1dfe9c46f..6b13b3b6ef8 100644 --- a/core/services/relay/evm/mercury/v2/reportcodec/report_codec.go +++ b/core/services/relay/evm/mercury/v2/reportcodec/report_codec.go @@ -6,9 +6,10 @@ import ( "math/big" pkgerrors "github.com/pkg/errors" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - reportcodec "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v2" + reportcodec "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v2" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" diff --git a/core/services/relay/evm/mercury/v2/reportcodec/report_codec_test.go b/core/services/relay/evm/mercury/v2/reportcodec/report_codec_test.go index 8cf16a5dab4..3a58337b4ce 100644 --- a/core/services/relay/evm/mercury/v2/reportcodec/report_codec_test.go +++ b/core/services/relay/evm/mercury/v2/reportcodec/report_codec_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - relaymercuryv2 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v2" + relaymercuryv2 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v2" ) func newValidReportFields() relaymercuryv2.ReportFields { diff --git a/core/services/relay/evm/mercury/v3/data_source.go b/core/services/relay/evm/mercury/v3/data_source.go index 6f2b2eb6bde..34dbd13be99 100644 --- a/core/services/relay/evm/mercury/v3/data_source.go +++ b/core/services/relay/evm/mercury/v3/data_source.go @@ -11,8 +11,8 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - relaymercury "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" - relaymercuryv3 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v3" + relaymercury "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" + relaymercuryv3 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v3" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" diff --git a/core/services/relay/evm/mercury/v3/data_source_test.go b/core/services/relay/evm/mercury/v3/data_source_test.go index aefc766996e..c4b5b4c6100 100644 --- a/core/services/relay/evm/mercury/v3/data_source_test.go +++ b/core/services/relay/evm/mercury/v3/data_source_test.go @@ -8,8 +8,8 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/assert" - relaymercury "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" - relaymercuryv3 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v3" + relaymercury "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" + relaymercuryv3 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v3" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" diff --git a/core/services/relay/evm/mercury/v3/reportcodec/report_codec.go b/core/services/relay/evm/mercury/v3/reportcodec/report_codec.go index 4c0b3756d7b..6b379dc1948 100644 --- a/core/services/relay/evm/mercury/v3/reportcodec/report_codec.go +++ b/core/services/relay/evm/mercury/v3/reportcodec/report_codec.go @@ -7,9 +7,10 @@ import ( "math/big" pkgerrors "github.com/pkg/errors" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - reportcodec "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v3" + reportcodec "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v3" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/utils" diff --git a/core/services/relay/evm/mercury/v3/reportcodec/report_codec_test.go b/core/services/relay/evm/mercury/v3/reportcodec/report_codec_test.go index 98b81edb002..88416f7ea61 100644 --- a/core/services/relay/evm/mercury/v3/reportcodec/report_codec_test.go +++ b/core/services/relay/evm/mercury/v3/reportcodec/report_codec_test.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - relaymercuryv3 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v3" + relaymercuryv3 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v3" ) func newValidReportFields() relaymercuryv3.ReportFields { diff --git a/core/services/relay/evm/mercury/wsrpc/client.go b/core/services/relay/evm/mercury/wsrpc/client.go index f6ed1d0db8e..c4db80a58d0 100644 --- a/core/services/relay/evm/mercury/wsrpc/client.go +++ b/core/services/relay/evm/mercury/wsrpc/client.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/wsrpc" "github.com/smartcontractkit/wsrpc/connectivity" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" diff --git a/core/services/relay/evm/mercury_provider.go b/core/services/relay/evm/mercury_provider.go index bba5e699bc6..90253808171 100644 --- a/core/services/relay/evm/mercury_provider.go +++ b/core/services/relay/evm/mercury_provider.go @@ -6,19 +6,19 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - relaymercury "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" - relaymercuryv1 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v1" - relaymercuryv2 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v2" - relaymercuryv3 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v3" - "github.com/smartcontractkit/chainlink-relay/pkg/services" - relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" + relaymercury "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" + relaymercuryv1 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v1" + relaymercuryv2 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v2" + relaymercuryv3 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v3" + "github.com/smartcontractkit/chainlink-common/pkg/services" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" httypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker/types" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" ) -var _ relaytypes.MercuryProvider = (*mercuryProvider)(nil) +var _ commontypes.MercuryProvider = (*mercuryProvider)(nil) type mercuryProvider struct { configWatcher *configWatcher diff --git a/core/services/relay/evm/mocks/loop_relay_adapter.go b/core/services/relay/evm/mocks/loop_relay_adapter.go index 13107fe8ae5..13a73036a1d 100644 --- a/core/services/relay/evm/mocks/loop_relay_adapter.go +++ b/core/services/relay/evm/mocks/loop_relay_adapter.go @@ -9,7 +9,7 @@ import ( evm "github.com/smartcontractkit/chainlink/v2/core/chains/evm" mock "github.com/stretchr/testify/mock" - types "github.com/smartcontractkit/chainlink-relay/pkg/types" + types "github.com/smartcontractkit/chainlink-common/pkg/types" ) // LoopRelayAdapter is an autogenerated mock type for the LoopRelayAdapter type diff --git a/core/services/relay/evm/ocr2keeper.go b/core/services/relay/evm/ocr2keeper.go index a284d677ebf..2e8f9cbf487 100644 --- a/core/services/relay/evm/ocr2keeper.go +++ b/core/services/relay/evm/ocr2keeper.go @@ -10,12 +10,13 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/jmoiron/sqlx" "github.com/pkg/errors" + "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" "github.com/smartcontractkit/ocr2keepers/pkg/v3/plugin" - relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" @@ -33,19 +34,19 @@ var ( // OCR2KeeperProviderOpts is the custom options to create a keeper provider type OCR2KeeperProviderOpts struct { - RArgs relaytypes.RelayArgs - PArgs relaytypes.PluginArgs + RArgs commontypes.RelayArgs + PArgs commontypes.PluginArgs InstanceID int } // OCR2KeeperProvider provides all components needed for a OCR2Keeper plugin. type OCR2KeeperProvider interface { - relaytypes.Plugin + commontypes.Plugin } // OCR2KeeperRelayer contains the relayer and instantiating functions for OCR2Keeper providers. type OCR2KeeperRelayer interface { - NewOCR2KeeperProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (OCR2KeeperProvider, error) + NewOCR2KeeperProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (OCR2KeeperProvider, error) } // ocr2keeperRelayer is the relayer with added DKG and OCR2Keeper provider functions. @@ -68,7 +69,7 @@ func NewOCR2KeeperRelayer(db *sqlx.DB, chain evm.Chain, pr pipeline.Runner, spec } } -func (r *ocr2keeperRelayer) NewOCR2KeeperProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (OCR2KeeperProvider, error) { +func (r *ocr2keeperRelayer) NewOCR2KeeperProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (OCR2KeeperProvider, error) { cfgWatcher, err := newOCR2KeeperConfigProvider(r.lggr, r.chain, rargs) if err != nil { return nil, err @@ -129,7 +130,7 @@ func (c *ocr2keeperProvider) ContractTransmitter() ocrtypes.ContractTransmitter return c.contractTransmitter } -func newOCR2KeeperConfigProvider(lggr logger.Logger, chain evm.Chain, rargs relaytypes.RelayArgs) (*configWatcher, error) { +func newOCR2KeeperConfigProvider(lggr logger.Logger, chain evm.Chain, rargs commontypes.RelayArgs) (*configWatcher, error) { var relayConfig types.RelayConfig err := json.Unmarshal(rargs.RelayConfig, &relayConfig) if err != nil { diff --git a/core/services/relay/evm/ocr2vrf.go b/core/services/relay/evm/ocr2vrf.go index 0c9414068e3..66ce42b7d8d 100644 --- a/core/services/relay/evm/ocr2vrf.go +++ b/core/services/relay/evm/ocr2vrf.go @@ -9,11 +9,12 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/jmoiron/sqlx" "github.com/pkg/errors" + "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -24,18 +25,18 @@ import ( // DKGProvider provides all components needed for a DKG plugin. type DKGProvider interface { - relaytypes.Plugin + commontypes.Plugin } // OCR2VRFProvider provides all components needed for a OCR2VRF plugin. type OCR2VRFProvider interface { - relaytypes.Plugin + commontypes.Plugin } // OCR2VRFRelayer contains the relayer and instantiating functions for OCR2VRF providers. type OCR2VRFRelayer interface { - NewDKGProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (DKGProvider, error) - NewOCR2VRFProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (OCR2VRFProvider, error) + NewDKGProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (DKGProvider, error) + NewOCR2VRFProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (OCR2VRFProvider, error) } var ( @@ -61,7 +62,7 @@ func NewOCR2VRFRelayer(db *sqlx.DB, chain evm.Chain, lggr logger.Logger, ethKeys } } -func (r *ocr2vrfRelayer) NewDKGProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (DKGProvider, error) { +func (r *ocr2vrfRelayer) NewDKGProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (DKGProvider, error) { configWatcher, err := newOCR2VRFConfigProvider(r.lggr, r.chain, rargs) if err != nil { return nil, err @@ -84,7 +85,7 @@ func (r *ocr2vrfRelayer) NewDKGProvider(rargs relaytypes.RelayArgs, pargs relayt }, nil } -func (r *ocr2vrfRelayer) NewOCR2VRFProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (OCR2VRFProvider, error) { +func (r *ocr2vrfRelayer) NewOCR2VRFProvider(rargs commontypes.RelayArgs, pargs commontypes.PluginArgs) (OCR2VRFProvider, error) { configWatcher, err := newOCR2VRFConfigProvider(r.lggr, r.chain, rargs) if err != nil { return nil, err @@ -118,7 +119,7 @@ func (c *ocr2vrfProvider) ContractTransmitter() ocrtypes.ContractTransmitter { return c.contractTransmitter } -func newOCR2VRFConfigProvider(lggr logger.Logger, chain evm.Chain, rargs relaytypes.RelayArgs) (*configWatcher, error) { +func newOCR2VRFConfigProvider(lggr logger.Logger, chain evm.Chain, rargs commontypes.RelayArgs) (*configWatcher, error) { var relayConfig types.RelayConfig err := json.Unmarshal(rargs.RelayConfig, &relayConfig) if err != nil { diff --git a/core/services/relay/evm/relayer_extender.go b/core/services/relay/evm/relayer_extender.go index b6ca4d75fb7..43626037a17 100644 --- a/core/services/relay/evm/relayer_extender.go +++ b/core/services/relay/evm/relayer_extender.go @@ -8,8 +8,8 @@ import ( "github.com/pkg/errors" "go.uber.org/multierr" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" evmchain "github.com/smartcontractkit/chainlink/v2/core/chains/evm" @@ -75,11 +75,11 @@ type ChainRelayerExt struct { var _ EVMChainRelayerExtender = &ChainRelayerExt{} -func (s *ChainRelayerExt) GetChainStatus(ctx context.Context) (relaytypes.ChainStatus, error) { +func (s *ChainRelayerExt) GetChainStatus(ctx context.Context) (commontypes.ChainStatus, error) { return s.chain.GetChainStatus(ctx) } -func (s *ChainRelayerExt) ListNodeStatuses(ctx context.Context, pageSize int32, pageToken string) (stats []relaytypes.NodeStatus, nextPageToken string, total int, err error) { +func (s *ChainRelayerExt) ListNodeStatuses(ctx context.Context, pageSize int32, pageToken string) (stats []commontypes.NodeStatus, nextPageToken string, total int, err error) { return s.chain.ListNodeStatuses(ctx, pageSize, pageToken) } diff --git a/core/services/relay/evm/request_round_tracker.go b/core/services/relay/evm/request_round_tracker.go index c1c3a49e0e4..1f1ed71fc31 100644 --- a/core/services/relay/evm/request_round_tracker.go +++ b/core/services/relay/evm/request_round_tracker.go @@ -10,10 +10,11 @@ import ( "github.com/pkg/errors" "github.com/jmoiron/sqlx" + "github.com/smartcontractkit/libocr/gethwrappers2/ocr2aggregator" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log" diff --git a/core/services/relay/evm/types/types.go b/core/services/relay/evm/types/types.go index 6a1e66bd096..d2edef8b118 100644 --- a/core/services/relay/evm/types/types.go +++ b/core/services/relay/evm/types/types.go @@ -13,9 +13,9 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/services" - "github.com/smartcontractkit/chainlink-relay/pkg/types" - relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/types" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -36,7 +36,7 @@ type RelayConfig struct { type RelayOpts struct { // TODO BCF-2508 -- should anyone ever get the raw config bytes that are embedded in args? if not, // make this private and wrap the arg fields with funcs on RelayOpts - relaytypes.RelayArgs + commontypes.RelayArgs c *RelayConfig } @@ -71,9 +71,9 @@ type ConfigPoller interface { Replay(ctx context.Context, fromBlock int64) error } -// TODO(FUN-668): Migrate this fully into relaytypes.FunctionsProvider +// TODO(FUN-668): Migrate this fully into commontypes.FunctionsProvider type FunctionsProvider interface { - relaytypes.FunctionsProvider + commontypes.FunctionsProvider LogPollerWrapper() LogPollerWrapper } diff --git a/core/services/relay/grpc_provider_server.go b/core/services/relay/grpc_provider_server.go index 943af0e6362..67bbb8c6c2a 100644 --- a/core/services/relay/grpc_provider_server.go +++ b/core/services/relay/grpc_provider_server.go @@ -8,8 +8,8 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/logger" ) diff --git a/core/services/relay/grpc_provider_server_test.go b/core/services/relay/grpc_provider_server_test.go index e7ee8d7f150..fafe20ef12a 100644 --- a/core/services/relay/grpc_provider_server_test.go +++ b/core/services/relay/grpc_provider_server_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/logger" ) diff --git a/core/services/relay/relay.go b/core/services/relay/relay.go index 5c7bf5cab57..eb6d3faf4fd 100644 --- a/core/services/relay/relay.go +++ b/core/services/relay/relay.go @@ -5,8 +5,8 @@ import ( "fmt" "regexp" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) type Network = string diff --git a/core/services/relay/relay_test.go b/core/services/relay/relay_test.go index 5bcd14c64a0..fc9e273e302 100644 --- a/core/services/relay/relay_test.go +++ b/core/services/relay/relay_test.go @@ -4,12 +4,13 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/stretchr/testify/assert" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) func TestIdentifier_UnmarshalString(t *testing.T) { diff --git a/core/services/service.go b/core/services/service.go index 066405ac012..19ca1183738 100644 --- a/core/services/service.go +++ b/core/services/service.go @@ -1,7 +1,7 @@ package services import ( - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" ) type ServiceCtx = services.Service diff --git a/core/services/synchronization/telemetry_ingress_batch_client.go b/core/services/synchronization/telemetry_ingress_batch_client.go index 26abda65d33..c551ac85b3e 100644 --- a/core/services/synchronization/telemetry_ingress_batch_client.go +++ b/core/services/synchronization/telemetry_ingress_batch_client.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/wsrpc" "github.com/smartcontractkit/wsrpc/examples/simple/keys" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" telemPb "github.com/smartcontractkit/chainlink/v2/core/services/synchronization/telem" diff --git a/core/services/synchronization/telemetry_ingress_client.go b/core/services/synchronization/telemetry_ingress_client.go index 9458b7627c9..b889b3fc97a 100644 --- a/core/services/synchronization/telemetry_ingress_client.go +++ b/core/services/synchronization/telemetry_ingress_client.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/wsrpc" "github.com/smartcontractkit/wsrpc/examples/simple/keys" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" telemPb "github.com/smartcontractkit/chainlink/v2/core/services/synchronization/telem" diff --git a/core/services/telemetry/manager.go b/core/services/telemetry/manager.go index cc14a956c12..d760d13b2b0 100644 --- a/core/services/telemetry/manager.go +++ b/core/services/telemetry/manager.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/libocr/commontypes" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" diff --git a/core/services/telemetry/manager_test.go b/core/services/telemetry/manager_test.go index 2d51d9f4491..d24fb348b75 100644 --- a/core/services/telemetry/manager_test.go +++ b/core/services/telemetry/manager_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/config/mocks" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" diff --git a/core/services/vrf/solidity_cross_tests/vrf_coordinator_interface.go b/core/services/vrf/solidity_cross_tests/vrf_coordinator_interface.go index a8e662c9318..35556c6b45f 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_coordinator_interface.go +++ b/core/services/vrf/solidity_cross_tests/vrf_coordinator_interface.go @@ -7,7 +7,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/solidity_vrf_coordinator_interface" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/services/vrf/v1/listener_v1.go b/core/services/vrf/v1/listener_v1.go index b1f9bbb5034..566e5ac9bd8 100644 --- a/core/services/vrf/v1/listener_v1.go +++ b/core/services/vrf/v1/listener_v1.go @@ -16,7 +16,7 @@ import ( heaps "github.com/theodesp/go-heaps" "github.com/theodesp/go-heaps/pairing" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/log" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" diff --git a/core/services/vrf/v2/integration_v2_test.go b/core/services/vrf/v2/integration_v2_test.go index df886924aa1..15121ba306c 100644 --- a/core/services/vrf/v2/integration_v2_test.go +++ b/core/services/vrf/v2/integration_v2_test.go @@ -30,7 +30,7 @@ import ( "github.com/jmoiron/sqlx" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" @@ -1462,7 +1462,7 @@ func simulatedOverrides(t *testing.T, defaultGasPrice *assets.Wei, ks ...toml.Ke c.EVM[0].FinalityDepth = ptr[uint32](15) c.EVM[0].MinIncomingConfirmations = ptr[uint32](1) - c.EVM[0].MinContractPayment = relayassets.NewLinkFromJuels(100) + c.EVM[0].MinContractPayment = commonassets.NewLinkFromJuels(100) c.EVM[0].KeySpecific = ks } } diff --git a/core/services/vrf/v2/listener_v2.go b/core/services/vrf/v2/listener_v2.go index 3480f63f092..5b73ac9e24c 100644 --- a/core/services/vrf/v2/listener_v2.go +++ b/core/services/vrf/v2/listener_v2.go @@ -25,7 +25,7 @@ import ( "github.com/theodesp/go-heaps/pairing" "go.uber.org/multierr" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" txmgrcommon "github.com/smartcontractkit/chainlink/v2/common/txmgr" txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" diff --git a/core/store/migrate/migrate_test.go b/core/store/migrate/migrate_test.go index 0ff09000161..43ddd41d56f 100644 --- a/core/store/migrate/migrate_test.go +++ b/core/store/migrate/migrate_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v4" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" evmcfg "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" diff --git a/core/utils/big.go b/core/utils/big.go index f0f9a2d96df..22cd8e64e55 100644 --- a/core/utils/big.go +++ b/core/utils/big.go @@ -8,7 +8,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/smartcontractkit/chainlink-relay/pkg/utils/bytes" + "github.com/smartcontractkit/chainlink-common/pkg/utils/bytes" bigmath "github.com/smartcontractkit/chainlink/v2/core/utils/big_math" ) diff --git a/core/utils/config/validate.go b/core/utils/config/validate.go index 32cb94b5205..5fbae24ad53 100644 --- a/core/utils/config/validate.go +++ b/core/utils/config/validate.go @@ -9,7 +9,7 @@ import ( "github.com/Masterminds/semver/v3" "go.uber.org/multierr" - "github.com/smartcontractkit/chainlink-relay/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/utils/mailbox_prom.go b/core/utils/mailbox_prom.go index dc20db84d9d..33cbb2357b1 100644 --- a/core/utils/mailbox_prom.go +++ b/core/utils/mailbox_prom.go @@ -10,7 +10,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" ) var mailboxLoad = promauto.NewGaugeVec(prometheus.GaugeOpts{ diff --git a/core/utils/sleeper_task.go b/core/utils/sleeper_task.go index fcec2542493..d84457e9325 100644 --- a/core/utils/sleeper_task.go +++ b/core/utils/sleeper_task.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" ) // SleeperTask represents a task that waits in the background to process some work. diff --git a/core/utils/utils.go b/core/utils/utils.go index 6ea7164df1e..a2e418fe046 100644 --- a/core/utils/utils.go +++ b/core/utils/utils.go @@ -32,7 +32,7 @@ import ( "golang.org/x/crypto/bcrypt" "golang.org/x/crypto/sha3" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" ) const ( diff --git a/core/web/bridge_types_controller.go b/core/web/bridge_types_controller.go index 57a79e2b611..f320a525234 100644 --- a/core/web/bridge_types_controller.go +++ b/core/web/bridge_types_controller.go @@ -8,7 +8,7 @@ import ( "github.com/jackc/pgconn" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/logger/audit" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" diff --git a/core/web/bridge_types_controller_test.go b/core/web/bridge_types_controller_test.go index a65362ba9aa..a7873ad9f75 100644 --- a/core/web/bridge_types_controller_test.go +++ b/core/web/bridge_types_controller_test.go @@ -6,7 +6,7 @@ import ( "net/http" "testing" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" diff --git a/core/web/chains_controller.go b/core/web/chains_controller.go index c11d457c49c..e547cf0150e 100644 --- a/core/web/chains_controller.go +++ b/core/web/chains_controller.go @@ -7,7 +7,7 @@ import ( "github.com/gin-gonic/gin" "github.com/manyminds/api2go/jsonapi" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/logger/audit" diff --git a/core/web/cosmos_chains_controller_test.go b/core/web/cosmos_chains_controller_test.go index f8dbe4614fa..5491b33c359 100644 --- a/core/web/cosmos_chains_controller_test.go +++ b/core/web/cosmos_chains_controller_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/pkg/types" coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config" - "github.com/smartcontractkit/chainlink-relay/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" diff --git a/core/web/eth_keys_controller.go b/core/web/eth_keys_controller.go index 6e2a3b2efc4..b202d90f21e 100644 --- a/core/web/eth_keys_controller.go +++ b/core/web/eth_keys_controller.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/config/toml" @@ -365,13 +365,13 @@ func (ekc *ETHKeysController) getEthBalance(ctx context.Context, state ethkey.St } -func (ekc *ETHKeysController) setLinkBalance(bal *relayassets.Link) presenters.NewETHKeyOption { +func (ekc *ETHKeysController) setLinkBalance(bal *commonassets.Link) presenters.NewETHKeyOption { return presenters.SetETHKeyLinkBalance(bal) } // queries the EthClient for the LINK balance at the address associated with state -func (ekc *ETHKeysController) getLinkBalance(ctx context.Context, state ethkey.State) *relayassets.Link { - var bal *relayassets.Link +func (ekc *ETHKeysController) getLinkBalance(ctx context.Context, state ethkey.State) *commonassets.Link { + var bal *commonassets.Link chainID := state.EVMChainID.ToInt() chain, err := ekc.app.GetRelayers().LegacyEVMChains().Get(chainID.String()) if err != nil { diff --git a/core/web/eth_keys_controller_test.go b/core/web/eth_keys_controller_test.go index 8941c2d2fdc..d0ad27262f2 100644 --- a/core/web/eth_keys_controller_test.go +++ b/core/web/eth_keys_controller_test.go @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" commontxmmocks "github.com/smartcontractkit/chainlink/v2/common/txmgr/types/mocks" commonmocks "github.com/smartcontractkit/chainlink/v2/common/types/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" diff --git a/core/web/loader/getters.go b/core/web/loader/getters.go index 8ca29cc9624..27a39181ff8 100644 --- a/core/web/loader/getters.go +++ b/core/web/loader/getters.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" "go.uber.org/multierr" - relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -21,7 +21,7 @@ import ( var ErrInvalidType = errors.New("invalid type") // GetChainByID fetches the chain by it's id. -func GetChainByID(ctx context.Context, id string) (*relaytypes.ChainStatus, error) { +func GetChainByID(ctx context.Context, id string) (*commontypes.ChainStatus, error) { ldr := For(ctx) thunk := ldr.ChainsByIDLoader.Load(ctx, dataloader.StringKey(id)) @@ -30,7 +30,7 @@ func GetChainByID(ctx context.Context, id string) (*relaytypes.ChainStatus, erro return nil, err } - chain, ok := result.(relaytypes.ChainStatus) + chain, ok := result.(commontypes.ChainStatus) if !ok { return nil, ErrInvalidType } diff --git a/core/web/loader/loader_test.go b/core/web/loader/loader_test.go index 984aa9f6189..9bd1feb05bf 100644 --- a/core/web/loader/loader_test.go +++ b/core/web/loader/loader_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - relaytypes "github.com/smartcontractkit/chainlink-relay/pkg/types" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/chains" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" @@ -50,12 +50,12 @@ func TestLoader_Chains(t *testing.T) { assert.Len(t, results, 3) config2, err := chain2.TOMLString() require.NoError(t, err) - want2 := relaytypes.ChainStatus{ID: "2", Enabled: true, Config: config2} - assert.Equal(t, want2, results[0].Data.(relaytypes.ChainStatus)) + want2 := commontypes.ChainStatus{ID: "2", Enabled: true, Config: config2} + assert.Equal(t, want2, results[0].Data.(commontypes.ChainStatus)) config1, err := chain.TOMLString() require.NoError(t, err) - want1 := relaytypes.ChainStatus{ID: "1", Enabled: true, Config: config1} - assert.Equal(t, want1, results[1].Data.(relaytypes.ChainStatus)) + want1 := commontypes.ChainStatus{ID: "1", Enabled: true, Config: config1} + assert.Equal(t, want1, results[1].Data.(commontypes.ChainStatus)) assert.Nil(t, results[2].Data) assert.Error(t, results[2].Error) assert.ErrorIs(t, results[2].Error, chains.ErrNotFound) @@ -69,13 +69,13 @@ func TestLoader_Nodes(t *testing.T) { chainID1, chainID2, notAnID := big.NewInt(1), big.NewInt(2), big.NewInt(3) - genNodeStat := func(id string) relaytypes.NodeStatus { - return relaytypes.NodeStatus{ + genNodeStat := func(id string) commontypes.NodeStatus { + return commontypes.NodeStatus{ Name: "test-node-" + id, ChainID: id, } } - rcInterops := &chainlinkmocks.FakeRelayerChainInteroperators{Nodes: []relaytypes.NodeStatus{ + rcInterops := &chainlinkmocks.FakeRelayerChainInteroperators{Nodes: []commontypes.NodeStatus{ genNodeStat(chainID2.String()), genNodeStat(chainID1.String()), }} @@ -86,9 +86,9 @@ func TestLoader_Nodes(t *testing.T) { found := batcher.loadByChainIDs(ctx, keys) require.Len(t, found, 3) - assert.Equal(t, []relaytypes.NodeStatus{genNodeStat(chainID2.String())}, found[0].Data) - assert.Equal(t, []relaytypes.NodeStatus{genNodeStat(chainID1.String())}, found[1].Data) - assert.Equal(t, []relaytypes.NodeStatus{}, found[2].Data) + assert.Equal(t, []commontypes.NodeStatus{genNodeStat(chainID2.String())}, found[0].Data) + assert.Equal(t, []commontypes.NodeStatus{genNodeStat(chainID1.String())}, found[1].Data) + assert.Equal(t, []commontypes.NodeStatus{}, found[2].Data) } func TestLoader_FeedsManagers(t *testing.T) { diff --git a/core/web/loader/node.go b/core/web/loader/node.go index 9ea6062dc29..ef8e363d9f3 100644 --- a/core/web/loader/node.go +++ b/core/web/loader/node.go @@ -5,7 +5,7 @@ import ( "github.com/graph-gophers/dataloader" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/relay" diff --git a/core/web/loop_registry_test.go b/core/web/loop_registry_test.go index ea766725641..94e2bc856d6 100644 --- a/core/web/loop_registry_test.go +++ b/core/web/loop_registry_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" diff --git a/core/web/nodes_controller.go b/core/web/nodes_controller.go index 3547b150bc7..04c4693983f 100644 --- a/core/web/nodes_controller.go +++ b/core/web/nodes_controller.go @@ -7,7 +7,7 @@ import ( "github.com/gin-gonic/gin" "github.com/manyminds/api2go/jsonapi" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/logger/audit" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" diff --git a/core/web/presenters/bridges.go b/core/web/presenters/bridges.go index 440e444c613..82f4a961c94 100644 --- a/core/web/presenters/bridges.go +++ b/core/web/presenters/bridges.go @@ -3,7 +3,7 @@ package presenters import ( "time" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/bridges" ) diff --git a/core/web/presenters/bridges_test.go b/core/web/presenters/bridges_test.go index f6ce3af7561..746d361958a 100644 --- a/core/web/presenters/bridges_test.go +++ b/core/web/presenters/bridges_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/store/models" ) diff --git a/core/web/presenters/cosmos_chain.go b/core/web/presenters/cosmos_chain.go index d65a110287d..c3b006e5c7e 100644 --- a/core/web/presenters/cosmos_chain.go +++ b/core/web/presenters/cosmos_chain.go @@ -1,7 +1,7 @@ package presenters import ( - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) // CosmosChainResource is an Cosmos chain JSONAPI resource. diff --git a/core/web/presenters/eth_key.go b/core/web/presenters/eth_key.go index 92654427619..3d952dabeda 100644 --- a/core/web/presenters/eth_key.go +++ b/core/web/presenters/eth_key.go @@ -3,7 +3,7 @@ package presenters import ( "time" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/utils" @@ -13,14 +13,14 @@ import ( // representation of the address plus its ETH & LINK balances type ETHKeyResource struct { JAID - EVMChainID utils.Big `json:"evmChainID"` - Address string `json:"address"` - EthBalance *assets.Eth `json:"ethBalance"` - LinkBalance *relayassets.Link `json:"linkBalance"` - Disabled bool `json:"disabled"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` - MaxGasPriceWei *utils.Big `json:"maxGasPriceWei"` + EVMChainID utils.Big `json:"evmChainID"` + Address string `json:"address"` + EthBalance *assets.Eth `json:"ethBalance"` + LinkBalance *commonassets.Link `json:"linkBalance"` + Disabled bool `json:"disabled"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` + MaxGasPriceWei *utils.Big `json:"maxGasPriceWei"` } // GetName implements the api2go EntityNamer interface @@ -63,7 +63,7 @@ func SetETHKeyEthBalance(ethBalance *assets.Eth) NewETHKeyOption { } } -func SetETHKeyLinkBalance(linkBalance *relayassets.Link) NewETHKeyOption { +func SetETHKeyLinkBalance(linkBalance *commonassets.Link) NewETHKeyOption { return func(r *ETHKeyResource) { r.LinkBalance = linkBalance } diff --git a/core/web/presenters/eth_key_test.go b/core/web/presenters/eth_key_test.go index 0e68fbc90c9..85d005cf610 100644 --- a/core/web/presenters/eth_key_test.go +++ b/core/web/presenters/eth_key_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/utils" @@ -40,12 +40,12 @@ func TestETHKeyResource(t *testing.T) { r := NewETHKeyResource(key, state, SetETHKeyEthBalance(assets.NewEth(1)), - SetETHKeyLinkBalance(relayassets.NewLinkFromJuels(1)), + SetETHKeyLinkBalance(commonassets.NewLinkFromJuels(1)), SetETHKeyMaxGasPriceWei(utils.NewBigI(12345)), ) assert.Equal(t, assets.NewEth(1), r.EthBalance) - assert.Equal(t, relayassets.NewLinkFromJuels(1), r.LinkBalance) + assert.Equal(t, commonassets.NewLinkFromJuels(1), r.LinkBalance) assert.Equal(t, utils.NewBigI(12345), r.MaxGasPriceWei) b, err := jsonapi.Marshal(r) diff --git a/core/web/presenters/evm_chain.go b/core/web/presenters/evm_chain.go index 25862875ee9..8cc6da46a77 100644 --- a/core/web/presenters/evm_chain.go +++ b/core/web/presenters/evm_chain.go @@ -1,6 +1,6 @@ package presenters -import "github.com/smartcontractkit/chainlink-relay/pkg/types" +import "github.com/smartcontractkit/chainlink-common/pkg/types" // EVMChainResource is an EVM chain JSONAPI resource. type EVMChainResource struct { diff --git a/core/web/presenters/job.go b/core/web/presenters/job.go index d9ec1844aea..dc5bf623330 100644 --- a/core/web/presenters/job.go +++ b/core/web/presenters/job.go @@ -7,7 +7,7 @@ import ( "github.com/lib/pq" "gopkg.in/guregu/null.v4" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" clnull "github.com/smartcontractkit/chainlink/v2/core/null" "github.com/smartcontractkit/chainlink/v2/core/services/job" @@ -44,7 +44,7 @@ const ( type DirectRequestSpec struct { ContractAddress ethkey.EIP55Address `json:"contractAddress"` MinIncomingConfirmations clnull.Uint32 `json:"minIncomingConfirmations"` - MinContractPayment *relayassets.Link `json:"minContractPaymentLinkJuels"` + MinContractPayment *commonassets.Link `json:"minContractPaymentLinkJuels"` Requesters models.AddressCollection `json:"requesters"` Initiator string `json:"initiator"` CreatedAt time.Time `json:"createdAt"` @@ -81,7 +81,7 @@ type FluxMonitorSpec struct { DrumbeatEnabled bool `json:"drumbeatEnabled"` DrumbeatSchedule *string `json:"drumbeatSchedule"` DrumbeatRandomDelay *string `json:"drumbeatRandomDelay"` - MinPayment *relayassets.Link `json:"minPayment"` + MinPayment *commonassets.Link `json:"minPayment"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` EVMChainID *utils.Big `json:"evmChainID"` diff --git a/core/web/presenters/job_test.go b/core/web/presenters/job_test.go index 46c765a38b2..7e997c899c5 100644 --- a/core/web/presenters/job_test.go +++ b/core/web/presenters/job_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v4" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" clnull "github.com/smartcontractkit/chainlink/v2/core/null" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" diff --git a/core/web/presenters/solana_chain.go b/core/web/presenters/solana_chain.go index ba6cace7c3d..f04d2b65d55 100644 --- a/core/web/presenters/solana_chain.go +++ b/core/web/presenters/solana_chain.go @@ -1,7 +1,7 @@ package presenters import ( - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) // SolanaChainResource is an Solana chain JSONAPI resource. diff --git a/core/web/presenters/starknet_chain.go b/core/web/presenters/starknet_chain.go index 2a9e49e74c5..ec1cd453a55 100644 --- a/core/web/presenters/starknet_chain.go +++ b/core/web/presenters/starknet_chain.go @@ -1,7 +1,7 @@ package presenters import ( - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) // StarkNetChainResource is an StarkNet chain JSONAPI resource. diff --git a/core/web/resolver/bridge_test.go b/core/web/resolver/bridge_test.go index e708ac92a42..71ef4a2b340 100644 --- a/core/web/resolver/bridge_test.go +++ b/core/web/resolver/bridge_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/store/models" ) diff --git a/core/web/resolver/chain.go b/core/web/resolver/chain.go index 53f1016d72b..32e9a8caac3 100644 --- a/core/web/resolver/chain.go +++ b/core/web/resolver/chain.go @@ -3,7 +3,7 @@ package resolver import ( "github.com/graph-gophers/graphql-go" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) // ChainResolver resolves the Chain type. diff --git a/core/web/resolver/eth_key_test.go b/core/web/resolver/eth_key_test.go index f8f417ca44b..d75282e0fbd 100644 --- a/core/web/resolver/eth_key_test.go +++ b/core/web/resolver/eth_key_test.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/mock" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" @@ -96,7 +96,7 @@ func TestResolver_ETHKeys(t *testing.T) { f.Mocks.ethKs.On("GetStatesForKeys", keys).Return(states, nil) f.Mocks.ethKs.On("Get", keys[0].Address.Hex()).Return(keys[0], nil) f.Mocks.ethKs.On("GetAll").Return(keys, nil) - f.Mocks.ethClient.On("LINKBalance", mock.Anything, address, linkAddr).Return(relayassets.NewLinkFromJuels(12), nil) + f.Mocks.ethClient.On("LINKBalance", mock.Anything, address, linkAddr).Return(commonassets.NewLinkFromJuels(12), nil) f.Mocks.chain.On("Client").Return(f.Mocks.ethClient) f.Mocks.balM.On("GetEthBalance", address).Return(assets.NewEth(1)) f.Mocks.chain.On("BalanceMonitor").Return(f.Mocks.balM) @@ -301,7 +301,7 @@ func TestResolver_ETHKeys(t *testing.T) { f.Mocks.ethKs.On("Get", keys[0].Address.Hex()).Return(keys[0], nil) f.Mocks.ethKs.On("GetAll").Return(keys, nil) f.Mocks.keystore.On("Eth").Return(f.Mocks.ethKs) - f.Mocks.ethClient.On("LINKBalance", mock.Anything, address, linkAddr).Return(relayassets.NewLinkFromJuels(12), gError) + f.Mocks.ethClient.On("LINKBalance", mock.Anything, address, linkAddr).Return(commonassets.NewLinkFromJuels(12), gError) f.Mocks.legacyEVMChains.On("Get", states[0].EVMChainID.String()).Return(f.Mocks.chain, nil) f.Mocks.relayerChainInterops.EVMChains = f.Mocks.legacyEVMChains f.Mocks.chain.On("Client").Return(f.Mocks.ethClient) @@ -354,7 +354,7 @@ func TestResolver_ETHKeys(t *testing.T) { f.Mocks.ethKs.On("GetStatesForKeys", keys).Return(states, nil) f.Mocks.ethKs.On("Get", keys[0].Address.Hex()).Return(keys[0], nil) f.Mocks.ethKs.On("GetAll").Return(keys, nil) - f.Mocks.ethClient.On("LINKBalance", mock.Anything, address, linkAddr).Return(relayassets.NewLinkFromJuels(12), nil) + f.Mocks.ethClient.On("LINKBalance", mock.Anything, address, linkAddr).Return(commonassets.NewLinkFromJuels(12), nil) f.Mocks.chain.On("Client").Return(f.Mocks.ethClient) f.Mocks.chain.On("BalanceMonitor").Return(nil) f.Mocks.chain.On("Config").Return(f.Mocks.scfg) diff --git a/core/web/resolver/helpers.go b/core/web/resolver/helpers.go index 2dc865674e2..36080a8b546 100644 --- a/core/web/resolver/helpers.go +++ b/core/web/resolver/helpers.go @@ -8,7 +8,7 @@ import ( "github.com/graph-gophers/graphql-go" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/utils/stringutils" ) diff --git a/core/web/resolver/mutation.go b/core/web/resolver/mutation.go index 52f914e0a84..990a6c08058 100644 --- a/core/web/resolver/mutation.go +++ b/core/web/resolver/mutation.go @@ -13,7 +13,7 @@ import ( "go.uber.org/zap/zapcore" "gopkg.in/guregu/null.v4" - "github.com/smartcontractkit/chainlink-relay/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/auth" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/logger/audit" diff --git a/core/web/resolver/node.go b/core/web/resolver/node.go index 39a85e83b13..8e01b7056be 100644 --- a/core/web/resolver/node.go +++ b/core/web/resolver/node.go @@ -7,7 +7,7 @@ import ( "github.com/graph-gophers/graphql-go" "github.com/pelletier/go-toml/v2" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" evmtoml "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" "github.com/smartcontractkit/chainlink/v2/core/web/loader" diff --git a/core/web/resolver/node_test.go b/core/web/resolver/node_test.go index 9f34b274201..24a31b986f1 100644 --- a/core/web/resolver/node_test.go +++ b/core/web/resolver/node_test.go @@ -6,7 +6,7 @@ import ( gqlerrors "github.com/graph-gophers/graphql-go/errors" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/store/models" diff --git a/core/web/resolver/query.go b/core/web/resolver/query.go index e9fd18cf19a..da15b7f7c26 100644 --- a/core/web/resolver/query.go +++ b/core/web/resolver/query.go @@ -10,7 +10,7 @@ import ( "github.com/graph-gophers/graphql-go" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/chains" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" diff --git a/core/web/resolver/spec_test.go b/core/web/resolver/spec_test.go index fd369088bb8..4de66f1dcb1 100644 --- a/core/web/resolver/spec_test.go +++ b/core/web/resolver/spec_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v4" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" clnull "github.com/smartcontractkit/chainlink/v2/core/null" @@ -97,7 +97,7 @@ func TestResolver_DirectRequestSpec(t *testing.T) { CreatedAt: f.Timestamp(), EVMChainID: utils.NewBigI(42), MinIncomingConfirmations: clnull.NewUint32(1, true), - MinContractPayment: relayassets.NewLinkFromJuels(1000), + MinContractPayment: commonassets.NewLinkFromJuels(1000), Requesters: models.AddressCollection{requesterAddress}, }, }, nil) @@ -164,7 +164,7 @@ func TestResolver_FluxMonitorSpec(t *testing.T) { DrumbeatEnabled: false, IdleTimerDisabled: false, IdleTimerPeriod: time.Duration(1 * time.Hour), - MinPayment: relayassets.NewLinkFromJuels(1000), + MinPayment: commonassets.NewLinkFromJuels(1000), PollTimerDisabled: false, PollTimerPeriod: time.Duration(1 * time.Minute), }, @@ -233,7 +233,7 @@ func TestResolver_FluxMonitorSpec(t *testing.T) { DrumbeatSchedule: "CRON_TZ=UTC 0 0 1 1 *", IdleTimerDisabled: true, IdleTimerPeriod: time.Duration(1 * time.Hour), - MinPayment: relayassets.NewLinkFromJuels(1000), + MinPayment: commonassets.NewLinkFromJuels(1000), PollTimerDisabled: true, PollTimerPeriod: time.Duration(1 * time.Minute), }, diff --git a/core/web/solana_chains_controller_test.go b/core/web/solana_chains_controller_test.go index c4023f166bb..1377cb65aba 100644 --- a/core/web/solana_chains_controller_test.go +++ b/core/web/solana_chains_controller_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - relaycfg "github.com/smartcontractkit/chainlink-relay/pkg/config" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + commoncfg "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" "github.com/smartcontractkit/chainlink-solana/pkg/solana" @@ -84,7 +84,7 @@ Nodes = [] ChainID: ptr(validId), Chain: config.Chain{ SkipPreflight: ptr(false), - TxTimeout: relaycfg.MustNewDuration(time.Hour), + TxTimeout: commoncfg.MustNewDuration(time.Hour), }, }) @@ -114,7 +114,7 @@ func Test_SolanaChainsController_Index(t *testing.T) { chainA := &solana.TOMLConfig{ ChainID: ptr(fmt.Sprintf("ChainlinktestA-%d", rand.Int31n(999999))), Chain: config.Chain{ - TxTimeout: relaycfg.MustNewDuration(time.Hour), + TxTimeout: commoncfg.MustNewDuration(time.Hour), }, } chainB := &solana.TOMLConfig{ diff --git a/go.mod b/go.mod index 40803d504ce..784d3ff78e1 100644 --- a/go.mod +++ b/go.mod @@ -65,10 +65,10 @@ require ( github.com/shirou/gopsutil/v3 v3.23.9 github.com/shopspring/decimal v1.3.1 github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 - github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255 - github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231115124244-8303409abccd - github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05 - github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb + github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e + github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542 + github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231117191230-aa6640f2edd1 + github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231117204155-b253a2f56664 github.com/smartcontractkit/libocr v0.0.0-20231107151413-13e0202ae8d7 github.com/smartcontractkit/ocr2keepers v0.7.28 github.com/smartcontractkit/ocr2vrf v0.0.0-20230804151440-2f1eb1e20687 diff --git a/go.sum b/go.sum index 52975e722a4..fb09e792d6d 100644 --- a/go.sum +++ b/go.sum @@ -1463,14 +1463,14 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumvbfM1u/etVq42Afwq/jtNSBSOA8n5jntnNPo= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255 h1:Pt6c7bJU9wIN6PQQnmN8UmYYH6lpfiQ6U/B8yEC2s5s= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255/go.mod h1:EHppaccd/LTlTMI2o4dmBHe4BknEgEFFDjDGMNuGb3k= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231115124244-8303409abccd h1:PRVJxNK67pQWufXuB1cxckH/xZkcQFDy8KjN9ZYqong= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231115124244-8303409abccd/go.mod h1:rOayi690YxLlkQy959PD8INhOAIAUi9LoN0G+J/CEf4= -github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05 h1:DaPSVnxe7oz1QJ+AVIhQWs1W3ubQvwvGo9NbHpMs1OQ= -github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05/go.mod h1:o0Pn1pbaUluboaK6/yhf8xf7TiFCkyFl6WUOdwqamuU= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb h1:HiluOfEVGOQTM6BTDImOqYdMZZ7qq7fkZ3TJdmItNr8= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb/go.mod h1:/30flFG4L/iCYAFeA3DUzR0xuHSxAMONiWTzyzvsNwo= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e h1:Fsx5IJDD14wdCAe2lEI1xgztIvzjiE2iVHvYzg/grew= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e/go.mod h1:Hrru9i7n+WEYyW2aIt3/YGPhxLX+HEGWnhk3yVXeDF8= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542 h1:oewYJtdRkJKUHCNDCj5C2LQe6Oq6qy975g931nfG0cc= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542/go.mod h1:EpvRoycRD+kniYlz+pCpRT5e+fmPm0mSD/vmND+0oMg= +github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231117191230-aa6640f2edd1 h1:D7yb4kgNGVAiD5lFYqm/LW8d5jU66TXyYvSskDiW9yg= +github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231117191230-aa6640f2edd1/go.mod h1:UfW7/PZKon+iDEHtrHOfvMnS5GfYOW/SdMZ6P97rPEk= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231117204155-b253a2f56664 h1:yxaHuDTtj2xxtsR8b+LJw8xDvyr6v/F6GP3InsP4wPI= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231117204155-b253a2f56664/go.mod h1:3Fa+HQTZ3R3fPC0hUqugvoo+NEeo8Y4J2WOnQfi7O34= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= diff --git a/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go b/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go index f48d4157922..fd15d51af4e 100644 --- a/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go +++ b/integration-tests/actions/vrfv2plus/vrfv2plus_steps.go @@ -9,7 +9,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/utils/conversions" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrfv2plus_wrapper_load_test_consumer" @@ -869,7 +869,7 @@ func retreiveLoadTestMetrics( func LogSubDetails(l zerolog.Logger, subscription vrf_coordinator_v2_5.GetSubscription, subID *big.Int, coordinator contracts.VRFCoordinatorV2_5) { l.Debug(). Str("Coordinator", coordinator.Address()). - Str("Link Balance", (*relayassets.Link)(subscription.Balance).Link()). + Str("Link Balance", (*commonassets.Link)(subscription.Balance).Link()). Str("Native Token Balance", assets.FormatWei(subscription.NativeBalance)). Str("Subscription ID", subID.String()). Str("Subscription Owner", subscription.Owner.String()). @@ -972,11 +972,11 @@ func LogFulfillmentDetailsLinkBilling( randomWordsFulfilledEvent *vrf_coordinator_v2_5.VRFCoordinatorV25RandomWordsFulfilled, ) { l.Debug(). - Str("Consumer Balance Before Request (Link)", (*relayassets.Link)(wrapperConsumerJuelsBalanceBeforeRequest).Link()). - Str("Consumer Balance After Request (Link)", (*relayassets.Link)(wrapperConsumerJuelsBalanceAfterRequest).Link()). + Str("Consumer Balance Before Request (Link)", (*commonassets.Link)(wrapperConsumerJuelsBalanceBeforeRequest).Link()). + Str("Consumer Balance After Request (Link)", (*commonassets.Link)(wrapperConsumerJuelsBalanceAfterRequest).Link()). Bool("Fulfilment Status", consumerStatus.Fulfilled). - Str("Paid by Consumer Contract (Link)", (*relayassets.Link)(consumerStatus.Paid).Link()). - Str("Paid by Coordinator Sub (Link)", (*relayassets.Link)(randomWordsFulfilledEvent.Payment).Link()). + Str("Paid by Consumer Contract (Link)", (*commonassets.Link)(consumerStatus.Paid).Link()). + Str("Paid by Coordinator Sub (Link)", (*commonassets.Link)(randomWordsFulfilledEvent.Payment).Link()). Str("RequestTimestamp", consumerStatus.RequestTimestamp.String()). Str("FulfilmentTimestamp", consumerStatus.FulfilmentTimestamp.String()). Str("RequestBlockNumber", consumerStatus.RequestBlockNumber.String()). diff --git a/integration-tests/go.mod b/integration-tests/go.mod index aed5e0682cb..3b1a5423df8 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -22,7 +22,7 @@ require ( github.com/scylladb/go-reflectx v1.0.1 github.com/segmentio/ksuid v1.0.4 github.com/slack-go/slack v0.12.2 - github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231115124244-8303409abccd + github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e github.com/smartcontractkit/chainlink-testing-framework v1.19.1 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20231107151413-13e0202ae8d7 @@ -387,9 +387,9 @@ require ( github.com/shopspring/decimal v1.3.1 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect - github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255 // indirect - github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05 // indirect - github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb // indirect + github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542 // indirect + github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231117191230-aa6640f2edd1 // indirect + github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231117204155-b253a2f56664 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect github.com/smartcontractkit/wsrpc v0.7.2 // indirect github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 896ae8c6d27..427ad1421c9 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -2367,14 +2367,14 @@ github.com/slack-go/slack v0.12.2 h1:x3OppyMyGIbbiyFhsBmpf9pwkUzMhthJMRNmNlA4LaQ github.com/slack-go/slack v0.12.2/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumvbfM1u/etVq42Afwq/jtNSBSOA8n5jntnNPo= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255 h1:Pt6c7bJU9wIN6PQQnmN8UmYYH6lpfiQ6U/B8yEC2s5s= -github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255/go.mod h1:EHppaccd/LTlTMI2o4dmBHe4BknEgEFFDjDGMNuGb3k= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231115124244-8303409abccd h1:PRVJxNK67pQWufXuB1cxckH/xZkcQFDy8KjN9ZYqong= -github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231115124244-8303409abccd/go.mod h1:rOayi690YxLlkQy959PD8INhOAIAUi9LoN0G+J/CEf4= -github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05 h1:DaPSVnxe7oz1QJ+AVIhQWs1W3ubQvwvGo9NbHpMs1OQ= -github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05/go.mod h1:o0Pn1pbaUluboaK6/yhf8xf7TiFCkyFl6WUOdwqamuU= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb h1:HiluOfEVGOQTM6BTDImOqYdMZZ7qq7fkZ3TJdmItNr8= -github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb/go.mod h1:/30flFG4L/iCYAFeA3DUzR0xuHSxAMONiWTzyzvsNwo= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e h1:Fsx5IJDD14wdCAe2lEI1xgztIvzjiE2iVHvYzg/grew= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20231117021201-6814387d8d3e/go.mod h1:Hrru9i7n+WEYyW2aIt3/YGPhxLX+HEGWnhk3yVXeDF8= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542 h1:oewYJtdRkJKUHCNDCj5C2LQe6Oq6qy975g931nfG0cc= +github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231117191236-12eab01a4542/go.mod h1:EpvRoycRD+kniYlz+pCpRT5e+fmPm0mSD/vmND+0oMg= +github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231117191230-aa6640f2edd1 h1:D7yb4kgNGVAiD5lFYqm/LW8d5jU66TXyYvSskDiW9yg= +github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231117191230-aa6640f2edd1/go.mod h1:UfW7/PZKon+iDEHtrHOfvMnS5GfYOW/SdMZ6P97rPEk= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231117204155-b253a2f56664 h1:yxaHuDTtj2xxtsR8b+LJw8xDvyr6v/F6GP3InsP4wPI= +github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231117204155-b253a2f56664/go.mod h1:3Fa+HQTZ3R3fPC0hUqugvoo+NEeo8Y4J2WOnQfi7O34= github.com/smartcontractkit/chainlink-testing-framework v1.19.1 h1:MdGM5jIrBi858Cv7qzfl1Qon93YW8InohAlDQqFoIb4= github.com/smartcontractkit/chainlink-testing-framework v1.19.1/go.mod h1:zScXRqmvbyTFUooyLYrOp4+V/sFPUbFJNRc72YmnuIk= github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss= diff --git a/integration-tests/types/config/node/core.go b/integration-tests/types/config/node/core.go index 6da1d94371a..ad85506a04c 100644 --- a/integration-tests/types/config/node/core.go +++ b/integration-tests/types/config/node/core.go @@ -11,7 +11,7 @@ import ( "github.com/segmentio/ksuid" - relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets" + commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-testing-framework/blockchain" "github.com/smartcontractkit/chainlink-testing-framework/utils/ptr" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" @@ -171,7 +171,7 @@ func SetChainConfig( chainConfig = evmcfg.Chain{ AutoCreateKey: ptr.Ptr(true), FinalityDepth: ptr.Ptr[uint32](1), - MinContractPayment: relayassets.NewLinkFromJuels(0), + MinContractPayment: commonassets.NewLinkFromJuels(0), } } cfg.EVM = evmcfg.EVMConfigs{ @@ -197,7 +197,7 @@ func WithPrivateEVMs(networks []blockchain.EVMNetwork) NodeConfigOpt { Chain: evmcfg.Chain{ AutoCreateKey: ptr.Ptr(true), FinalityDepth: ptr.Ptr[uint32](50), - MinContractPayment: relayassets.NewLinkFromJuels(0), + MinContractPayment: commonassets.NewLinkFromJuels(0), LogPollInterval: models.MustNewDuration(1 * time.Second), HeadTracker: evmcfg.HeadTracker{ HistoryDepth: ptr.Ptr(uint32(100)), diff --git a/plugins/cmd/chainlink-median/main.go b/plugins/cmd/chainlink-median/main.go index 87815d24d99..e95bfbb221b 100644 --- a/plugins/cmd/chainlink-median/main.go +++ b/plugins/cmd/chainlink-median/main.go @@ -3,7 +3,7 @@ package main import ( "github.com/hashicorp/go-plugin" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/median" ) diff --git a/plugins/cmd/chainlink-medianpoc/main.go b/plugins/cmd/chainlink-medianpoc/main.go index 325de6538fa..eaef96d1b0a 100644 --- a/plugins/cmd/chainlink-medianpoc/main.go +++ b/plugins/cmd/chainlink-medianpoc/main.go @@ -3,9 +3,9 @@ package main import ( "github.com/hashicorp/go-plugin" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/reportingplugins" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop/reportingplugins" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/plugins/medianpoc" ) diff --git a/plugins/config.go b/plugins/config.go index 938cfd0d00c..01574d82099 100644 --- a/plugins/config.go +++ b/plugins/config.go @@ -3,7 +3,7 @@ package plugins import ( "os/exec" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop" ) // RegistrarConfig generates contains static configuration inher diff --git a/plugins/loop_registry.go b/plugins/loop_registry.go index f402fc6fa17..17ad7cba5ad 100644 --- a/plugins/loop_registry.go +++ b/plugins/loop_registry.go @@ -5,8 +5,8 @@ import ( "sort" "sync" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink/v2/core/config" ) diff --git a/plugins/medianpoc/data_source.go b/plugins/medianpoc/data_source.go index 7b20f1e5eb3..92d4b04ba6c 100644 --- a/plugins/medianpoc/data_source.go +++ b/plugins/medianpoc/data_source.go @@ -10,8 +10,8 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/plugins/medianpoc/data_source_test.go b/plugins/medianpoc/data_source_test.go index e9a7945cee4..5848705b7b9 100644 --- a/plugins/medianpoc/data_source_test.go +++ b/plugins/medianpoc/data_source_test.go @@ -6,13 +6,14 @@ import ( "math/big" "testing" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) type mockPipelineRunner struct { diff --git a/plugins/medianpoc/plugin.go b/plugins/medianpoc/plugin.go index ceea1eb84f5..62b6acc043a 100644 --- a/plugins/medianpoc/plugin.go +++ b/plugins/medianpoc/plugin.go @@ -9,11 +9,11 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/reportingplugins" - "github.com/smartcontractkit/chainlink-relay/pkg/services" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop/reportingplugins" + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/plugins/medianpoc/plugin_test.go b/plugins/medianpoc/plugin_test.go index 74a0695c6c9..569fcb464bc 100644 --- a/plugins/medianpoc/plugin_test.go +++ b/plugins/medianpoc/plugin_test.go @@ -12,7 +12,7 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/logger" )