Struct alloy_consensus::signed::Signed
source · pub struct Signed<T, Sig = Signature> {
tx: T,
signature: Sig,
hash: B256,
}
Expand description
A transaction with a signature and hash seal.
Fields§
§tx: T
§signature: Sig
§hash: B256
Implementations§
source§impl<T, Sig> Signed<T, Sig>
impl<T, Sig> Signed<T, Sig>
sourcepub fn into_parts(self) -> (T, Sig, B256)
pub fn into_parts(self) -> (T, Sig, B256)
Splits the transaction into parts.
sourcepub fn strip_signature(self) -> T
pub fn strip_signature(self) -> T
Returns the transaction without signature.
source§impl<T: SignableTransaction<Sig>, Sig> Signed<T, Sig>
impl<T: SignableTransaction<Sig>, Sig> Signed<T, Sig>
sourcepub const fn new_unchecked(tx: T, signature: Sig, hash: B256) -> Self
pub const fn new_unchecked(tx: T, signature: Sig, hash: B256) -> Self
Instantiate from a transaction and signature. Does not verify the signature.
sourcepub fn signature_hash(&self) -> B256
pub fn signature_hash(&self) -> B256
Calculate the signing hash for the transaction.
source§impl<T: SignableTransaction<Signature>> Signed<T, Signature>
impl<T: SignableTransaction<Signature>> Signed<T, Signature>
sourcepub fn recover_signer(&self) -> Result<Address, SignatureError>
Available on crate feature k256
only.
pub fn recover_signer(&self) -> Result<Address, SignatureError>
k256
only.Recover the signer of the transaction
Trait Implementations§
source§impl<'de, T, Sig> Deserialize<'de> for Signed<T, Sig>where
T: Deserialize<'de>,
Sig: Deserialize<'de>,
impl<'de, T, Sig> Deserialize<'de> for Signed<T, Sig>where
T: Deserialize<'de>,
Sig: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<Signed<TxEip4844Variant>> for TxEnvelope
impl From<Signed<TxEip4844Variant>> for TxEnvelope
source§fn from(v: Signed<TxEip4844Variant>) -> Self
fn from(v: Signed<TxEip4844Variant>) -> Self
Converts to this type from the input type.
source§impl From<Signed<TxEip4844WithSidecar>> for TxEnvelope
impl From<Signed<TxEip4844WithSidecar>> for TxEnvelope
source§fn from(v: Signed<TxEip4844WithSidecar>) -> Self
fn from(v: Signed<TxEip4844WithSidecar>) -> Self
Converts to this type from the input type.
source§impl<T: PartialEq, Sig: PartialEq> PartialEq for Signed<T, Sig>
impl<T: PartialEq, Sig: PartialEq> PartialEq for Signed<T, Sig>
impl<T: Copy, Sig: Copy> Copy for Signed<T, Sig>
impl<T: Eq, Sig: Eq> Eq for Signed<T, Sig>
impl<T, Sig> StructuralPartialEq for Signed<T, Sig>
Auto Trait Implementations§
impl<T, Sig> Freeze for Signed<T, Sig>
impl<T, Sig> RefUnwindSafe for Signed<T, Sig>where
T: RefUnwindSafe,
Sig: RefUnwindSafe,
impl<T, Sig> Send for Signed<T, Sig>
impl<T, Sig> Sync for Signed<T, Sig>
impl<T, Sig> Unpin for Signed<T, Sig>
impl<T, Sig> UnwindSafe for Signed<T, Sig>where
T: UnwindSafe,
Sig: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreimpl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.