Skip to content

Commit

Permalink
switch from chainlink-relay to chainlink-common
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 committed Nov 17, 2023
1 parent b2c1a17 commit d47ea5b
Show file tree
Hide file tree
Showing 241 changed files with 551 additions and 538 deletions.
2 changes: 1 addition & 1 deletion common/client/mock_rpc_test.go

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

4 changes: 2 additions & 2 deletions common/client/multi_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"

"github.com/smartcontractkit/chainlink-relay/pkg/assets"
"github.com/smartcontractkit/chainlink-relay/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/assets"
"github.com/smartcontractkit/chainlink-common/pkg/services"

"github.com/smartcontractkit/chainlink/v2/common/config"
feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types"
Expand Down
2 changes: 1 addition & 1 deletion common/client/multi_node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/zap"

"github.com/smartcontractkit/chainlink-relay/pkg/utils/tests"
"github.com/smartcontractkit/chainlink-common/pkg/utils/tests"

"github.com/smartcontractkit/chainlink/v2/common/config"
"github.com/smartcontractkit/chainlink/v2/common/types"
Expand Down
2 changes: 1 addition & 1 deletion common/client/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"

"github.com/smartcontractkit/chainlink-relay/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/services"

"github.com/smartcontractkit/chainlink/v2/common/types"
"github.com/smartcontractkit/chainlink/v2/core/logger"
Expand Down
2 changes: 1 addition & 1 deletion common/client/node_lifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/mock"
"go.uber.org/zap"

"github.com/smartcontractkit/chainlink-relay/pkg/utils/tests"
"github.com/smartcontractkit/chainlink-common/pkg/utils/tests"

"github.com/smartcontractkit/chainlink/v2/common/types"
"github.com/smartcontractkit/chainlink/v2/common/types/mocks"
Expand Down
2 changes: 1 addition & 1 deletion common/client/send_only_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/url"
"sync"

"github.com/smartcontractkit/chainlink-relay/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/services"

"github.com/smartcontractkit/chainlink/v2/common/types"
"github.com/smartcontractkit/chainlink/v2/core/logger"
Expand Down
2 changes: 1 addition & 1 deletion common/client/send_only_node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/zap"

"github.com/smartcontractkit/chainlink-relay/pkg/utils/tests"
"github.com/smartcontractkit/chainlink-common/pkg/utils/tests"

"github.com/smartcontractkit/chainlink/v2/common/types"
"github.com/smartcontractkit/chainlink/v2/core/logger"
Expand Down
2 changes: 1 addition & 1 deletion common/client/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"math/big"

"github.com/smartcontractkit/chainlink-relay/pkg/assets"
"github.com/smartcontractkit/chainlink-common/pkg/assets"
feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types"
"github.com/smartcontractkit/chainlink/v2/common/types"
"github.com/smartcontractkit/chainlink/v2/core/utils"
Expand Down
2 changes: 1 addition & 1 deletion common/headtracker/head_broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"
"time"

"github.com/smartcontractkit/chainlink-relay/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/services"
"github.com/smartcontractkit/chainlink/v2/common/types"
"github.com/smartcontractkit/chainlink/v2/core/logger"
"github.com/smartcontractkit/chainlink/v2/core/utils"
Expand Down
2 changes: 1 addition & 1 deletion common/headtracker/head_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"

"github.com/smartcontractkit/chainlink-relay/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/services"

htrktypes "github.com/smartcontractkit/chainlink/v2/common/headtracker/types"
"github.com/smartcontractkit/chainlink/v2/common/types"
Expand Down
4 changes: 2 additions & 2 deletions common/txmgr/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"go.uber.org/multierr"
"gopkg.in/guregu/null.v4"

"github.com/smartcontractkit/chainlink-relay/pkg/chains/label"
"github.com/smartcontractkit/chainlink-relay/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/chains/label"
"github.com/smartcontractkit/chainlink-common/pkg/services"
"github.com/smartcontractkit/chainlink/v2/common/client"
feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types"
txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types"
Expand Down
4 changes: 2 additions & 2 deletions common/txmgr/confirmer.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/prometheus/client_golang/prometheus/promauto"
"go.uber.org/multierr"

"github.com/smartcontractkit/chainlink-relay/pkg/chains/label"
"github.com/smartcontractkit/chainlink-relay/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/chains/label"
"github.com/smartcontractkit/chainlink-common/pkg/services"
"github.com/smartcontractkit/chainlink/v2/common/client"
commonfee "github.com/smartcontractkit/chainlink/v2/common/fee"
feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types"
Expand Down
2 changes: 1 addition & 1 deletion common/txmgr/resender.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"time"

"github.com/smartcontractkit/chainlink-relay/pkg/chains/label"
"github.com/smartcontractkit/chainlink-common/pkg/chains/label"
"github.com/smartcontractkit/chainlink/v2/common/client"
feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types"
txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types"
Expand Down
2 changes: 1 addition & 1 deletion common/txmgr/txmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/google/uuid"

"github.com/smartcontractkit/chainlink-relay/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/services"

feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types"
txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types"
Expand Down
2 changes: 1 addition & 1 deletion core/bridges/bridge_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"time"

"github.com/smartcontractkit/chainlink-relay/pkg/assets"
"github.com/smartcontractkit/chainlink-common/pkg/assets"
"github.com/smartcontractkit/chainlink/v2/core/store/models"
"github.com/smartcontractkit/chainlink/v2/core/utils"
)
Expand Down
2 changes: 1 addition & 1 deletion core/bridges/bridge_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/ethereum/go-ethereum/common/math"

"github.com/smartcontractkit/chainlink-relay/pkg/assets"
"github.com/smartcontractkit/chainlink-common/pkg/assets"
"github.com/smartcontractkit/chainlink/v2/core/bridges"
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
"github.com/smartcontractkit/chainlink/v2/core/store/models"
Expand Down
2 changes: 1 addition & 1 deletion core/chains/chain_kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"golang.org/x/exp/maps"

"github.com/smartcontractkit/chainlink-relay/pkg/types"
"github.com/smartcontractkit/chainlink-common/pkg/types"
)

type ChainsKV[T types.ChainService] struct {
Expand Down
2 changes: 1 addition & 1 deletion core/chains/chain_kv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/smartcontractkit/chainlink-relay/pkg/types"
"github.com/smartcontractkit/chainlink-common/pkg/types"
"github.com/smartcontractkit/chainlink/v2/core/chains"
)

Expand Down
4 changes: 2 additions & 2 deletions core/chains/evm/assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"math/big"

"github.com/smartcontractkit/chainlink-relay/pkg/assets"
"github.com/smartcontractkit/chainlink-relay/pkg/utils/bytes"
"github.com/smartcontractkit/chainlink-common/pkg/assets"
"github.com/smartcontractkit/chainlink-common/pkg/utils/bytes"
"github.com/smartcontractkit/chainlink/v2/core/utils"

"github.com/shopspring/decimal"
Expand Down
4 changes: 2 additions & 2 deletions core/chains/evm/assets/assets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets"
commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets"
)

Expand Down Expand Up @@ -69,7 +69,7 @@ func TestAssets_Eth_UnmarshalJsonError(t *testing.T) {
assert.EqualError(t, err, "assets: cannot unmarshal \"x\" into a *assets.Eth")

err = json.Unmarshal([]byte(`1`), &eth)
assert.Equal(t, relayassets.ErrNoQuotesForCurrency, err)
assert.Equal(t, commonassets.ErrNoQuotesForCurrency, err)
}

func TestAssets_NewEth(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions core/chains/evm/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (

"github.com/jmoiron/sqlx"

relaychains "github.com/smartcontractkit/chainlink-relay/pkg/chains"
"github.com/smartcontractkit/chainlink-relay/pkg/services"
"github.com/smartcontractkit/chainlink-relay/pkg/types"
common "github.com/smartcontractkit/chainlink-common/pkg/chains"
"github.com/smartcontractkit/chainlink-common/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/types"

commonconfig "github.com/smartcontractkit/chainlink/v2/common/config"
"github.com/smartcontractkit/chainlink/v2/core/chains"
Expand Down Expand Up @@ -422,7 +422,7 @@ func (c *chain) listNodeStatuses(start, end int) ([]types.NodeStatus, int, error
nodes := c.cfg.Nodes()
total := len(nodes)
if start >= total {
return nil, total, relaychains.ErrOutOfRange
return nil, total, common.ErrOutOfRange
}
if end > total {
end = total
Expand Down Expand Up @@ -459,7 +459,7 @@ func (c *chain) listNodeStatuses(start, end int) ([]types.NodeStatus, int, error
}

func (c *chain) ListNodeStatuses(ctx context.Context, pageSize int32, pageToken string) (stats []types.NodeStatus, nextPageToken string, total int, err error) {
return relaychains.ListNodeStatuses(int(pageSize), pageToken, c.listNodeStatuses)
return common.ListNodeStatuses(int(pageSize), pageToken, c.listNodeStatuses)
}

func (c *chain) ID() *big.Int { return c.id }
Expand Down
4 changes: 2 additions & 2 deletions core/chains/evm/client/chain_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rpc"

relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets"
commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets"
commonclient "github.com/smartcontractkit/chainlink/v2/common/client"
"github.com/smartcontractkit/chainlink/v2/common/config"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets"
Expand Down Expand Up @@ -183,7 +183,7 @@ func (c *chainClient) IsL2() bool {
return c.multiNode.IsL2()
}

func (c *chainClient) LINKBalance(ctx context.Context, address common.Address, linkAddress common.Address) (*relayassets.Link, error) {
func (c *chainClient) LINKBalance(ctx context.Context, address common.Address, linkAddress common.Address) (*commonassets.Link, error) {
return c.multiNode.LINKBalance(ctx, address, linkAddress)
}

Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"time"

"github.com/smartcontractkit/chainlink-relay/pkg/assets"
"github.com/smartcontractkit/chainlink-common/pkg/assets"
commonclient "github.com/smartcontractkit/chainlink/v2/common/client"
"github.com/smartcontractkit/chainlink/v2/common/config"
htrktypes "github.com/smartcontractkit/chainlink/v2/common/headtracker/types"
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/client/mocks/client.go

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

2 changes: 1 addition & 1 deletion core/chains/evm/client/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"

"github.com/smartcontractkit/chainlink-relay/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/services"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/config"
evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types"
"github.com/smartcontractkit/chainlink/v2/core/logger"
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/client/null_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rpc"

"github.com/smartcontractkit/chainlink-relay/pkg/assets"
"github.com/smartcontractkit/chainlink-common/pkg/assets"
commonclient "github.com/smartcontractkit/chainlink/v2/common/client"
evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types"
"github.com/smartcontractkit/chainlink/v2/core/logger"
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/client/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"

"github.com/smartcontractkit/chainlink-relay/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/services"

"github.com/smartcontractkit/chainlink/v2/common/config"
evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types"
Expand Down
8 changes: 4 additions & 4 deletions core/chains/evm/client/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/google/uuid"
"github.com/pkg/errors"

relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets"
commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets"
commonclient "github.com/smartcontractkit/chainlink/v2/common/client"
commontypes "github.com/smartcontractkit/chainlink/v2/common/types"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets"
Expand Down Expand Up @@ -869,12 +869,12 @@ func (r *rpcClient) TokenBalance(ctx context.Context, address common.Address, co
}

// LINKBalance returns the balance of LINK at the given address
func (r *rpcClient) LINKBalance(ctx context.Context, address common.Address, linkAddress common.Address) (*relayassets.Link, error) {
func (r *rpcClient) LINKBalance(ctx context.Context, address common.Address, linkAddress common.Address) (*commonassets.Link, error) {
balance, err := r.TokenBalance(ctx, address, linkAddress)
if err != nil {
return relayassets.NewLinkFromJuels(0), err
return commonassets.NewLinkFromJuels(0), err
}
return (*relayassets.Link)(balance), nil
return (*commonassets.Link)(balance), nil
}

func (r *rpcClient) FilterEvents(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) {
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/client/send_only_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/rpc"

"github.com/smartcontractkit/chainlink-relay/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/services"
"github.com/smartcontractkit/chainlink/v2/core/logger"
"github.com/smartcontractkit/chainlink/v2/core/utils"
)
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/client/simulated_backend_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rpc"

"github.com/smartcontractkit/chainlink-relay/pkg/assets"
"github.com/smartcontractkit/chainlink-common/pkg/assets"
commonclient "github.com/smartcontractkit/chainlink/v2/common/client"
evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types"
"github.com/smartcontractkit/chainlink/v2/core/logger"
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/config/chain_scoped.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
ocr "github.com/smartcontractkit/libocr/offchainreporting"
ocrtypes "github.com/smartcontractkit/libocr/offchainreporting/types"

"github.com/smartcontractkit/chainlink-relay/pkg/assets"
"github.com/smartcontractkit/chainlink-common/pkg/assets"
commonconfig "github.com/smartcontractkit/chainlink/v2/common/config"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml"
"github.com/smartcontractkit/chainlink/v2/core/config"
Expand Down
4 changes: 2 additions & 2 deletions core/chains/evm/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

gethcommon "github.com/ethereum/go-ethereum/common"

relayassets "github.com/smartcontractkit/chainlink-relay/pkg/assets"
commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets"
commonconfig "github.com/smartcontractkit/chainlink/v2/common/config"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets"
"github.com/smartcontractkit/chainlink/v2/core/config"
Expand Down Expand Up @@ -34,7 +34,7 @@ type EVM interface {
LogBackfillBatchSize() uint32
LogKeepBlocksDepth() uint32
LogPollInterval() time.Duration
MinContractPayment() *relayassets.Link
MinContractPayment() *commonassets.Link
MinIncomingConfirmations() uint32
NonceAutoSync() bool
OperatorFactoryAddress() string
Expand Down
Loading

0 comments on commit d47ea5b

Please sign in to comment.