Skip to content

Commit

Permalink
make signed_legacy_serde generic
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Oct 30, 2024
1 parent 4e8ac92 commit 828bc9c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/consensus/src/signed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ pub struct Signed<T, Sig = Signature> {
}

impl<T, Sig> Signed<T, Sig> {
/// Instantiate from a transaction and signature. Does not verify the signature.
pub const fn new_unchecked(tx: T, signature: Sig, hash: B256) -> Self {
Self { tx, signature, hash }
}

/// Returns a reference to the transaction.
#[doc(alias = "transaction")]
pub const fn tx(&self) -> &T {
Expand Down Expand Up @@ -46,11 +51,6 @@ impl<T, Sig> Signed<T, Sig> {
}

impl<T: SignableTransaction<Sig>, Sig> Signed<T, Sig> {
/// Instantiate from a transaction and signature. Does not verify the signature.
pub const fn new_unchecked(tx: T, signature: Sig, hash: B256) -> Self {
Self { tx, signature, hash }
}

/// Calculate the signing hash for the transaction.
pub fn signature_hash(&self) -> B256 {
self.tx.signature_hash()
Expand Down

0 comments on commit 828bc9c

Please sign in to comment.