Skip to content

Commit

Permalink
Better panic explanations
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex6323 committed Apr 29, 2022
1 parent a04c59b commit 49e3c29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bee-ledger/src/workers/pruning/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,13 @@ fn prune_message_and_metadata<S: StorageBackend>(
let mut byte_length = 0usize;

if by_size {
// Panic: we know the message is in the database.
// Panic: we know the message is in the database, because the caller already made sure of that.
let msg = Fetch::<MessageId, Message>::fetch(storage, message_id)
.map_err(|e| PruningError::Storage(Box::new(e)))?
.unwrap();
byte_length += msg.packed_len();

// Panic: we know the message metadata is in the database.
// Panic: we know the message metadata is in the database for the same reason as above.
let md = Fetch::<MessageId, MessageMetadata>::fetch(storage, message_id)
.map_err(|e| PruningError::Storage(Box::new(e)))?
.unwrap();
Expand Down

0 comments on commit 49e3c29

Please sign in to comment.