docs: add panics section (#5574)

This commit is contained in:
Matthias Seitz
2023-11-26 08:48:29 +01:00
committed by GitHub
parent b0944fb613
commit 8e6fb6b5d1

View File

@@ -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");