From 24d05c47bbeb39744f08362a65abf126448670f6 Mon Sep 17 00:00:00 2001 From: "valerii.kabisov" Date: Fri, 20 Sep 2024 11:16:46 +0900 Subject: [PATCH] [CCIP-3376] reformat --- .../interceptors/mantle/interceptor.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go b/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go index 0d7ad6418c..65cd88c6ee 100644 --- a/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go +++ b/core/services/ocr2/plugins/ccip/estimatorconfig/interceptors/mantle/interceptor.go @@ -48,22 +48,18 @@ func NewInterceptor(ctx context.Context, client evmClient.Client) (*Interceptor, callData: tokenRatioCallData, } - interceptor.tokenRatio, err = interceptor.getMantleGasPrice(ctx) - if err != nil { - return nil, fmt.Errorf("could not get token ratio from the Mantle oracle %v", err) - } - return interceptor, nil } // ModifyGasPriceComponents returns modified gasPrice. func (i *Interceptor) ModifyGasPriceComponents(ctx context.Context, gasPrice, daGasPrice *big.Int) (*big.Int, *big.Int, error) { if time.Since(i.tokenRatioLastUpdate) > tokenRatioUpdateInterval { - var err error - if i.tokenRatio, err = i.getMantleGasPrice(ctx); err != nil { + mantleTokenRatio, err := i.getMantleGasPrice(ctx) + if err != nil { return nil, nil, err } - i.tokenRatioLastUpdate = time.Now() + + i.tokenRatio, i.tokenRatioLastUpdate = mantleTokenRatio, time.Now() } newGasPrice := new(big.Int).Add(gasPrice, daGasPrice)