Skip to content

Commit

Permalink
chore: add as_recovered_ref
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Jan 21, 2025
1 parent 3fe70f0 commit 93d0ab0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/consensus/src/transaction/recovered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ impl<T> Recovered<T> {
(self.tx, self.signer)
}

/// Converts from `&Recovered<T>` to `Recovered<&T>`.
pub const fn as_recovered_ref(&self) -> Recovered<&T> {
Recovered { tx: &self.tx, signer: self.signer() }
}

/// Create [`Recovered`] from the given transaction and [`Address`] of the signer.
///
/// Note: This does not check if the signer is the actual signer of the transaction.
Expand Down

0 comments on commit 93d0ab0

Please sign in to comment.