Skip to content

Commit

Permalink
ocr2/plugins/ccip/internal/pricegetter: format correct error (#1195)
Browse files Browse the repository at this point in the history
## Motivation

We are formatting the wrong error in `fmt.Errorf`. This was actually the
root cause of `errcheck` not correctly flagging `err` as unchecked prior
to PR #1145

## Solution

Format the correct error.
  • Loading branch information
makramkd authored Jul 16, 2024
1 parent 6876a78 commit dac2b69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/services/ocr2/plugins/ccip/internal/pricegetter/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (d *DynamicPriceGetter) performBatchCall(ctx context.Context, chainID uint6
v, err1 := rpclib.ParseOutput[uint8](res, 0)
if err1 != nil {
callSignature := batchCalls.decimalCalls[i].String()
return fmt.Errorf("parse contract output while calling %v on chain %d: %w", callSignature, chainID, err)
return fmt.Errorf("parse contract output while calling %v on chain %d: %w", callSignature, chainID, err1)
}
decimals = append(decimals, v)
}
Expand All @@ -167,7 +167,7 @@ func (d *DynamicPriceGetter) performBatchCall(ctx context.Context, chainID uint6
v, err1 := rpclib.ParseOutput[*big.Int](res, 1)
if err1 != nil {
callSignature := batchCalls.latestRoundDataCalls[i].String()
return fmt.Errorf("parse contract output while calling %v on chain %d: %w", callSignature, chainID, err)
return fmt.Errorf("parse contract output while calling %v on chain %d: %w", callSignature, chainID, err1)
}
latestRounds = append(latestRounds, v)
}
Expand Down

0 comments on commit dac2b69

Please sign in to comment.