Skip to content

Commit

Permalink
Add capRegistry to NewRelayer
Browse files Browse the repository at this point in the history
  • Loading branch information
archseer committed Jun 24, 2024
1 parent 885054f commit 1198306
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/mitchellh/mapstructure v1.5.0
github.com/pelletier/go-toml/v2 v2.1.1
github.com/prometheus/client_golang v1.17.0
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240614120734-7fa0ab584458
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240624100313-c14432e6d52d
github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c
github.com/stretchr/testify v1.9.0
go.uber.org/zap v1.26.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240614120734-7fa0ab584458 h1:+7LQmbMNaLXej+0ajbTxUfTt4w/ILODpmrOETQ5rTCI=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240614120734-7fa0ab584458/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240624100313-c14432e6d52d h1:F20+06B1RsZiC3caixFjeay/4iM0O5y95LI4oXHEOgk=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240624100313-c14432e6d52d/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4=
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss=
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4=
github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU=
Expand Down
5 changes: 3 additions & 2 deletions pkg/solana/cmd/chainlink-solana/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/pelletier/go-toml/v2"

"github.com/smartcontractkit/chainlink-common/pkg/loop"
"github.com/smartcontractkit/chainlink-common/pkg/types/core"

"github.com/smartcontractkit/chainlink-solana/pkg/solana"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
Expand Down Expand Up @@ -50,7 +51,7 @@ type pluginRelayer struct {
loop.Plugin
}

func (c *pluginRelayer) NewRelayer(ctx context.Context, config string, keystore loop.Keystore) (loop.Relayer, error) {
func (c *pluginRelayer) NewRelayer(ctx context.Context, config string, keystore loop.Keystore, capRegistry core.CapabilitiesRegistry) (loop.Relayer, error) {
d := toml.NewDecoder(strings.NewReader(config))
d.DisallowUnknownFields()
var cfg struct {
Expand All @@ -69,7 +70,7 @@ func (c *pluginRelayer) NewRelayer(ctx context.Context, config string, keystore
if err != nil {
return nil, fmt.Errorf("failed to create chain: %w", err)
}
ra := &loop.RelayerAdapter{Relayer: solana.NewRelayer(c.Logger, chain), RelayerExt: chain}
ra := &loop.RelayerAdapter{Relayer: solana.NewRelayer(c.Logger, chain, capRegistry), RelayerExt: chain}

c.SubService(ra)

Expand Down
3 changes: 2 additions & 1 deletion pkg/solana/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-common/pkg/services"
relaytypes "github.com/smartcontractkit/chainlink-common/pkg/types"
"github.com/smartcontractkit/chainlink-common/pkg/types/core"

"github.com/smartcontractkit/chainlink-solana/pkg/solana/client"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/txm"
Expand All @@ -34,7 +35,7 @@ type Relayer struct {
}

// Note: constructed in core
func NewRelayer(lggr logger.Logger, chain Chain) *Relayer {
func NewRelayer(lggr logger.Logger, chain Chain, capabilitiesRegistry core.CapabilitiesRegistry) *Relayer {
return &Relayer{
lggr: lggr,
chain: chain,
Expand Down

0 comments on commit 1198306

Please sign in to comment.