Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhuie19 committed Jul 10, 2024
1 parent 5f8c04e commit f04e6cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions core/services/ocr2/plugins/ccip/ccipexec/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,10 @@ func NewExecutionReportingPluginFactoryV2(ctx context.Context, lggr logger.Logge
// when the provider is created. In some cases the attestation API can be nil, which means we
// don't want any token data providers. This should not cause creating the job to fail, so we
// give an empty map and move on.
if err2.Error() == "empty USDC attestation API" {
tokenDataProviders = make(map[cciptypes.Address]tokendata.Reader)
} else {
if err2.Error() != "empty USDC attestation API" {
return nil, fmt.Errorf("new usdc reader: %w", err2)
}
tokenDataProviders = make(map[cciptypes.Address]tokendata.Reader)
}

// Prom wrappers
Expand Down Expand Up @@ -256,6 +255,9 @@ func (rf *ExecutionReportingPluginFactory) newReportingPluginFn(config types.Rep
// Using Start, while a bit more obtuse, allows us to manage these services
// in the same process as the plugin factory in LOOP mode
err := rf.Start(ctx)
if err != nil {
return reportingPluginAndInfo{}, err
}

destPriceRegistry, destWrappedNative, err := rf.config.offRampReader.ChangeConfig(ctx, config.OnchainConfig, config.OffchainConfig)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions core/services/ocr2/plugins/ccip/ccipexec/initializers.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func NewExecServices(ctx context.Context, lggr logger.Logger, cfg plugins.Regist
loopEnabled := loopCmd != ""

var pluginFactory types.ReportingPluginFactory
var err error
if loopEnabled {
// find loop command
envVars, err := plugins.ParseEnvFile(env.CCIPExecPlugin.Env.Get())
Expand All @@ -73,9 +72,10 @@ func NewExecServices(ctx context.Context, lggr logger.Logger, cfg plugins.Regist
factoryServer := loop.NewExecutionService(lggr, grpcOpts, cmdFn, srcProvider, dstProvider, uint32(srcChainID), uint32(dstChainID), sourceTokenAddress)
pluginFactory = factoryServer
} else {
pluginFactory, err = NewExecutionReportingPluginFactoryV2(ctx, lggr, sourceTokenAddress, srcChainID, dstChainID, srcProvider, dstProvider)
if err != nil {
return nil, err
var err2 error
pluginFactory, err2 = NewExecutionReportingPluginFactoryV2(ctx, lggr, sourceTokenAddress, srcChainID, dstChainID, srcProvider, dstProvider)
if err2 != nil {
return nil, err2
}
}

Expand Down

0 comments on commit f04e6cb

Please sign in to comment.