Commit 944f75c8 authored by smartcontracts's avatar smartcontracts Committed by GitHub

Merge pull request #2214 from ethereum-optimism/sc/sdk-fix-no-batch

fix(sdk): correctly handle no batch case
parents 25d140ee f37c283c
---
'@eth-optimism/sdk': patch
---
Have SDK properly handle case when no batches are submitted yet
......@@ -654,6 +654,11 @@ export class CrossChainMessenger implements ICrossChainMessenger {
let batchEvent: ethers.Event | null =
await this.getStateBatchAppendedEventByBatchIndex(upperBound)
// Only happens when no batches have been submitted yet.
if (batchEvent === null) {
return null
}
if (isEventLo(batchEvent, transactionIndex)) {
// Upper bound is too low, means this transaction doesn't have a corresponding state batch yet.
return null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment