Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

Commit

Permalink
fix(commit_store): fix skip_while_next warning on get_batch_by_transa…
Browse files Browse the repository at this point in the history
…ction

Signed-off-by: Joseph Livesey <[email protected]>
  • Loading branch information
suchapalaver committed Mar 3, 2023
1 parent 0fa9094 commit a767aec
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions validator/src/journal/commit_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,12 @@ impl CommitStore {
block
.batches
.into_iter()
.skip_while(|batch| {
.find(|batch| {
batch
.transaction_ids
.iter()
.all(|txn_id| txn_id != transaction_id)
.any(|txn_id| txn_id == transaction_id)
})
.next()
.ok_or_else(|| {
DatabaseError::CorruptionError("Transaction index corrupted".into())
})
Expand Down Expand Up @@ -616,13 +615,12 @@ mod tests {
block
.batches
.into_iter()
.skip_while(|batch| {
.find(|batch| {
batch
.transaction_ids
.iter()
.all(|txn_id| txn_id != transaction_id)
.any(|txn_id| txn_id == transaction_id)
})
.next()
.ok_or_else(|| DatabaseError::CorruptionError("Transaction index corrupted".into()))
// })
}
Expand Down

0 comments on commit a767aec

Please sign in to comment.