Skip to content

Commit

Permalink
fix check nil sequence (#21)
Browse files Browse the repository at this point in the history
* fix check nil sequence
  • Loading branch information
ToniRamirezM authored Apr 18, 2024
1 parent 564850a commit 500f272
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,11 @@ func (a *Aggregator) getAndLockBatchToProve(ctx context.Context, prover proverIn
return nil, nil, nil, err
}

// Not found, so it it not possible to verify the batch yet
if sequence == nil {
return nil, nil, nil, state.ErrNotFound
}

stateSequence := state.Sequence{
FromBatchNumber: sequence.FromBatchNumber,
ToBatchNumber: sequence.ToBatchNumber,
Expand All @@ -999,11 +1004,6 @@ func (a *Aggregator) getAndLockBatchToProve(ctx context.Context, prover proverIn
return nil, nil, nil, err
}

// Not found, so it it not possible to verify the batch yet
if sequence == nil {
return nil, nil, nil, state.ErrNotFound
}

batch, datastream, err := a.state.GetBatch(ctx, batchNumberToVerify, nil)
if err != nil {
return nil, batch, nil, err
Expand Down

0 comments on commit 500f272

Please sign in to comment.