Skip to content

Commit

Permalink
rename module to chainlink-common (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored and samsondav committed Jan 11, 2024
1 parent 2ce12d3 commit edc2bf0
Show file tree
Hide file tree
Showing 115 changed files with 256 additions and 252 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build_external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/smartcontractkit/chainlink-relay
module github.com/smartcontractkit/chainlink-common

go 1.21

Expand Down
2 changes: 1 addition & 1 deletion pkg/assets/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/assets/link_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/chains/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/chains/nodes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/fee/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/fee/models_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pkg/loop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions pkg/loop/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down
2 changes: 1 addition & 1 deletion pkg/loop/adapters/starknet/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/loop/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/loop/errors.go
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions pkg/loop/internal/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pkg/loop/internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pkg/loop/internal/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/loop/internal/contract_transmitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pkg/loop/internal/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/loop/internal/error_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions pkg/loop/internal/median.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions pkg/loop/internal/pb/median.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/loop/internal/pb/median.proto
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -12,15 +12,15 @@ 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;
uint32 juelsPerFeeCoinDataSourceID = 3;
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;
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/loop/internal/pb/pipeline_runner.proto
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Loading

0 comments on commit edc2bf0

Please sign in to comment.