Skip to content

Commit

Permalink
feat: remove unused iter
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Jan 13, 2025
1 parent 7aa620d commit 3e63d01
Showing 1 changed file with 1 addition and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,6 @@ func assembleBlockProposedIteratorCallback(
) error {
endHeight := end.Number.Uint64()

iter, err := taikoL1.FilterBlockProposed(
&bind.FilterOpts{Start: start.Number.Uint64(), End: &endHeight, Context: ctx},
filterQuery,
nil,
)
if err != nil {
return err
}
defer iter.Close()

iterOntake, err := taikoL1.FilterBlockProposedV2(
&bind.FilterOpts{Start: start.Number.Uint64(), End: &endHeight, Context: ctx},
filterQuery,
Expand All @@ -130,26 +120,6 @@ func assembleBlockProposedIteratorCallback(
}
defer iterOntake.Close()

for iter.Next() {
event := iter.Event

if err := callback(ctx, metadata.NewTaikoDataBlockMetadataLegacy(event), eventIter.end); err != nil {
return err
}

if eventIter.isEnd {
endFunc()
return nil
}

current, err := client.HeaderByHash(ctx, event.Raw.BlockHash)
if err != nil {
return err
}

updateCurrentFunc(current)
}

for iterOntake.Next() {
event := iterOntake.Event

Expand All @@ -171,11 +141,8 @@ func assembleBlockProposedIteratorCallback(
}

// Check iterator errors.
if iter.Error() != nil {
return iter.Error()
}
if iterOntake.Error() != nil {
return iter.Error()
return iterOntake.Error()
}

return nil
Expand Down

0 comments on commit 3e63d01

Please sign in to comment.