From f04e6cbb0fd18fa71c2866c4f14a3632541c562f Mon Sep 17 00:00:00 2001 From: patrickhuie19 Date: Wed, 10 Jul 2024 18:06:07 -0400 Subject: [PATCH] lint --- core/services/ocr2/plugins/ccip/ccipexec/factory.go | 8 +++++--- core/services/ocr2/plugins/ccip/ccipexec/initializers.go | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/core/services/ocr2/plugins/ccip/ccipexec/factory.go b/core/services/ocr2/plugins/ccip/ccipexec/factory.go index 544246ae5d..33fbc69dcb 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/factory.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/factory.go @@ -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 @@ -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 { diff --git a/core/services/ocr2/plugins/ccip/ccipexec/initializers.go b/core/services/ocr2/plugins/ccip/ccipexec/initializers.go index 801027b249..1cc1cf893d 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/initializers.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/initializers.go @@ -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()) @@ -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 } }