Skip to content

Commit 06ab5e6

Browse files
authored
Add capRegistry to NewRelayer (#472)
1 parent 7e59494 commit 06ab5e6

File tree

8 files changed

+14
-12
lines changed

8 files changed

+14
-12
lines changed

integration-tests/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/lib/pq v1.10.9
1212
github.com/pelletier/go-toml/v2 v2.1.1
1313
github.com/rs/zerolog v1.30.0
14-
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303
14+
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240625074419-c278d083facf
1515
github.com/smartcontractkit/chainlink-starknet/ops v0.0.0-20231205180940-ea2e3e916725
1616
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240524210559-72df72854128
1717
github.com/smartcontractkit/chainlink-testing-framework v1.28.8

integration-tests/go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -1411,8 +1411,8 @@ github.com/smartcontractkit/chain-selectors v1.0.10 h1:t9kJeE6B6G+hKD0GYR4kGJSCq
14111411
github.com/smartcontractkit/chain-selectors v1.0.10/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE=
14121412
github.com/smartcontractkit/chainlink-automation v1.0.3 h1:h/ijT0NiyV06VxYVgcNfsE3+8OEzT3Q0Z9au0z1BPWs=
14131413
github.com/smartcontractkit/chainlink-automation v1.0.3/go.mod h1:RjboV0Qd7YP+To+OrzHGXaxUxoSONveCoAK2TQ1INLU=
1414-
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303 h1:iyLE5c2YFxy89t2v5u+aQOHqRE4c+sCMze70KIo07mI=
1415-
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs=
1414+
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240625074419-c278d083facf h1:d9AS/K8RSVG64USb20N/U7RaPOsYPcmuLGJq7iE+caM=
1415+
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240625074419-c278d083facf/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4=
14161416
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d h1:5tgMC5Gi2UAOKZ+m28W8ubjLeR0pQCAcrz6eQ0rW510=
14171417
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d/go.mod h1:0UNuO3nDt9MFsZPaHJBEUolxVkN0iC69j1ccDp95e8k=
14181418
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 h1:xFSv8561jsLtF6gYZr/zW2z5qUUAkcFkApin2mnbYTo=

monitoring/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/NethermindEth/juno v0.3.1
99
github.com/NethermindEth/starknet.go v0.7.1-0.20240401080518-34a506f3cfdb
1010
github.com/prometheus/client_golang v1.17.0
11-
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303
11+
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240625074419-c278d083facf
1212
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.0-20230508053614-9f2fd5fd4ff1
1313
github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c
1414
github.com/stretchr/testify v1.9.0

monitoring/go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,8 @@ github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR
474474
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
475475
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
476476
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
477-
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303 h1:iyLE5c2YFxy89t2v5u+aQOHqRE4c+sCMze70KIo07mI=
478-
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs=
477+
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240625074419-c278d083facf h1:d9AS/K8RSVG64USb20N/U7RaPOsYPcmuLGJq7iE+caM=
478+
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240625074419-c278d083facf/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4=
479479
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss=
480480
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4=
481481
github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU=

relayer/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/ethereum/go-ethereum v1.13.8
1111
github.com/hashicorp/go-plugin v1.6.0
1212
github.com/pelletier/go-toml/v2 v2.1.1
13-
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303
13+
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240625074419-c278d083facf
1414
github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c
1515
github.com/stretchr/testify v1.9.0
1616
go.uber.org/zap v1.26.0

relayer/go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,8 @@ github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMT
445445
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
446446
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
447447
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
448-
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303 h1:iyLE5c2YFxy89t2v5u+aQOHqRE4c+sCMze70KIo07mI=
449-
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs=
448+
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240625074419-c278d083facf h1:d9AS/K8RSVG64USb20N/U7RaPOsYPcmuLGJq7iE+caM=
449+
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240625074419-c278d083facf/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4=
450450
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss=
451451
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4=
452452
github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU=

relayer/pkg/chainlink/cmd/chainlink-starknet/main.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/pelletier/go-toml/v2"
1010

1111
"github.com/smartcontractkit/chainlink-common/pkg/loop"
12+
"github.com/smartcontractkit/chainlink-common/pkg/types/core"
1213

1314
pkgstarknet "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink"
1415
starkchain "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/chain"
@@ -55,7 +56,7 @@ type pluginRelayer struct {
5556
// [github.com/smartcontractkit/chainlink-common/pkg/loop.PluginRelayer]
5657
// loopKs must be an implementation that can construct a starknet keystore adapter
5758
// [github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/txm.NewKeystoreAdapter]
58-
func (c *pluginRelayer) NewRelayer(ctx context.Context, config string, loopKs loop.Keystore) (loop.Relayer, error) {
59+
func (c *pluginRelayer) NewRelayer(ctx context.Context, config string, loopKs loop.Keystore, capRegistry core.CapabilitiesRegistry) (loop.Relayer, error) {
5960
d := toml.NewDecoder(strings.NewReader(config))
6061
d.DisallowUnknownFields()
6162
var cfg struct {
@@ -74,7 +75,7 @@ func (c *pluginRelayer) NewRelayer(ctx context.Context, config string, loopKs lo
7475
if err != nil {
7576
return nil, fmt.Errorf("failed to create chain: %w", err)
7677
}
77-
ra := &loop.RelayerAdapter{Relayer: pkgstarknet.NewRelayer(c.Logger, chain), RelayerExt: chain}
78+
ra := &loop.RelayerAdapter{Relayer: pkgstarknet.NewRelayer(c.Logger, chain, capRegistry), RelayerExt: chain}
7879

7980
c.SubService(ra)
8081

relayer/pkg/chainlink/relay.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/smartcontractkit/chainlink-common/pkg/logger"
1010
"github.com/smartcontractkit/chainlink-common/pkg/services"
1111
relaytypes "github.com/smartcontractkit/chainlink-common/pkg/types"
12+
"github.com/smartcontractkit/chainlink-common/pkg/types/core"
1213

1314
starkchain "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/chain"
1415
"github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/ocr2"
@@ -23,7 +24,7 @@ type relayer struct {
2324
lggr logger.Logger
2425
}
2526

26-
func NewRelayer(lggr logger.Logger, chain starkchain.Chain) *relayer {
27+
func NewRelayer(lggr logger.Logger, chain starkchain.Chain, capRegistry core.CapabilitiesRegistry) *relayer {
2728
return &relayer{
2829
chain: chain,
2930
stopCh: make(chan struct{}),

0 commit comments

Comments
 (0)