Skip to content

Commit

Permalink
Address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-cordenier committed Sep 7, 2023
1 parent 46a34d1 commit c5f6e4f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/services/chainlink/relayer_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (r *RelayerFactory) NewEVM(ctx context.Context, config EVMFactoryConfig) (m
if err != nil {
return nil, err
}
relayer := evmrelay.NewLoopRelayAdapter(evmrelay.NewRelayer(ccOpts.DB, chain, r.QConfig, ccOpts.Logger, config.CSAETHKeystore, ccOpts.EventBroadcaster), ext)
relayer := evmrelay.NewLoopRelayServerAdapter(evmrelay.NewRelayer(ccOpts.DB, chain, r.QConfig, ccOpts.Logger, config.CSAETHKeystore, ccOpts.EventBroadcaster), ext)
relayers[relayID] = relayer
}

Expand Down
2 changes: 1 addition & 1 deletion core/services/job/spawner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type relayGetter struct {
}

func (g *relayGetter) Get(id relay.ID) (loop.Relayer, error) {
return evmrelayer.NewLoopRelayAdapter(g.r, g.e), nil
return evmrelayer.NewLoopRelayServerAdapter(g.r, g.e), nil
}

func TestSpawner_CreateJobDeleteJob(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion core/services/relay/evm/loop_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type LoopRelayer struct {

var _ loop.Relayer = &LoopRelayer{}

func NewLoopRelayAdapter(r *Relayer, cs EVMChainRelayerExtender) *LoopRelayer {
func NewLoopRelayServerAdapter(r *Relayer, cs EVMChainRelayerExtender) *LoopRelayer {
ra := relay.NewRelayerServerAdapter(r, cs)
return &LoopRelayer{
Relayer: ra,
Expand Down
2 changes: 2 additions & 0 deletions core/services/relay/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ type relayerAdapter struct {
}

// NewRelayerAdapter returns a [loop.Relayer] adapted from a [types.Relayer] and [RelayerExt].
// Unlike NewRelayerServerAdapter which is used to adapt non-LOOPP relayers, this is used to adapt
// LOOPP-based relayer which are then server over GRPC (by the relayerServer).
func NewRelayerAdapter(r types.Relayer, e RelayerExt) loop.Relayer {
return &relayerAdapter{Relayer: r, RelayerExt: e}
}
Expand Down

0 comments on commit c5f6e4f

Please sign in to comment.