Skip to content

Commit

Permalink
docs: add panic section
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Nov 26, 2023
1 parent 1308b67 commit 748e85f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/primitives/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ impl Block {
}

/// Transform into a [`BlockWithSenders`].
///
/// # Panics
///
/// If the number of senders does not match the number of transactions in the block.
#[track_caller]
pub fn with_senders(self, senders: Vec<Address>) -> BlockWithSenders {
assert_eq!(self.body.len(), senders.len(), "Unequal number of senders");

Expand Down

0 comments on commit 748e85f

Please sign in to comment.