Skip to content

Commit

Permalink
change chain reader to use nil block number when reading unconfirmed …
Browse files Browse the repository at this point in the history
…latest value (#13906)
  • Loading branch information
ettec authored Jul 19, 2024
1 parent 2fcbefc commit 6adb827
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fresh-badgers-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#internal change chain reader to use nil blocknumber when reading latest value
4 changes: 2 additions & 2 deletions core/services/relay/evm/method_binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ func (m *methodBinding) blockNumberFromConfidence(ctx context.Context, confidenc
return nil, err
}

latest, finalized, err := m.ht.LatestAndFinalizedBlock(ctx)
_, finalized, err := m.ht.LatestAndFinalizedBlock(ctx)
if err != nil {
return nil, err
}

if confirmations == evmtypes.Finalized {
return big.NewInt(finalized.Number), nil
} else if confirmations == evmtypes.Unconfirmed {
return big.NewInt(latest.BlockNumber()), nil
return nil, nil
}

return nil, fmt.Errorf("unknown evm confirmations: %v for contract: %s, method: %s", confirmations, m.contractName, m.method)
Expand Down

0 comments on commit 6adb827

Please sign in to comment.