Skip to content

Commit

Permalink
Fix bug, return ref to temp value from getters
Browse files Browse the repository at this point in the history
  • Loading branch information
emhane committed Oct 2, 2024
1 parent 12c4ecb commit 24a379b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/primitives/src/traits/block/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ pub trait BlockBody:
type Header: BlockHeader;

/// Returns reference to transactions in block.
fn transactions(&self) -> &Vec<Self::SignedTransaction>;
fn transactions(&self) -> &[Self::SignedTransaction];

/// Returns [`Withdrawals`] in the block, if any.
fn withdrawals(&self) -> Option<&Withdrawals>;

/// Returns reference to uncle block headers.
fn ommers(&self) -> &Vec<Self::Header>;
fn ommers(&self) -> &[Self::Header];

/// Returns [`Request`] in block, if any.
fn requests(&self) -> Option<&Requests>;
Expand Down
1 change: 1 addition & 0 deletions crates/primitives/src/traits/block/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub trait Block:
{
/// Header part of the block.
type Header: BlockHeader + Sealable;

/// The block's body contains the transactions in the block.
type Body: BlockBody;

Expand Down

0 comments on commit 24a379b

Please sign in to comment.