Skip to content

Commit

Permalink
core/services/relay/evm/mercury: use chainlink-mercury
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 committed Nov 15, 2023
1 parent 50fbfd2 commit 1cdc2c9
Show file tree
Hide file tree
Showing 32 changed files with 218 additions and 202 deletions.
4 changes: 2 additions & 2 deletions core/cmd/cosmos_node_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config"
coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config"
"github.com/smartcontractkit/chainlink-relay/pkg/utils"
relayconfig "github.com/smartcontractkit/chainlink-relay/pkg/config"

"github.com/smartcontractkit/chainlink/v2/core/cmd"
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
Expand All @@ -35,7 +35,7 @@ func TestShell_IndexCosmosNodes(t *testing.T) {
chainID := cosmostest.RandomChainID()
node := config.Node{
Name: ptr("second"),
TendermintURL: utils.MustParseURL("http://tender.mint.test/bombay-12"),
TendermintURL: relayconfig.MustParseURL("http://tender.mint.test/bombay-12"),
}
chain := config.TOMLConfig{
ChainID: ptr(chainID),
Expand Down
6 changes: 3 additions & 3 deletions core/cmd/cosmos_transaction_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
cosmosdb "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/db"
"github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/denom"
"github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/params"
"github.com/smartcontractkit/chainlink-relay/pkg/utils"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
"github.com/smartcontractkit/chainlink-relay/pkg/config"

"github.com/smartcontractkit/chainlink/v2/core/cmd"
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils/cosmostest"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey"
)
Expand Down Expand Up @@ -50,7 +50,7 @@ func TestShell_SendCosmosCoins(t *testing.T) {
nodes := coscfg.Nodes{
&coscfg.Node{
Name: ptr("random"),
TendermintURL: utils.MustParseURL(url),
TendermintURL: config.MustParseURL(url),
},
}
chainConfig := coscfg.TOMLConfig{ChainID: &chainID, Enabled: ptr(true), Chain: cosmosChain, Nodes: nodes}
Expand Down
6 changes: 3 additions & 3 deletions core/cmd/solana_node_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-relay/pkg/utils"
"github.com/smartcontractkit/chainlink-relay/pkg/config"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"

"github.com/smartcontractkit/chainlink-solana/pkg/solana"
Expand All @@ -35,11 +35,11 @@ func TestShell_IndexSolanaNodes(t *testing.T) {
id := solanatest.RandomChainID()
node1 := solcfg.Node{
Name: ptr("first"),
URL: utils.MustParseURL("https://solana1.example"),
URL: config.MustParseURL("https://solana1.example"),
}
node2 := solcfg.Node{
Name: ptr("second"),
URL: utils.MustParseURL("https://solana2.example"),
URL: config.MustParseURL("https://solana2.example"),
}
chain := solana.TOMLConfig{
ChainID: &id,
Expand Down
4 changes: 2 additions & 2 deletions core/cmd/solana_transaction_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/urfave/cli"

"github.com/smartcontractkit/chainlink-relay/pkg/utils"
"github.com/smartcontractkit/chainlink-relay/pkg/config"
solanaClient "github.com/smartcontractkit/chainlink-solana/pkg/solana/client"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"

Expand All @@ -29,7 +29,7 @@ func TestShell_SolanaSendSol(t *testing.T) {
url := solanaClient.SetupLocalSolNode(t)
node := solcfg.Node{
Name: ptr(t.Name()),
URL: utils.MustParseURL(url),
URL: config.MustParseURL(url),
}
cfg := solana.TOMLConfig{
ChainID: &chainID,
Expand Down
6 changes: 3 additions & 3 deletions core/cmd/starknet_node_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-relay/pkg/utils"
relayconfig "github.com/smartcontractkit/chainlink-relay/pkg/config"
"github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config"

"github.com/smartcontractkit/chainlink/v2/core/cmd"
Expand All @@ -34,11 +34,11 @@ func TestShell_IndexStarkNetNodes(t *testing.T) {
id := "starknet chain ID"
node1 := config.Node{
Name: ptr("first"),
URL: utils.MustParseURL("https://starknet1.example"),
URL: relayconfig.MustParseURL("https://starknet1.example"),
}
node2 := config.Node{
Name: ptr("second"),
URL: utils.MustParseURL("https://starknet2.example"),
URL: relayconfig.MustParseURL("https://starknet2.example"),
}
chain := config.TOMLConfig{
ChainID: &id,
Expand Down
5 changes: 3 additions & 2 deletions core/scripts/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/smartcontractkit/chainlink/core/scripts

go 1.21
go 1.21.3

// Make sure we're working with the latest chainlink libs
replace github.com/smartcontractkit/chainlink/v2 => ../../
Expand Down Expand Up @@ -304,7 +304,8 @@ require (
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255 // indirect
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231113174149-046d4ddaca1a // indirect
github.com/smartcontractkit/chainlink-llo v0.0.0-20231115154526-abefc17cc332 // indirect
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231115153227-c2e71a404d2f // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05 // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb // indirect
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect
Expand Down
6 changes: 4 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1464,8 +1464,10 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255 h1:Pt6c7bJU9wIN6PQQnmN8UmYYH6lpfiQ6U/B8yEC2s5s=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255/go.mod h1:EHppaccd/LTlTMI2o4dmBHe4BknEgEFFDjDGMNuGb3k=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231113174149-046d4ddaca1a h1:G/pD8uI1PULRJU8Y3eLLzjqQBp9ruG9hj+wWxtyrgTo=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231113174149-046d4ddaca1a/go.mod h1:M9U1JV7IQi8Sfj4JR1qSi1tIh6omgW78W/8SHN/8BUQ=
github.com/smartcontractkit/chainlink-llo v0.0.0-20231115154526-abefc17cc332 h1:md6WwVyfC5jTR6jXZrs1X0TmxOA8jWTeK+3ZAIw2ch0=
github.com/smartcontractkit/chainlink-llo v0.0.0-20231115154526-abefc17cc332/go.mod h1:iyWCEOiRl87OCJbAecsVTqE8Qv47aHWLX8KbCKay7XQ=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231115153227-c2e71a404d2f h1:6MsxL2XyzR5BKI8sQv7X2ruNS0l0Jf8OGv7SVSx3WJI=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231115153227-c2e71a404d2f/go.mod h1:rOayi690YxLlkQy959PD8INhOAIAUi9LoN0G+J/CEf4=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05 h1:DaPSVnxe7oz1QJ+AVIhQWs1W3ubQvwvGo9NbHpMs1OQ=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05/go.mod h1:o0Pn1pbaUluboaK6/yhf8xf7TiFCkyFl6WUOdwqamuU=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb h1:HiluOfEVGOQTM6BTDImOqYdMZZ7qq7fkZ3TJdmItNr8=
Expand Down
66 changes: 33 additions & 33 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
ocrcommontypes "github.com/smartcontractkit/libocr/commontypes"

coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config"
relayutils "github.com/smartcontractkit/chainlink-relay/pkg/utils"
relayconfig "github.com/smartcontractkit/chainlink-relay/pkg/config"
"github.com/smartcontractkit/chainlink-solana/pkg/solana"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
stkcfg "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config"
Expand Down Expand Up @@ -144,15 +144,15 @@ var (
MaxMsgsPerBatch: ptr[int64](13),
},
Nodes: []*coscfg.Node{
{Name: ptr("primary"), TendermintURL: relayutils.MustParseURL("http://columbus.cosmos.com")},
{Name: ptr("primary"), TendermintURL: relayconfig.MustParseURL("http://columbus.cosmos.com")},
}},
{
ChainID: ptr("Malaga-420"),
Chain: coscfg.Chain{
BlocksUntilTxTimeout: ptr[int64](20),
},
Nodes: []*coscfg.Node{
{Name: ptr("secondary"), TendermintURL: relayutils.MustParseURL("http://bombay.cosmos.com")},
{Name: ptr("secondary"), TendermintURL: relayconfig.MustParseURL("http://bombay.cosmos.com")},
}},
},
Solana: []*solana.TOMLConfig{
Expand All @@ -162,27 +162,27 @@ var (
MaxRetries: ptr[int64](12),
},
Nodes: []*solcfg.Node{
{Name: ptr("primary"), URL: relayutils.MustParseURL("http://mainnet.solana.com")},
{Name: ptr("primary"), URL: relayconfig.MustParseURL("http://mainnet.solana.com")},
},
},
{
ChainID: ptr("testnet"),
Chain: solcfg.Chain{
OCR2CachePollPeriod: relayutils.MustNewDuration(time.Minute),
OCR2CachePollPeriod: relayconfig.MustNewDuration(time.Minute),
},
Nodes: []*solcfg.Node{
{Name: ptr("secondary"), URL: relayutils.MustParseURL("http://testnet.solana.com")},
{Name: ptr("secondary"), URL: relayconfig.MustParseURL("http://testnet.solana.com")},
},
},
},
Starknet: []*stkcfg.TOMLConfig{
{
ChainID: ptr("foobar"),
Chain: stkcfg.Chain{
ConfirmationPoll: relayutils.MustNewDuration(time.Hour),
ConfirmationPoll: relayconfig.MustNewDuration(time.Hour),
},
Nodes: []*stkcfg.Node{
{Name: ptr("primary"), URL: relayutils.MustParseURL("http://stark.node")},
{Name: ptr("primary"), URL: relayconfig.MustParseURL("http://stark.node")},
},
},
},
Expand Down Expand Up @@ -602,26 +602,26 @@ func TestConfig_Marshal(t *testing.T) {
ChainID: ptr("mainnet"),
Enabled: ptr(false),
Chain: solcfg.Chain{
BalancePollPeriod: relayutils.MustNewDuration(time.Minute),
ConfirmPollPeriod: relayutils.MustNewDuration(time.Second),
OCR2CachePollPeriod: relayutils.MustNewDuration(time.Minute),
OCR2CacheTTL: relayutils.MustNewDuration(time.Hour),
TxTimeout: relayutils.MustNewDuration(time.Hour),
TxRetryTimeout: relayutils.MustNewDuration(time.Minute),
TxConfirmTimeout: relayutils.MustNewDuration(time.Second),
BalancePollPeriod: relayconfig.MustNewDuration(time.Minute),
ConfirmPollPeriod: relayconfig.MustNewDuration(time.Second),
OCR2CachePollPeriod: relayconfig.MustNewDuration(time.Minute),
OCR2CacheTTL: relayconfig.MustNewDuration(time.Hour),
TxTimeout: relayconfig.MustNewDuration(time.Hour),
TxRetryTimeout: relayconfig.MustNewDuration(time.Minute),
TxConfirmTimeout: relayconfig.MustNewDuration(time.Second),
SkipPreflight: ptr(true),
Commitment: ptr("banana"),
MaxRetries: ptr[int64](7),
FeeEstimatorMode: ptr("fixed"),
ComputeUnitPriceMax: ptr[uint64](1000),
ComputeUnitPriceMin: ptr[uint64](10),
ComputeUnitPriceDefault: ptr[uint64](100),
FeeBumpPeriod: relayutils.MustNewDuration(time.Minute),
FeeBumpPeriod: relayconfig.MustNewDuration(time.Minute),
},
Nodes: []*solcfg.Node{
{Name: ptr("primary"), URL: relayutils.MustParseURL("http://solana.web")},
{Name: ptr("foo"), URL: relayutils.MustParseURL("http://solana.foo")},
{Name: ptr("bar"), URL: relayutils.MustParseURL("http://solana.bar")},
{Name: ptr("primary"), URL: relayconfig.MustParseURL("http://solana.web")},
{Name: ptr("foo"), URL: relayconfig.MustParseURL("http://solana.foo")},
{Name: ptr("bar"), URL: relayconfig.MustParseURL("http://solana.bar")},
},
},
}
Expand All @@ -630,14 +630,14 @@ func TestConfig_Marshal(t *testing.T) {
ChainID: ptr("foobar"),
Enabled: ptr(true),
Chain: stkcfg.Chain{
OCR2CachePollPeriod: relayutils.MustNewDuration(6 * time.Hour),
OCR2CacheTTL: relayutils.MustNewDuration(3 * time.Minute),
RequestTimeout: relayutils.MustNewDuration(time.Minute + 3*time.Second),
TxTimeout: relayutils.MustNewDuration(13 * time.Second),
ConfirmationPoll: relayutils.MustNewDuration(42 * time.Second),
OCR2CachePollPeriod: relayconfig.MustNewDuration(6 * time.Hour),
OCR2CacheTTL: relayconfig.MustNewDuration(3 * time.Minute),
RequestTimeout: relayconfig.MustNewDuration(time.Minute + 3*time.Second),
TxTimeout: relayconfig.MustNewDuration(13 * time.Second),
ConfirmationPoll: relayconfig.MustNewDuration(42 * time.Second),
},
Nodes: []*stkcfg.Node{
{Name: ptr("primary"), URL: relayutils.MustParseURL("http://stark.node")},
{Name: ptr("primary"), URL: relayconfig.MustParseURL("http://stark.node")},
},
},
}
Expand All @@ -647,21 +647,21 @@ func TestConfig_Marshal(t *testing.T) {
Enabled: ptr(true),
Chain: coscfg.Chain{
Bech32Prefix: ptr("wasm"),
BlockRate: relayutils.MustNewDuration(time.Minute),
BlockRate: relayconfig.MustNewDuration(time.Minute),
BlocksUntilTxTimeout: ptr[int64](12),
ConfirmPollPeriod: relayutils.MustNewDuration(time.Second),
ConfirmPollPeriod: relayconfig.MustNewDuration(time.Second),
FallbackGasPrice: mustDecimal("0.001"),
GasToken: ptr("ucosm"),
GasLimitMultiplier: mustDecimal("1.2"),
MaxMsgsPerBatch: ptr[int64](17),
OCR2CachePollPeriod: relayutils.MustNewDuration(time.Minute),
OCR2CacheTTL: relayutils.MustNewDuration(time.Hour),
TxMsgTimeout: relayutils.MustNewDuration(time.Second),
OCR2CachePollPeriod: relayconfig.MustNewDuration(time.Minute),
OCR2CacheTTL: relayconfig.MustNewDuration(time.Hour),
TxMsgTimeout: relayconfig.MustNewDuration(time.Second),
},
Nodes: []*coscfg.Node{
{Name: ptr("primary"), TendermintURL: relayutils.MustParseURL("http://tender.mint")},
{Name: ptr("foo"), TendermintURL: relayutils.MustParseURL("http://foo.url")},
{Name: ptr("bar"), TendermintURL: relayutils.MustParseURL("http://bar.web")},
{Name: ptr("primary"), TendermintURL: relayconfig.MustParseURL("http://tender.mint")},
{Name: ptr("foo"), TendermintURL: relayconfig.MustParseURL("http://foo.url")},
{Name: ptr("bar"), TendermintURL: relayconfig.MustParseURL("http://bar.web")},
},
},
}
Expand Down
18 changes: 9 additions & 9 deletions core/services/chainlink/relayer_chain_interoperators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/stretchr/testify/require"

coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config"
relayconfig "github.com/smartcontractkit/chainlink-relay/pkg/config"
"github.com/smartcontractkit/chainlink-relay/pkg/loop"
relayutils "github.com/smartcontractkit/chainlink-relay/pkg/utils"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
stkcfg "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config"

Expand Down Expand Up @@ -84,7 +84,7 @@ func TestCoreRelayerChainInteroperators(t *testing.T) {
Chain: solcfg.Chain{},
Nodes: []*solcfg.Node{{
Name: ptr("solana chain 1 node 1"),
URL: ((*relayutils.URL)(models.MustParseURL("http://localhost:8547").URL())),
URL: (*relayconfig.URL)(models.MustParseURL("http://localhost:8547").URL()),
}},
},
&solana.TOMLConfig{
Expand All @@ -93,7 +93,7 @@ func TestCoreRelayerChainInteroperators(t *testing.T) {
Chain: solcfg.Chain{},
Nodes: []*solcfg.Node{{
Name: ptr("solana chain 2 node 1"),
URL: ((*relayutils.URL)(models.MustParseURL("http://localhost:8527").URL())),
URL: (*relayconfig.URL)(models.MustParseURL("http://localhost:8527").URL()),
}},
},
}
Expand All @@ -106,15 +106,15 @@ func TestCoreRelayerChainInteroperators(t *testing.T) {
Nodes: []*stkcfg.Node{
{
Name: ptr("starknet chain 1 node 1"),
URL: ((*relayutils.URL)(models.MustParseURL("http://localhost:8547").URL())),
URL: (*relayconfig.URL)(models.MustParseURL("http://localhost:8547").URL()),
},
{
Name: ptr("starknet chain 1 node 2"),
URL: ((*relayutils.URL)(models.MustParseURL("http://localhost:8548").URL())),
URL: (*relayconfig.URL)(models.MustParseURL("http://localhost:8548").URL()),
},
{
Name: ptr("starknet chain 1 node 3"),
URL: ((*relayutils.URL)(models.MustParseURL("http://localhost:8549").URL())),
URL: (*relayconfig.URL)(models.MustParseURL("http://localhost:8549").URL()),
},
},
},
Expand All @@ -125,7 +125,7 @@ func TestCoreRelayerChainInteroperators(t *testing.T) {
Nodes: []*stkcfg.Node{
{
Name: ptr("starknet chain 2 node 1"),
URL: ((*relayutils.URL)(models.MustParseURL("http://localhost:3547").URL())),
URL: (*relayconfig.URL)(models.MustParseURL("http://localhost:3547").URL()),
},
},
},
Expand All @@ -143,7 +143,7 @@ func TestCoreRelayerChainInteroperators(t *testing.T) {
Nodes: coscfg.Nodes{
&coscfg.Node{
Name: ptr("cosmos chain 1 node 1"),
TendermintURL: (*relayutils.URL)(models.MustParseURL("http://localhost:9548").URL()),
TendermintURL: (*relayconfig.URL)(models.MustParseURL("http://localhost:9548").URL()),
},
},
},
Expand All @@ -158,7 +158,7 @@ func TestCoreRelayerChainInteroperators(t *testing.T) {
Nodes: coscfg.Nodes{
&coscfg.Node{
Name: ptr("cosmos chain 2 node 1"),
TendermintURL: (*relayutils.URL)(models.MustParseURL("http://localhost:9598").URL()),
TendermintURL: (*relayconfig.URL)(models.MustParseURL("http://localhost:9598").URL()),
},
},
},
Expand Down
Loading

0 comments on commit 1cdc2c9

Please sign in to comment.