diff --git a/.github/workflows/build_external.yml b/.github/workflows/build_external.yml index 244327c42..6a5d5c56e 100644 --- a/.github/workflows/build_external.yml +++ b/.github/workflows/build_external.yml @@ -63,9 +63,9 @@ jobs: uses: actions/setup-go@v3 with: go-version-file: "go.mod" - - name: Replace chainlink-relay deps + - name: Replace chainlink-common deps run: | - go get github.com/smartcontractkit/chainlink-relay@${{ github.event.pull_request.head.sha }} + go get github.com/smartcontractkit/chainlink-common@${{ github.event.pull_request.head.sha }} go mod tidy - name: Install Solana CLI run: ./scripts/install-solana-ci.sh @@ -95,10 +95,10 @@ jobs: uses: actions/setup-go@v3 with: go-version-file: ./relayer/go.mod - - name: Replace chainlink-relay deps + - name: Replace chainlink-common deps run: | cd relayer - go get github.com/smartcontractkit/chainlink-relay@${{ github.event.pull_request.head.sha }} + go get github.com/smartcontractkit/chainlink-common@${{ github.event.pull_request.head.sha }} go mod tidy - name: Install Nix uses: cachix/install-nix-action@d64e0553100205688c0fb2fa16edb0fc8663c590 # v17 @@ -132,9 +132,9 @@ jobs: # uses: actions/setup-go@v3 # with: # go-version-file: "go.mod" - # - name: Replace chainlink-relay deps + # - name: Replace chainlink-common deps # run: | - # go get github.com/smartcontractkit/chainlink-relay@${{ github.event.pull_request.head.sha }} + # go get github.com/smartcontractkit/chainlink-common@${{ github.event.pull_request.head.sha }} # go mod tidy # - name: Install Nix # uses: cachix/install-nix-action@v14 diff --git a/Makefile b/Makefile index a8382685a..68425ea3d 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ gomodtidy: .PHONY: godoc godoc: go install golang.org/x/tools/cmd/godoc@latest - # http://localhost:6060/pkg/github.com/smartcontractkit/chainlink-relay/ + # http://localhost:6060/pkg/github.com/smartcontractkit/chainlink-common/ godoc -http=:6060 PHONY: install-protoc diff --git a/README.md b/README.md index 02ac0702a..2e94e99db 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# chainlink-relay -SDK for building Chainlink Relay network-specific services +# chainlink-common + +SDK for implementing Chainlink Services, like Chain Relayers or Product Plugins. diff --git a/go.mod b/go.mod index eef5869f5..fa35cb7e2 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/smartcontractkit/chainlink-relay +module github.com/smartcontractkit/chainlink-common go 1.21 diff --git a/pkg/assets/link.go b/pkg/assets/link.go index 8fd1ce5ce..133ed91e4 100644 --- a/pkg/assets/link.go +++ b/pkg/assets/link.go @@ -6,7 +6,7 @@ import ( "math/big" "strings" - "github.com/smartcontractkit/chainlink-relay/pkg/utils/bytes" + "github.com/smartcontractkit/chainlink-common/pkg/utils/bytes" "github.com/pkg/errors" "github.com/shopspring/decimal" diff --git a/pkg/assets/link_test.go b/pkg/assets/link_test.go index 5f2b7a31c..420734b33 100644 --- a/pkg/assets/link_test.go +++ b/pkg/assets/link_test.go @@ -8,7 +8,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" ) func TestAssets_NewLinkAndString(t *testing.T) { diff --git a/pkg/chains/nodes.go b/pkg/chains/nodes.go index 0e2eff2bd..958e34703 100644 --- a/pkg/chains/nodes.go +++ b/pkg/chains/nodes.go @@ -7,7 +7,7 @@ import ( "net/url" "strconv" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) // pageToken is simple internal representation for coordination requests and responses in a paginated API diff --git a/pkg/chains/nodes_test.go b/pkg/chains/nodes_test.go index 38084d7fb..e03e59cdd 100644 --- a/pkg/chains/nodes_test.go +++ b/pkg/chains/nodes_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) func TestNewPageToken(t *testing.T) { diff --git a/pkg/fee/models.go b/pkg/fee/models.go index ef7c66bb0..3a07c9af6 100644 --- a/pkg/fee/models.go +++ b/pkg/fee/models.go @@ -5,9 +5,9 @@ import ( "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/chains/label" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - bigmath "github.com/smartcontractkit/chainlink-relay/pkg/utils/big_math" + "github.com/smartcontractkit/chainlink-common/pkg/chains/label" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + bigmath "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" ) var ( diff --git a/pkg/fee/models_test.go b/pkg/fee/models_test.go index 79e7b3c19..2ba415c92 100644 --- a/pkg/fee/models_test.go +++ b/pkg/fee/models_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) // This test is based on EVM Fixed Fee Estimator. diff --git a/pkg/loop/README.md b/pkg/loop/README.md index 6fec980aa..238965edd 100644 --- a/pkg/loop/README.md +++ b/pkg/loop/README.md @@ -6,7 +6,7 @@ Local out of process (LOOP) plugins using [github.com/hashicorp/go-plugin](https ```mermaid flowchart - subgraph chainlink-relay/pkg + subgraph chainlink-common/pkg loop internal[loop/internal] pb[loop/internal/pb] diff --git a/pkg/loop/adapter.go b/pkg/loop/adapter.go index 5bfe9cc06..e73aed64c 100644 --- a/pkg/loop/adapter.go +++ b/pkg/loop/adapter.go @@ -5,8 +5,8 @@ import ( "errors" "fmt" - "github.com/smartcontractkit/chainlink-relay/pkg/services" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) // RelayerExt is a subset of [loop.Relayer] for adapting [types.Relayer], typically with a Chain. See [RelayerAdapter]. diff --git a/pkg/loop/adapters/starknet/signature.go b/pkg/loop/adapters/starknet/signature.go index 1e3b1ebdc..0a6e1b526 100644 --- a/pkg/loop/adapters/starknet/signature.go +++ b/pkg/loop/adapters/starknet/signature.go @@ -6,7 +6,7 @@ import ( "google.golang.org/protobuf/proto" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb" ) type Signature struct { diff --git a/pkg/loop/context_test.go b/pkg/loop/context_test.go index d1ca7aa80..76996cb8f 100644 --- a/pkg/loop/context_test.go +++ b/pkg/loop/context_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/config" ) func TestContextValues(t *testing.T) { diff --git a/pkg/loop/errors.go b/pkg/loop/errors.go index 2727abee6..02e0d9f61 100644 --- a/pkg/loop/errors.go +++ b/pkg/loop/errors.go @@ -1,5 +1,5 @@ package loop -import "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal" +import "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" var ErrPluginUnavailable = internal.ErrPluginUnavailable diff --git a/pkg/loop/internal/broker.go b/pkg/loop/internal/broker.go index 3109b9aaf..d86d68df0 100644 --- a/pkg/loop/internal/broker.go +++ b/pkg/loop/internal/broker.go @@ -10,8 +10,8 @@ import ( "google.golang.org/grpc" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) // Broker is a subset of the methods exported by *plugin.GRPCBroker. diff --git a/pkg/loop/internal/client.go b/pkg/loop/internal/client.go index 75ddd5f7b..ef6c237a1 100644 --- a/pkg/loop/internal/client.go +++ b/pkg/loop/internal/client.go @@ -11,7 +11,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) var _ grpc.ClientConnInterface = (*atomicClient)(nil) diff --git a/pkg/loop/internal/config.go b/pkg/loop/internal/config.go index 9079fc45a..988b989c0 100644 --- a/pkg/loop/internal/config.go +++ b/pkg/loop/internal/config.go @@ -8,8 +8,8 @@ import ( libocr "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) var _ types.ConfigProvider = (*configProviderClient)(nil) diff --git a/pkg/loop/internal/contract_transmitter.go b/pkg/loop/internal/contract_transmitter.go index 531b8cc1d..7e18b2bf0 100644 --- a/pkg/loop/internal/contract_transmitter.go +++ b/pkg/loop/internal/contract_transmitter.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/libocr/commontypes" libocr "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb" ) var _ libocr.ContractTransmitter = (*contractTransmitterClient)(nil) diff --git a/pkg/loop/internal/datasource.go b/pkg/loop/internal/datasource.go index 823cc4276..381b2fd04 100644 --- a/pkg/loop/internal/datasource.go +++ b/pkg/loop/internal/datasource.go @@ -11,8 +11,8 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) // github.com/smartcontractkit/libocr/offchainreporting2plus/internal/protocol.ReportingPluginTimeoutWarningGracePeriod diff --git a/pkg/loop/internal/error_log.go b/pkg/loop/internal/error_log.go index a529c9789..ad59789f9 100644 --- a/pkg/loop/internal/error_log.go +++ b/pkg/loop/internal/error_log.go @@ -6,8 +6,8 @@ import ( "google.golang.org/grpc" "google.golang.org/protobuf/types/known/emptypb" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) var _ types.ErrorLog = (*errorLogClient)(nil) diff --git a/pkg/loop/internal/median.go b/pkg/loop/internal/median.go index 5924027b9..eca88c69d 100644 --- a/pkg/loop/internal/median.go +++ b/pkg/loop/internal/median.go @@ -15,9 +15,9 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" libocr "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) var _ types.PluginMedian = (*PluginMedianClient)(nil) diff --git a/pkg/loop/internal/pb/median.pb.go b/pkg/loop/internal/pb/median.pb.go index 6e2b22af0..66c0518dd 100644 --- a/pkg/loop/internal/pb/median.pb.go +++ b/pkg/loop/internal/pb/median.pb.go @@ -22,7 +22,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// NewMedianFactoryRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.NewMedianFactory]. +// NewMedianFactoryRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.NewMedianFactory]. type NewMedianFactoryRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -94,7 +94,7 @@ func (x *NewMedianFactoryRequest) GetErrorLogID() uint32 { return 0 } -// NewMedianFactoryRequest has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.NewMedianFactory]. +// NewMedianFactoryRequest has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.NewMedianFactory]. type NewMedianFactoryReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -142,7 +142,7 @@ func (x *NewMedianFactoryReply) GetReportingPluginFactoryID() uint32 { return 0 } -// SaveErrorRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.ErrorLog.SaveErrorRequest]. +// SaveErrorRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.ErrorLog.SaveErrorRequest]. type SaveErrorRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/pkg/loop/internal/pb/median.proto b/pkg/loop/internal/pb/median.proto index ae5c48071..db9799249 100644 --- a/pkg/loop/internal/pb/median.proto +++ b/pkg/loop/internal/pb/median.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option go_package = "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb"; +option go_package = "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb"; package loop; @@ -12,7 +12,7 @@ service PluginMedian { rpc NewMedianFactory (NewMedianFactoryRequest) returns (NewMedianFactoryReply) {} } -// NewMedianFactoryRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.NewMedianFactory]. +// NewMedianFactoryRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.NewMedianFactory]. message NewMedianFactoryRequest { uint32 medianProviderID = 1; uint32 dataSourceID = 2; @@ -20,7 +20,7 @@ message NewMedianFactoryRequest { uint32 errorLogID = 4; } -// NewMedianFactoryRequest has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.NewMedianFactory]. +// NewMedianFactoryRequest has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.NewMedianFactory]. message NewMedianFactoryReply { uint32 reportingPluginFactoryID = 1; } @@ -29,7 +29,7 @@ service ErrorLog { rpc SaveError(SaveErrorRequest) returns (google.protobuf.Empty) {} } -// SaveErrorRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.ErrorLog.SaveErrorRequest]. +// SaveErrorRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.ErrorLog.SaveErrorRequest]. message SaveErrorRequest { string message = 1; } diff --git a/pkg/loop/internal/pb/pipeline_runner.proto b/pkg/loop/internal/pb/pipeline_runner.proto index 2835e5e6e..06de1f6f6 100644 --- a/pkg/loop/internal/pb/pipeline_runner.proto +++ b/pkg/loop/internal/pb/pipeline_runner.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option go_package = "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb"; +option go_package = "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb"; package loop; diff --git a/pkg/loop/internal/pb/relayer.pb.go b/pkg/loop/internal/pb/relayer.pb.go index 6cc307b4d..ca1157256 100644 --- a/pkg/loop/internal/pb/relayer.pb.go +++ b/pkg/loop/internal/pb/relayer.pb.go @@ -272,7 +272,7 @@ func (x *SignReply) GetSignedData() []byte { return nil } -// RelayArgs represents [github.com/smartcontractkit/chainlink-relay/pkg/types.RelayArgs]. +// RelayArgs represents [github.com/smartcontractkit/chainlink-common/pkg/types.RelayArgs]. type RelayArgs struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -360,7 +360,7 @@ func (x *RelayArgs) GetProviderType() string { return "" } -// RelayArgs represents [github.com/smartcontractkit/chainlink-relay/pkg/types.PluginArgs]. +// RelayArgs represents [github.com/smartcontractkit/chainlink-common/pkg/types.PluginArgs]. type PluginArgs struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -416,7 +416,7 @@ func (x *PluginArgs) GetPluginConfig() []byte { return nil } -// NewPluginProviderRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.NewPluginProvider]. +// NewPluginProviderRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.NewPluginProvider]. type NewPluginProviderRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -472,7 +472,7 @@ func (x *NewPluginProviderRequest) GetPluginArgs() *PluginArgs { return nil } -// NewPluginProviderReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.NewPluginProvider]. +// NewPluginProviderReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.NewPluginProvider]. type NewPluginProviderReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -520,7 +520,7 @@ func (x *NewPluginProviderReply) GetPluginProviderID() uint32 { return 0 } -// NewConfigProviderRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.NewConfigProvider]. +// NewConfigProviderRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.NewConfigProvider]. type NewConfigProviderRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -568,7 +568,7 @@ func (x *NewConfigProviderRequest) GetRelayArgs() *RelayArgs { return nil } -// NewConfigProviderReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.NewConfigProvider]. +// NewConfigProviderReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.NewConfigProvider]. type NewConfigProviderReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -654,7 +654,7 @@ func (*GetChainStatusRequest) Descriptor() ([]byte, []int) { return file_relayer_proto_rawDescGZIP(), []int{11} } -// ChainStatusReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.ChainStatus]. +// ChainStatusReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.ChainStatus]. type GetChainStatusReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -702,7 +702,7 @@ func (x *GetChainStatusReply) GetChain() *ChainStatus { return nil } -// ChainStatus represents [github.com/smartcontractkit/chainlink-relay/pkg/types.ChainStatus]. +// ChainStatus represents [github.com/smartcontractkit/chainlink-common/pkg/types.ChainStatus]. type ChainStatus struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -766,7 +766,7 @@ func (x *ChainStatus) GetConfig() string { return "" } -// ListNodeStatusesRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.ListNodeStatuses]. +// ListNodeStatusesRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.ListNodeStatuses]. type ListNodeStatusesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -822,7 +822,7 @@ func (x *ListNodeStatusesRequest) GetPageToken() string { return "" } -// ListNodeStatusesReply is a pagination response for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.ListNodeStatuses]. +// ListNodeStatusesReply is a pagination response for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.ListNodeStatuses]. type ListNodeStatusesReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -886,7 +886,7 @@ func (x *ListNodeStatusesReply) GetNextPageToken() string { return "" } -// NodeStatus represents [github.com/smartcontractkit/chainlink-relay/pkg/types.NodeStatus]. +// NodeStatus represents [github.com/smartcontractkit/chainlink-common/pkg/types.NodeStatus]. type NodeStatus struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -958,7 +958,7 @@ func (x *NodeStatus) GetState() string { return "" } -// SendTxRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.SendTx]. +// SendTxRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.SendTx]. type TransactionRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1030,7 +1030,7 @@ func (x *TransactionRequest) GetBalanceCheck() bool { return false } -// ObserveRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.DataSource.Observe]. +// ObserveRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.DataSource.Observe]. type ObserveRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1078,7 +1078,7 @@ func (x *ObserveRequest) GetReportTimestamp() *ReportTimestamp { return nil } -// ObserveReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.DataSource.Observe]. +// ObserveReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.DataSource.Observe]. type ObserveReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2098,7 +2098,7 @@ func (*FromAccountRequest) Descriptor() ([]byte, []int) { return file_relayer_proto_rawDescGZIP(), []int{38} } -// FromAccountReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/types.Service.FromAccount]. +// FromAccountReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/types.Service.FromAccount]. type FromAccountReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2146,7 +2146,7 @@ func (x *FromAccountReply) GetAccount() string { return "" } -// NameReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/types.Service.Name]. +// NameReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/types.Service.Name]. type NameReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2194,7 +2194,7 @@ func (x *NameReply) GetName() string { return "" } -// HealthReportReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/types.Service.HealthReport]. +// HealthReportReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/types.Service.HealthReport]. type HealthReportReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/pkg/loop/internal/pb/relayer.proto b/pkg/loop/internal/pb/relayer.proto index 5aded6508..b62a4b37b 100644 --- a/pkg/loop/internal/pb/relayer.proto +++ b/pkg/loop/internal/pb/relayer.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option go_package = "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb"; +option go_package = "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb"; package loop; @@ -48,7 +48,7 @@ service Relayer { rpc Transact (TransactionRequest) returns (google.protobuf.Empty) {} } -// RelayArgs represents [github.com/smartcontractkit/chainlink-relay/pkg/types.RelayArgs]. +// RelayArgs represents [github.com/smartcontractkit/chainlink-common/pkg/types.RelayArgs]. message RelayArgs { bytes externalJobID = 1; // [32]byte int32 jobID = 2; @@ -58,62 +58,62 @@ message RelayArgs { string providerType = 6; } -// RelayArgs represents [github.com/smartcontractkit/chainlink-relay/pkg/types.PluginArgs]. +// RelayArgs represents [github.com/smartcontractkit/chainlink-common/pkg/types.PluginArgs]. message PluginArgs { string transmitterID = 1; bytes pluginConfig = 2; } -// NewPluginProviderRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.NewPluginProvider]. +// NewPluginProviderRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.NewPluginProvider]. message NewPluginProviderRequest { RelayArgs relayArgs = 1; PluginArgs pluginArgs = 2; } -// NewPluginProviderReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.NewPluginProvider]. +// NewPluginProviderReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.NewPluginProvider]. message NewPluginProviderReply { uint32 pluginProviderID = 1; } -// NewConfigProviderRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.NewConfigProvider]. +// NewConfigProviderRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.NewConfigProvider]. message NewConfigProviderRequest { RelayArgs relayArgs = 1; } -// NewConfigProviderReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.NewConfigProvider]. +// NewConfigProviderReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.NewConfigProvider]. message NewConfigProviderReply { uint32 configProviderID = 1; } message GetChainStatusRequest {} -// ChainStatusReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.ChainStatus]. +// ChainStatusReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.ChainStatus]. message GetChainStatusReply { ChainStatus chain = 1; } -// ChainStatus represents [github.com/smartcontractkit/chainlink-relay/pkg/types.ChainStatus]. +// ChainStatus represents [github.com/smartcontractkit/chainlink-common/pkg/types.ChainStatus]. message ChainStatus { string id = 1; bool enabled = 2; string config = 3; // TOML } -// ListNodeStatusesRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.ListNodeStatuses]. +// ListNodeStatusesRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.ListNodeStatuses]. message ListNodeStatusesRequest { int32 page_size = 1; string page_token = 2; } -// ListNodeStatusesReply is a pagination response for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.ListNodeStatuses]. +// ListNodeStatusesReply is a pagination response for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.ListNodeStatuses]. message ListNodeStatusesReply { repeated NodeStatus nodes = 1; int32 total = 2; // total count of nodes string next_page_token =3; } -// NodeStatus represents [github.com/smartcontractkit/chainlink-relay/pkg/types.NodeStatus]. +// NodeStatus represents [github.com/smartcontractkit/chainlink-common/pkg/types.NodeStatus]. message NodeStatus { string chainID = 1; string name = 2; @@ -121,7 +121,7 @@ message NodeStatus { string state = 4; } -// SendTxRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.SendTx]. +// SendTxRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.SendTx]. message TransactionRequest { string from = 1; string to = 2; @@ -133,12 +133,12 @@ service DataSource { rpc Observe (ObserveRequest) returns (ObserveReply) {} } -// ObserveRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.DataSource.Observe]. +// ObserveRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.DataSource.Observe]. message ObserveRequest { ReportTimestamp reportTimestamp = 1; } -// ObserveReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.DataSource.Observe]. +// ObserveReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop.DataSource.Observe]. message ObserveReply { BigInt value = 1; } @@ -251,7 +251,7 @@ message LatestConfigDigestAndEpochReply { message FromAccountRequest {} -// FromAccountReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/types.Service.FromAccount]. +// FromAccountReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/types.Service.FromAccount]. message FromAccountReply { string Account = 1; } @@ -263,12 +263,12 @@ service Service { rpc HealthReport (google.protobuf.Empty) returns (HealthReportReply) {} } -// NameReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/types.Service.Name]. +// NameReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/types.Service.Name]. message NameReply { string name = 1; } -// HealthReportReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/types.Service.HealthReport]. +// HealthReportReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/types.Service.HealthReport]. message HealthReportReply { map healthReport = 1; } diff --git a/pkg/loop/internal/pb/reporting.proto b/pkg/loop/internal/pb/reporting.proto index cd341faaf..ac6bdba87 100644 --- a/pkg/loop/internal/pb/reporting.proto +++ b/pkg/loop/internal/pb/reporting.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option go_package = "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb"; +option go_package = "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb"; package loop; diff --git a/pkg/loop/internal/pb/reporting_plugin_service.pb.go b/pkg/loop/internal/pb/reporting_plugin_service.pb.go index 647453dae..0d7b1ee26 100644 --- a/pkg/loop/internal/pb/reporting_plugin_service.pb.go +++ b/pkg/loop/internal/pb/reporting_plugin_service.pb.go @@ -99,7 +99,7 @@ func (x *ReportingPluginServiceConfig) GetTelemetryType() string { return "" } -// NewReportingPluginFactoryRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop/reporting_plugins/LOOPPService.NewReportingPluginFactory]. +// NewReportingPluginFactoryRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop/reporting_plugins/LOOPPService.NewReportingPluginFactory]. type NewReportingPluginFactoryRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -179,7 +179,7 @@ func (x *NewReportingPluginFactoryRequest) GetReportingPluginServiceConfig() *Re return nil } -// NewReportingPluginFactoryReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop/reporting_plugins/LOOPPService.NewReportingPluginFactory]. +// NewReportingPluginFactoryReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop/reporting_plugins/LOOPPService.NewReportingPluginFactory]. type NewReportingPluginFactoryReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/pkg/loop/internal/pb/reporting_plugin_service.proto b/pkg/loop/internal/pb/reporting_plugin_service.proto index 6dd618a44..84f7f9b1e 100644 --- a/pkg/loop/internal/pb/reporting_plugin_service.proto +++ b/pkg/loop/internal/pb/reporting_plugin_service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option go_package = "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb"; +option go_package = "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb"; package loop; @@ -16,7 +16,7 @@ message ReportingPluginServiceConfig { string telemetryType = 5; } -// NewReportingPluginFactoryRequest has arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop/reporting_plugins/LOOPPService.NewReportingPluginFactory]. +// NewReportingPluginFactoryRequest has arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop/reporting_plugins/LOOPPService.NewReportingPluginFactory]. message NewReportingPluginFactoryRequest { uint32 providerID = 1; uint32 errorLogID = 2; @@ -25,7 +25,7 @@ message NewReportingPluginFactoryRequest { ReportingPluginServiceConfig ReportingPluginServiceConfig = 5; } -// NewReportingPluginFactoryReply has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop/reporting_plugins/LOOPPService.NewReportingPluginFactory]. +// NewReportingPluginFactoryReply has return arguments for [github.com/smartcontractkit/chainlink-common/pkg/loop/reporting_plugins/LOOPPService.NewReportingPluginFactory]. message NewReportingPluginFactoryReply { uint32 ID = 1; } diff --git a/pkg/loop/internal/pb/telemetry.proto b/pkg/loop/internal/pb/telemetry.proto index 7cbfc560d..6a90b0539 100644 --- a/pkg/loop/internal/pb/telemetry.proto +++ b/pkg/loop/internal/pb/telemetry.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option go_package = "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb"; +option go_package = "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb"; package loop; diff --git a/pkg/loop/internal/pipeline_runner.go b/pkg/loop/internal/pipeline_runner.go index ba3e08990..2aac39926 100644 --- a/pkg/loop/internal/pipeline_runner.go +++ b/pkg/loop/internal/pipeline_runner.go @@ -8,8 +8,8 @@ import ( "google.golang.org/protobuf/types/known/durationpb" "google.golang.org/protobuf/types/known/structpb" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) var _ types.PipelineRunnerService = (*pipelineRunnerServiceClient)(nil) diff --git a/pkg/loop/internal/pipeline_runner_test.go b/pkg/loop/internal/pipeline_runner_test.go index 639bd4d04..d13dc4bf8 100644 --- a/pkg/loop/internal/pipeline_runner_test.go +++ b/pkg/loop/internal/pipeline_runner_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) type mockPipelineRunner struct { diff --git a/pkg/loop/internal/plugin_provider.go b/pkg/loop/internal/plugin_provider.go index 44d5cbe52..2e23f33b9 100644 --- a/pkg/loop/internal/plugin_provider.go +++ b/pkg/loop/internal/plugin_provider.go @@ -4,8 +4,8 @@ import ( libocr "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "google.golang.org/grpc" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) type pluginProviderClient struct { diff --git a/pkg/loop/internal/plugin_service.go b/pkg/loop/internal/plugin_service.go index 28727dce0..09de253bf 100644 --- a/pkg/loop/internal/plugin_service.go +++ b/pkg/loop/internal/plugin_service.go @@ -12,9 +12,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/services" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) const KeepAliveTickDuration = 5 * time.Second //TODO from config diff --git a/pkg/loop/internal/relayer.go b/pkg/loop/internal/relayer.go index c0287ef87..b4db619a7 100644 --- a/pkg/loop/internal/relayer.go +++ b/pkg/loop/internal/relayer.go @@ -10,9 +10,9 @@ import ( "google.golang.org/grpc" "google.golang.org/protobuf/types/known/emptypb" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) var _ PluginRelayer = (*PluginRelayerClient)(nil) diff --git a/pkg/loop/internal/reporting.go b/pkg/loop/internal/reporting.go index 72487d524..726ef7d01 100644 --- a/pkg/loop/internal/reporting.go +++ b/pkg/loop/internal/reporting.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/libocr/commontypes" libocr "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb" ) type reportingPluginFactoryClient struct { diff --git a/pkg/loop/internal/reporting_plugin_service.go b/pkg/loop/internal/reporting_plugin_service.go index 8393667b7..953d97dc6 100644 --- a/pkg/loop/internal/reporting_plugin_service.go +++ b/pkg/loop/internal/reporting_plugin_service.go @@ -6,9 +6,9 @@ import ( "github.com/mwitkow/grpc-proxy/proxy" "google.golang.org/grpc" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) var _ types.ReportingPluginClient = (*ReportingPluginServiceClient)(nil) diff --git a/pkg/loop/internal/service.go b/pkg/loop/internal/service.go index fbbb047c5..6240f8ffd 100644 --- a/pkg/loop/internal/service.go +++ b/pkg/loop/internal/service.go @@ -8,8 +8,8 @@ import ( "google.golang.org/grpc" "google.golang.org/protobuf/types/known/emptypb" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb" + "github.com/smartcontractkit/chainlink-common/pkg/services" ) var ErrPluginUnavailable = errors.New("plugin unavailable") diff --git a/pkg/loop/internal/telemetry.go b/pkg/loop/internal/telemetry.go index 0f3cd4018..3ef67c6c5 100644 --- a/pkg/loop/internal/telemetry.go +++ b/pkg/loop/internal/telemetry.go @@ -7,8 +7,8 @@ import ( "google.golang.org/grpc" "google.golang.org/protobuf/types/known/emptypb" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/pb" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/pb" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) var _ types.TelemetryService = (*telemetryServiceClient)(nil) diff --git a/pkg/loop/internal/test/cmd/main.go b/pkg/loop/internal/test/cmd/main.go index 13b2d14a3..4b6466456 100644 --- a/pkg/loop/internal/test/cmd/main.go +++ b/pkg/loop/internal/test/cmd/main.go @@ -9,11 +9,11 @@ import ( "github.com/hashicorp/go-plugin" "google.golang.org/grpc" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/test" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/reportingplugins" - "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/internal/test" + "github.com/smartcontractkit/chainlink-common/pkg/loop/reportingplugins" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) func main() { diff --git a/pkg/loop/internal/test/error_log.go b/pkg/loop/internal/test/error_log.go index d768647d1..2a01e0c4b 100644 --- a/pkg/loop/internal/test/error_log.go +++ b/pkg/loop/internal/test/error_log.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) var _ types.ErrorLog = (*StaticErrorLog)(nil) diff --git a/pkg/loop/internal/test/logger_loop.go b/pkg/loop/internal/test/logger_loop.go index 920e2fd4a..cf00b8d46 100644 --- a/pkg/loop/internal/test/logger_loop.go +++ b/pkg/loop/internal/test/logger_loop.go @@ -8,8 +8,8 @@ import ( "github.com/hashicorp/go-plugin" "google.golang.org/grpc" - "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" ) const PluginLoggerTestName = "logger-test" diff --git a/pkg/loop/internal/test/median.go b/pkg/loop/internal/test/median.go index 925309a2c..88703d0f9 100644 --- a/pkg/loop/internal/test/median.go +++ b/pkg/loop/internal/test/median.go @@ -15,8 +15,8 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" libocr "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/types" - "github.com/smartcontractkit/chainlink-relay/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) func TestPluginMedian(t *testing.T, p types.PluginMedian) { diff --git a/pkg/loop/internal/test/pipeline_runner.go b/pkg/loop/internal/test/pipeline_runner.go index 8a065d3b2..cf3a1401d 100644 --- a/pkg/loop/internal/test/pipeline_runner.go +++ b/pkg/loop/internal/test/pipeline_runner.go @@ -5,7 +5,7 @@ import ( "fmt" "reflect" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) var _ types.PipelineRunnerService = (*StaticPipelineRunnerService)(nil) diff --git a/pkg/loop/internal/test/relayer.go b/pkg/loop/internal/test/relayer.go index ca4dca5bb..a28890c89 100644 --- a/pkg/loop/internal/test/relayer.go +++ b/pkg/loop/internal/test/relayer.go @@ -12,9 +12,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal" - "github.com/smartcontractkit/chainlink-relay/pkg/types" - "github.com/smartcontractkit/chainlink-relay/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" + "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) type StaticKeystore struct{} diff --git a/pkg/loop/internal/test/reporting_plugin.go b/pkg/loop/internal/test/reporting_plugin.go index fbff921b6..20aa4a0d4 100644 --- a/pkg/loop/internal/test/reporting_plugin.go +++ b/pkg/loop/internal/test/reporting_plugin.go @@ -8,8 +8,8 @@ import ( "google.golang.org/grpc" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) type MockConn struct { diff --git a/pkg/loop/internal/test/telemetry.go b/pkg/loop/internal/test/telemetry.go index 5c097ff6f..df074462b 100644 --- a/pkg/loop/internal/test/telemetry.go +++ b/pkg/loop/internal/test/telemetry.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) var _ grpc.ClientConnInterface = (*mockClientConn)(nil) diff --git a/pkg/loop/internal/test/test.go b/pkg/loop/internal/test/test.go index cafbc130d..b7b064d53 100644 --- a/pkg/loop/internal/test/test.go +++ b/pkg/loop/internal/test/test.go @@ -10,7 +10,7 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" libocr "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) const ConfigTOML = `[Foo] diff --git a/pkg/loop/internal/test/test_plugin.go b/pkg/loop/internal/test/test_plugin.go index f49739f61..c4063f149 100644 --- a/pkg/loop/internal/test/test_plugin.go +++ b/pkg/loop/internal/test/test_plugin.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/go-plugin" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) type HelperProcessCommand struct { diff --git a/pkg/loop/internal/types.go b/pkg/loop/internal/types.go index f47648472..1d508a057 100644 --- a/pkg/loop/internal/types.go +++ b/pkg/loop/internal/types.go @@ -3,7 +3,7 @@ package internal import ( "context" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) type PluginRelayer interface { diff --git a/pkg/loop/logger.go b/pkg/loop/logger.go index f894e2f2b..da3d6cc49 100644 --- a/pkg/loop/logger.go +++ b/pkg/loop/logger.go @@ -9,7 +9,7 @@ import ( "go.uber.org/zap/zapcore" "golang.org/x/exp/slices" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) // HCLogLogger returns an [hclog.Logger] backed by the given [logger.Logger]. diff --git a/pkg/loop/logger_loop_test.go b/pkg/loop/logger_loop_test.go index ef69e0910..c6440255a 100644 --- a/pkg/loop/logger_loop_test.go +++ b/pkg/loop/logger_loop_test.go @@ -8,8 +8,8 @@ import ( "go.uber.org/zap/zapcore" "go.uber.org/zap/zaptest/observer" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/test" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/test" ) func TestHCLogLogger(t *testing.T) { diff --git a/pkg/loop/median_service.go b/pkg/loop/median_service.go index e847e5c9a..bdeecb936 100644 --- a/pkg/loop/median_service.go +++ b/pkg/loop/median_service.go @@ -8,9 +8,9 @@ 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/internal" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) var _ ocrtypes.ReportingPluginFactory = (*MedianService)(nil) diff --git a/pkg/loop/median_service_test.go b/pkg/loop/median_service_test.go index 961a4786d..3999a29ab 100644 --- a/pkg/loop/median_service_test.go +++ b/pkg/loop/median_service_test.go @@ -9,11 +9,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/test" - "github.com/smartcontractkit/chainlink-relay/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/test" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) func TestMedianService(t *testing.T) { diff --git a/pkg/loop/plugin.go b/pkg/loop/plugin.go index 7ac27dbb0..a2f69593d 100644 --- a/pkg/loop/plugin.go +++ b/pkg/loop/plugin.go @@ -3,8 +3,8 @@ package loop import ( "sync" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" ) // Plugin is a base layer for plugins to easily manage sub-[types.Service]s. diff --git a/pkg/loop/plugin_median.go b/pkg/loop/plugin_median.go index afed322fa..2855fcbf2 100644 --- a/pkg/loop/plugin_median.go +++ b/pkg/loop/plugin_median.go @@ -6,8 +6,8 @@ import ( "github.com/hashicorp/go-plugin" "google.golang.org/grpc" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) // PluginMedianName is the name for [types.PluginMedian]/[NewGRPCPluginMedian]. diff --git a/pkg/loop/plugin_median_test.go b/pkg/loop/plugin_median_test.go index 323cb1098..0879d9c82 100644 --- a/pkg/loop/plugin_median_test.go +++ b/pkg/loop/plugin_median_test.go @@ -9,10 +9,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/test" - "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/internal/test" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) func TestPluginMedian(t *testing.T) { diff --git a/pkg/loop/plugin_relayer.go b/pkg/loop/plugin_relayer.go index 5a9ae5738..d5d99ecd0 100644 --- a/pkg/loop/plugin_relayer.go +++ b/pkg/loop/plugin_relayer.go @@ -6,8 +6,8 @@ import ( "github.com/hashicorp/go-plugin" "google.golang.org/grpc" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) // PluginRelayerName is the name for [types.PluginRelayer]/[NewGRPCPluginRelayer]. diff --git a/pkg/loop/plugin_relayer_test.go b/pkg/loop/plugin_relayer_test.go index 738e425af..32602b922 100644 --- a/pkg/loop/plugin_relayer_test.go +++ b/pkg/loop/plugin_relayer_test.go @@ -6,9 +6,9 @@ import ( "github.com/hashicorp/go-plugin" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/test" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/test" ) func TestPluginRelayer(t *testing.T) { diff --git a/pkg/loop/process_test.go b/pkg/loop/process_test.go index cf009fd99..94ae50022 100644 --- a/pkg/loop/process_test.go +++ b/pkg/loop/process_test.go @@ -3,7 +3,7 @@ package loop_test import ( "os/exec" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/test" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/test" ) type HelperProcessCommand test.HelperProcessCommand diff --git a/pkg/loop/prom.go b/pkg/loop/prom.go index d78d8dd9b..649624e7a 100644 --- a/pkg/loop/prom.go +++ b/pkg/loop/prom.go @@ -11,7 +11,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) type PromServer struct { diff --git a/pkg/loop/prom_test.go b/pkg/loop/prom_test.go index c12200ede..84183b829 100644 --- a/pkg/loop/prom_test.go +++ b/pkg/loop/prom_test.go @@ -11,7 +11,7 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) func TestPromServer(t *testing.T) { diff --git a/pkg/loop/relayer_service.go b/pkg/loop/relayer_service.go index 4931372de..ef5ff52f2 100644 --- a/pkg/loop/relayer_service.go +++ b/pkg/loop/relayer_service.go @@ -6,9 +6,9 @@ import ( "math/big" "os/exec" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) var _ Relayer = (*RelayerService)(nil) diff --git a/pkg/loop/relayer_service_test.go b/pkg/loop/relayer_service_test.go index b7cd71f1a..9e9c38913 100644 --- a/pkg/loop/relayer_service_test.go +++ b/pkg/loop/relayer_service_test.go @@ -9,11 +9,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/test" - "github.com/smartcontractkit/chainlink-relay/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/test" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) func TestRelayerService(t *testing.T) { diff --git a/pkg/loop/reportingplugins/grpc.go b/pkg/loop/reportingplugins/grpc.go index c4c2fc953..c379343fa 100644 --- a/pkg/loop/reportingplugins/grpc.go +++ b/pkg/loop/reportingplugins/grpc.go @@ -6,9 +6,9 @@ import ( "github.com/hashicorp/go-plugin" "google.golang.org/grpc" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) // PluginServiceName is the name for [types.PluginClient]/[NewGRPCService]. diff --git a/pkg/loop/reportingplugins/grpc_test.go b/pkg/loop/reportingplugins/grpc_test.go index cbbba5ba8..eb5df8a38 100644 --- a/pkg/loop/reportingplugins/grpc_test.go +++ b/pkg/loop/reportingplugins/grpc_test.go @@ -6,12 +6,12 @@ import ( "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/test" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/reportingplugins" - "github.com/smartcontractkit/chainlink-relay/pkg/types" - "github.com/smartcontractkit/chainlink-relay/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/test" + "github.com/smartcontractkit/chainlink-common/pkg/loop/reportingplugins" + "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) func newStopCh(t *testing.T) <-chan struct{} { diff --git a/pkg/loop/reportingplugins/loopp_service.go b/pkg/loop/reportingplugins/loopp_service.go index 0db2f1d43..2dc00f759 100644 --- a/pkg/loop/reportingplugins/loopp_service.go +++ b/pkg/loop/reportingplugins/loopp_service.go @@ -8,10 +8,10 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "google.golang.org/grpc" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal" - "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/internal" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) var _ ocrtypes.ReportingPluginFactory = (*LOOPPService)(nil) diff --git a/pkg/loop/reportingplugins/loopp_service_test.go b/pkg/loop/reportingplugins/loopp_service_test.go index 76c97fcef..a559534e8 100644 --- a/pkg/loop/reportingplugins/loopp_service_test.go +++ b/pkg/loop/reportingplugins/loopp_service_test.go @@ -9,13 +9,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/test" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/reportingplugins" - "github.com/smartcontractkit/chainlink-relay/pkg/types" - utilstests "github.com/smartcontractkit/chainlink-relay/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/test" + "github.com/smartcontractkit/chainlink-common/pkg/loop/reportingplugins" + "github.com/smartcontractkit/chainlink-common/pkg/types" + utilstests "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) type HelperProcessCommand test.HelperProcessCommand diff --git a/pkg/loop/server.go b/pkg/loop/server.go index f2c9e9787..1f17dea71 100644 --- a/pkg/loop/server.go +++ b/pkg/loop/server.go @@ -4,8 +4,8 @@ import ( "fmt" "os" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/services" ) // NewStartedServer returns a started Server. diff --git a/pkg/loop/standalone_provider.go b/pkg/loop/standalone_provider.go index 2c9ebb5e6..b54f1a64b 100644 --- a/pkg/loop/standalone_provider.go +++ b/pkg/loop/standalone_provider.go @@ -5,8 +5,8 @@ import ( "google.golang.org/grpc" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal" - "github.com/smartcontractkit/chainlink-relay/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" + "github.com/smartcontractkit/chainlink-common/pkg/types" ) // RegisterStandAloneProvider register the servers needed for a plugin provider, diff --git a/pkg/loop/standalone_provider_test.go b/pkg/loop/standalone_provider_test.go index fc0021daf..3f69fae77 100644 --- a/pkg/loop/standalone_provider_test.go +++ b/pkg/loop/standalone_provider_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc" - "github.com/smartcontractkit/chainlink-relay/pkg/loop" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/test" + "github.com/smartcontractkit/chainlink-common/pkg/loop" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/test" ) func TestRegisterStandAloneProvider(t *testing.T) { diff --git a/pkg/loop/telem.go b/pkg/loop/telem.go index ae11c362c..52b905e8f 100644 --- a/pkg/loop/telem.go +++ b/pkg/loop/telem.go @@ -21,7 +21,7 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" ) type GRPCOpts = internal.GRPCOpts diff --git a/pkg/loop/telemetry_test.go b/pkg/loop/telemetry_test.go index 77c919d9e..b3d324a13 100644 --- a/pkg/loop/telemetry_test.go +++ b/pkg/loop/telemetry_test.go @@ -3,7 +3,7 @@ package loop_test import ( "testing" - "github.com/smartcontractkit/chainlink-relay/pkg/loop/internal/test" + "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/test" ) func TestTelemetry(t *testing.T) { diff --git a/pkg/monitoring/README.md b/pkg/monitoring/README.md index e4b0400f1..39d2eee71 100644 --- a/pkg/monitoring/README.md +++ b/pkg/monitoring/README.md @@ -8,7 +8,7 @@ as well as a tutorial for creating new integrations. ## Documentation -Godoc generated documentation is available [here](https://pkg.go.dev/github.com/smartcontractkit/chainlink-relay/pkg/monitoring#section-readme) +Godoc generated documentation is available [here](https://pkg.go.dev/github.com/smartcontractkit/chainlink-common/pkg/monitoring#section-readme) ## Developing the monitoring framework diff --git a/pkg/monitoring/exporter_kafka.go b/pkg/monitoring/exporter_kafka.go index e38e216c4..305cacda9 100644 --- a/pkg/monitoring/exporter_kafka.go +++ b/pkg/monitoring/exporter_kafka.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) // Pipeline represents a succession of transformations on the data coming from a source: diff --git a/pkg/monitoring/exporter_kafka_test.go b/pkg/monitoring/exporter_kafka_test.go index cf34217f0..74f999b36 100644 --- a/pkg/monitoring/exporter_kafka_test.go +++ b/pkg/monitoring/exporter_kafka_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/goleak" - "github.com/smartcontractkit/chainlink-relay/pkg/monitoring/config" + "github.com/smartcontractkit/chainlink-common/pkg/monitoring/config" ) func TestKafkaExporter(t *testing.T) { diff --git a/pkg/monitoring/feed_monitor.go b/pkg/monitoring/feed_monitor.go index 955916000..eda7abccc 100644 --- a/pkg/monitoring/feed_monitor.go +++ b/pkg/monitoring/feed_monitor.go @@ -4,7 +4,7 @@ import ( "context" "time" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) type FeedMonitor interface { diff --git a/pkg/monitoring/feed_monitor_test.go b/pkg/monitoring/feed_monitor_test.go index 324df8e06..062fc4386 100644 --- a/pkg/monitoring/feed_monitor_test.go +++ b/pkg/monitoring/feed_monitor_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/goleak" - "github.com/smartcontractkit/chainlink-relay/pkg/monitoring/config" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/monitoring/config" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) func TestFeedMonitor(t *testing.T) { diff --git a/pkg/monitoring/http.go b/pkg/monitoring/http.go index b389ac1de..35be711b7 100644 --- a/pkg/monitoring/http.go +++ b/pkg/monitoring/http.go @@ -7,7 +7,7 @@ import ( "net/http" "time" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) // HTTPServer is the HTTP interface exposed by every monitoring. diff --git a/pkg/monitoring/logger.go b/pkg/monitoring/logger.go index f97641853..195c2fd93 100644 --- a/pkg/monitoring/logger.go +++ b/pkg/monitoring/logger.go @@ -1,6 +1,6 @@ package monitoring -import "github.com/smartcontractkit/chainlink-relay/pkg/logger" +import "github.com/smartcontractkit/chainlink-common/pkg/logger" // Logger is a type alias for backwards compatibility. type Logger = logger.Logger diff --git a/pkg/monitoring/manager.go b/pkg/monitoring/manager.go index 5f9f3d6a8..8c011d8c4 100644 --- a/pkg/monitoring/manager.go +++ b/pkg/monitoring/manager.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) // Manager restarts the multi-feed monitor whenever the feed configuration list has changed. diff --git a/pkg/monitoring/manager_benchmark_test.go b/pkg/monitoring/manager_benchmark_test.go index 0a89a8fda..5fdf0ef03 100644 --- a/pkg/monitoring/manager_benchmark_test.go +++ b/pkg/monitoring/manager_benchmark_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/smartcontractkit/chainlink-relay/pkg/monitoring/config" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/monitoring/config" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) // This benchmark measures how many messages end up in the kafka client given @@ -15,7 +15,7 @@ import ( // goos: darwin // goarch: amd64 -// pkg: github.com/smartcontractkit/chainlink-relay/pkg/monitoring +// pkg: github.com/smartcontractkit/chainlink-common/pkg/monitoring // cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz // (10 jan 2022) // diff --git a/pkg/monitoring/manager_test.go b/pkg/monitoring/manager_test.go index 3bbae2f80..5aeeb674e 100644 --- a/pkg/monitoring/manager_test.go +++ b/pkg/monitoring/manager_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/goleak" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) const numPollerUpdates = 10 diff --git a/pkg/monitoring/mapping.go b/pkg/monitoring/mapping.go index 80009dec1..1bc7bc038 100644 --- a/pkg/monitoring/mapping.go +++ b/pkg/monitoring/mapping.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/monitoring/pb" + "github.com/smartcontractkit/chainlink-common/pkg/monitoring/pb" ) // Mapper is an interface for converting Envelopes into data structures that can be encoded in AVRO and sent to Kafka. diff --git a/pkg/monitoring/monitor.go b/pkg/monitoring/monitor.go index 47f66beb0..9c7726975 100644 --- a/pkg/monitoring/monitor.go +++ b/pkg/monitoring/monitor.go @@ -8,9 +8,9 @@ import ( "os/signal" "syscall" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/monitoring/config" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/monitoring/config" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) // Monitor is the entrypoint for an on-chain monitor integration. diff --git a/pkg/monitoring/monitor_test.go b/pkg/monitoring/monitor_test.go index 284ea2f29..e6cae9cde 100644 --- a/pkg/monitoring/monitor_test.go +++ b/pkg/monitoring/monitor_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/goleak" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) const testMonitorDurationSec = 15 diff --git a/pkg/monitoring/multi_feed_monitor.go b/pkg/monitoring/multi_feed_monitor.go index 654121152..ca04e5f9a 100644 --- a/pkg/monitoring/multi_feed_monitor.go +++ b/pkg/monitoring/multi_feed_monitor.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) // MultiFeedMonitor manages the flow of data from multiple sources to diff --git a/pkg/monitoring/multi_feed_monitor_benchmark_test.go b/pkg/monitoring/multi_feed_monitor_benchmark_test.go index 06a814919..8ebaa6b53 100644 --- a/pkg/monitoring/multi_feed_monitor_benchmark_test.go +++ b/pkg/monitoring/multi_feed_monitor_benchmark_test.go @@ -5,14 +5,14 @@ import ( "testing" "time" - "github.com/smartcontractkit/chainlink-relay/pkg/monitoring/config" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/monitoring/config" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) // Results: // goos: darwin // goarch: amd64 -// pkg: github.com/smartcontractkit/chainlink-relay/pkg/monitoring +// pkg: github.com/smartcontractkit/chainlink-common/pkg/monitoring // cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz // (11 Dec 2021) // 48993 35111 ns/op 44373 B/op 251 allocs/op diff --git a/pkg/monitoring/multi_feed_monitor_test.go b/pkg/monitoring/multi_feed_monitor_test.go index 08de92c5c..36d794ded 100644 --- a/pkg/monitoring/multi_feed_monitor_test.go +++ b/pkg/monitoring/multi_feed_monitor_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/goleak" - "github.com/smartcontractkit/chainlink-relay/pkg/monitoring/config" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/monitoring/config" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) const numFeeds = 10 diff --git a/pkg/monitoring/producer.go b/pkg/monitoring/producer.go index 543879b03..bdf2a1140 100644 --- a/pkg/monitoring/producer.go +++ b/pkg/monitoring/producer.go @@ -6,7 +6,7 @@ import ( "github.com/confluentinc/confluent-kafka-go/kafka" - "github.com/smartcontractkit/chainlink-relay/pkg/monitoring/config" + "github.com/smartcontractkit/chainlink-common/pkg/monitoring/config" ) // Producer is an abstraction on top of Kafka to aid with tests. diff --git a/pkg/monitoring/schema_registry.go b/pkg/monitoring/schema_registry.go index d26859878..1cd8c3fc5 100644 --- a/pkg/monitoring/schema_registry.go +++ b/pkg/monitoring/schema_registry.go @@ -9,7 +9,7 @@ import ( "github.com/riferrei/srclient" "github.com/stretchr/testify/assert" - "github.com/smartcontractkit/chainlink-relay/pkg/monitoring/config" + "github.com/smartcontractkit/chainlink-common/pkg/monitoring/config" ) type SchemaRegistry interface { diff --git a/pkg/monitoring/schema_registry_test.go b/pkg/monitoring/schema_registry_test.go index ce498ad60..dcc55bdb5 100644 --- a/pkg/monitoring/schema_registry_test.go +++ b/pkg/monitoring/schema_registry_test.go @@ -8,8 +8,8 @@ import ( "github.com/riferrei/srclient" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/monitoring/avro" - "github.com/smartcontractkit/chainlink-relay/pkg/monitoring/config" + "github.com/smartcontractkit/chainlink-common/pkg/monitoring/avro" + "github.com/smartcontractkit/chainlink-common/pkg/monitoring/config" ) const baseSchema = ` diff --git a/pkg/monitoring/schemas.go b/pkg/monitoring/schemas.go index 2fb4afe77..9fffac481 100644 --- a/pkg/monitoring/schemas.go +++ b/pkg/monitoring/schemas.go @@ -6,7 +6,7 @@ import ( "github.com/linkedin/goavro/v2" - "github.com/smartcontractkit/chainlink-relay/pkg/monitoring/avro" + "github.com/smartcontractkit/chainlink-common/pkg/monitoring/avro" ) // This files contains Avro schemas for encoding message to be published to kafka. diff --git a/pkg/monitoring/source_rdd.go b/pkg/monitoring/source_rdd.go index af7ade38b..29abba597 100644 --- a/pkg/monitoring/source_rdd.go +++ b/pkg/monitoring/source_rdd.go @@ -7,7 +7,7 @@ import ( "net/http" "sync" - "github.com/smartcontractkit/chainlink-relay/pkg/utils" + "github.com/smartcontractkit/chainlink-common/pkg/utils" ) type RDDData struct { diff --git a/pkg/monitoring/source_rdd_test.go b/pkg/monitoring/source_rdd_test.go index 6cd014a4c..0640d50b5 100644 --- a/pkg/monitoring/source_rdd_test.go +++ b/pkg/monitoring/source_rdd_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/monitoring/config" + "github.com/smartcontractkit/chainlink-common/pkg/monitoring/config" ) func TestRDDSource(t *testing.T) { diff --git a/pkg/monitoring/testutils.go b/pkg/monitoring/testutils.go index 81e6117c1..db6a2f641 100644 --- a/pkg/monitoring/testutils.go +++ b/pkg/monitoring/testutils.go @@ -21,8 +21,8 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "google.golang.org/protobuf/proto" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/monitoring/pb" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/monitoring/pb" ) // Sources diff --git a/pkg/reportingplugins/mercury/v1/mercury.go b/pkg/reportingplugins/mercury/v1/mercury.go index c19df0d4b..3d69b9fd6 100644 --- a/pkg/reportingplugins/mercury/v1/mercury.go +++ b/pkg/reportingplugins/mercury/v1/mercury.go @@ -15,9 +15,9 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" + "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) // MaxAllowedBlocks indicates the maximum len of LatestBlocks in any given observation. diff --git a/pkg/reportingplugins/mercury/v1/mercury_test.go b/pkg/reportingplugins/mercury/v1/mercury_test.go index 130ea8751..b7d079b10 100644 --- a/pkg/reportingplugins/mercury/v1/mercury_test.go +++ b/pkg/reportingplugins/mercury/v1/mercury_test.go @@ -21,8 +21,8 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" ) type testReportCodec struct { diff --git a/pkg/reportingplugins/mercury/v1/types.go b/pkg/reportingplugins/mercury/v1/types.go index e5686a244..96d49bc40 100644 --- a/pkg/reportingplugins/mercury/v1/types.go +++ b/pkg/reportingplugins/mercury/v1/types.go @@ -7,7 +7,7 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" + "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" ) type Block struct { diff --git a/pkg/reportingplugins/mercury/v1/validation.go b/pkg/reportingplugins/mercury/v1/validation.go index 16a0a1d84..f43080445 100644 --- a/pkg/reportingplugins/mercury/v1/validation.go +++ b/pkg/reportingplugins/mercury/v1/validation.go @@ -5,7 +5,7 @@ import ( "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" + "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" ) // ValidateCurrentBlock sanity checks number and hash diff --git a/pkg/reportingplugins/mercury/v2/mercury.go b/pkg/reportingplugins/mercury/v2/mercury.go index de30e7c9f..405c281d8 100644 --- a/pkg/reportingplugins/mercury/v2/mercury.go +++ b/pkg/reportingplugins/mercury/v2/mercury.go @@ -14,9 +14,9 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" + "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) type Observation struct { diff --git a/pkg/reportingplugins/mercury/v2/mercury_test.go b/pkg/reportingplugins/mercury/v2/mercury_test.go index 8af5dde80..63e49cf3d 100644 --- a/pkg/reportingplugins/mercury/v2/mercury_test.go +++ b/pkg/reportingplugins/mercury/v2/mercury_test.go @@ -19,8 +19,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" ) type testDataSource struct { diff --git a/pkg/reportingplugins/mercury/v2/types.go b/pkg/reportingplugins/mercury/v2/types.go index 526e71e69..c5df76746 100644 --- a/pkg/reportingplugins/mercury/v2/types.go +++ b/pkg/reportingplugins/mercury/v2/types.go @@ -5,7 +5,7 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" + "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" ) type PAO interface { diff --git a/pkg/reportingplugins/mercury/v3/mercury.go b/pkg/reportingplugins/mercury/v3/mercury.go index 1f7824067..05e7578d6 100644 --- a/pkg/reportingplugins/mercury/v3/mercury.go +++ b/pkg/reportingplugins/mercury/v3/mercury.go @@ -14,9 +14,9 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" + "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/logger" ) type Observation struct { diff --git a/pkg/reportingplugins/mercury/v3/mercury_test.go b/pkg/reportingplugins/mercury/v3/mercury_test.go index 7584da5d8..683355b4b 100644 --- a/pkg/reportingplugins/mercury/v3/mercury_test.go +++ b/pkg/reportingplugins/mercury/v3/mercury_test.go @@ -19,8 +19,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-relay/pkg/logger" - "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" ) type testDataSource struct { diff --git a/pkg/reportingplugins/mercury/v3/types.go b/pkg/reportingplugins/mercury/v3/types.go index 2ce2f5438..b21d0e6b2 100644 --- a/pkg/reportingplugins/mercury/v3/types.go +++ b/pkg/reportingplugins/mercury/v3/types.go @@ -5,7 +5,7 @@ import ( ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" + "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" ) type PAO interface { diff --git a/pkg/sqlutil/sqlutil.go b/pkg/sqlutil/sqlutil.go index 08d4d8a6a..713fb3b1f 100644 --- a/pkg/sqlutil/sqlutil.go +++ b/pkg/sqlutil/sqlutil.go @@ -36,6 +36,9 @@ func Transact[D any](ctx context.Context, newD func(Queryer) D, q Queryer, opts // Unsupported or already inside another transaction. return fn(newD(q)) } + if opts == nil { + opts = &TxOptions{} + } tx, err := db.BeginTxx(ctx, &opts.TxOptions) if err != nil { return err diff --git a/pkg/types/provider_mercury.go b/pkg/types/provider_mercury.go index 407cb1f77..badfeb0b4 100644 --- a/pkg/types/provider_mercury.go +++ b/pkg/types/provider_mercury.go @@ -1,10 +1,10 @@ package types import ( - "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury" - v1 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v1" - v2 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v2" - v3 "github.com/smartcontractkit/chainlink-relay/pkg/reportingplugins/mercury/v3" + "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury" + v1 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v1" + v2 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v2" + v3 "github.com/smartcontractkit/chainlink-common/pkg/reportingplugins/mercury/v3" ) // MercuryProvider provides components needed for a mercury OCR2 plugin. diff --git a/pkg/utils/duration.go b/pkg/utils/duration.go index 2fc7b2a06..530a14a14 100644 --- a/pkg/utils/duration.go +++ b/pkg/utils/duration.go @@ -3,7 +3,7 @@ package utils import ( "time" - "github.com/smartcontractkit/chainlink-relay/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/config" ) // Deprecated: use config.Duration diff --git a/pkg/utils/start_stop_once.go b/pkg/utils/start_stop_once.go index 5024cf26b..fec03735e 100644 --- a/pkg/utils/start_stop_once.go +++ b/pkg/utils/start_stop_once.go @@ -1,7 +1,7 @@ package utils import ( - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" ) // StartStopOnce can be embedded in a struct to help implement types.Service. diff --git a/pkg/utils/testutils.go b/pkg/utils/testutils.go index 573412673..edc77f503 100644 --- a/pkg/utils/testutils.go +++ b/pkg/utils/testutils.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/smartcontractkit/chainlink-relay/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) // Deprecated: use tests.Context diff --git a/pkg/utils/url.go b/pkg/utils/url.go index 54102ba88..56984145a 100644 --- a/pkg/utils/url.go +++ b/pkg/utils/url.go @@ -1,6 +1,6 @@ package utils -import "github.com/smartcontractkit/chainlink-relay/pkg/config" +import "github.com/smartcontractkit/chainlink-common/pkg/config" // Deprecated: use config.URL type URL = config.URL diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 4f17144e8..6e588380e 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -6,7 +6,7 @@ import ( mrand "math/rand" "time" - "github.com/smartcontractkit/chainlink-relay/pkg/services" + "github.com/smartcontractkit/chainlink-common/pkg/services" ) // WithJitter adds +/- 10% to a duration diff --git a/sonar-project.properties b/sonar-project.properties index f5203a410..73a647e49 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,5 @@ # projectKey is required (may be found under "Project Information" in Sonar or in project url) -sonar.projectKey=smartcontractkit_chainlink-relay +sonar.projectKey=smartcontractkit_chainlink-common sonar.sources=. # Full exclusions from the static analysis