Skip to content

Commit 73ccda8

Browse files
committed
add offramp address and plugin type for the ccip provider
1 parent 24aec11 commit 73ccda8

File tree

4 files changed

+39
-7
lines changed

4 files changed

+39
-7
lines changed

pkg/loop/internal/pb/relayer.pb.go

Lines changed: 22 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/loop/internal/pb/relayer.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ message CCIPProviderArgs {
6060
bytes externalJobID = 1; // [32]byte
6161
bytes contractReaderConfig = 2;
6262
bytes chainWriterConfig = 3;
63+
string OffRampAddress = 4;
64+
uint32 pluginType = 5;
6365
}
6466

6567
// NewContractWriterRequest has request parameters for [github.com/smartcontractkit/chainlink-common/pkg/loop.Relayer.NewContractWriter].

pkg/loop/internal/relayer/test/relayer.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ type staticRelayerConfig struct {
7474
pluginArgs types.PluginArgs
7575
contractReaderConfig []byte
7676
chainWriterConfig []byte
77+
offRampAddress string
78+
pluginType uint32
7779
medianProvider testtypes.MedianProviderTester
7880
agnosticProvider testtypes.PluginProviderTester
7981
mercuryProvider mercurytest.MercuryProviderTester
@@ -99,6 +101,8 @@ func newStaticRelayerConfig(lggr logger.Logger, staticChecks bool) staticRelayer
99101
pluginArgs: PluginArgs,
100102
contractReaderConfig: []byte("test"),
101103
chainWriterConfig: []byte("chainwriterconfig"),
104+
offRampAddress: "fakeAddress",
105+
pluginType: 0,
102106
medianProvider: mediantest.MedianProvider(lggr),
103107
mercuryProvider: mercurytest.MercuryProvider(lggr),
104108
executionProvider: cciptest.ExecutionProvider(lggr),
@@ -310,10 +314,12 @@ func (s staticRelayer) NewLLOProvider(ctx context.Context, r types.RelayArgs, p
310314
}
311315

312316
func (s staticRelayer) NewCCIPProvider(ctx context.Context, r types.CCIPProviderArgs) (types.CCIPProvider, error) {
313-
ccipProviderArgs := types.CCIPProviderArgs {
314-
ExternalJobID: s.relayArgs.ExternalJobID,
317+
ccipProviderArgs := types.CCIPProviderArgs{
318+
ExternalJobID: s.relayArgs.ExternalJobID,
315319
ContractReaderConfig: s.contractReaderConfig,
316-
ChainWriterConfig: s.chainWriterConfig,
320+
ChainWriterConfig: s.chainWriterConfig,
321+
OffRampAddress: s.offRampAddress,
322+
PluginType: s.pluginType,
317323
}
318324
if s.StaticChecks && !equalCCIPProviderArgs(r, ccipProviderArgs) {
319325
return nil, fmt.Errorf("expected relay args:\n\t%v\nbut got:\n\t%v", s.relayArgs, r)
@@ -470,7 +476,9 @@ func equalRelayArgs(a, b types.RelayArgs) bool {
470476
func equalCCIPProviderArgs(a, b types.CCIPProviderArgs) bool {
471477
return a.ExternalJobID == b.ExternalJobID &&
472478
slices.Equal(a.ContractReaderConfig, b.ContractReaderConfig) &&
473-
slices.Equal(a.ChainWriterConfig, b.ChainWriterConfig)
479+
slices.Equal(a.ChainWriterConfig, b.ChainWriterConfig) &&
480+
a.OffRampAddress == b.OffRampAddress &&
481+
a.PluginType == b.PluginType
474482
}
475483

476484
func newRelayArgsWithProviderType(_type types.OCR2PluginType) types.RelayArgs {

pkg/types/provider_ccip.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ type CCIPProvider interface {
5858
// CCIPProviderArgs are the args required to create a CCIP Provider through a Relayer.
5959
// The are common to all relayer implementations.
6060
type CCIPProviderArgs struct {
61-
ExternalJobID uuid.UUID
61+
ExternalJobID uuid.UUID
6262
ContractReaderConfig []byte
6363
ChainWriterConfig []byte
64+
OffRampAddress string
65+
PluginType uint32
6466
}

0 commit comments

Comments
 (0)