Struct alloy_consensus::Signed
source · pub struct Signed<T, Sig = PrimitiveSignature> { /* private fields */ }
Expand description
A transaction with a signature and hash seal.
Implementations§
source§impl<T, Sig> Signed<T, Sig>
impl<T, 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 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 fn signature_hash(&self) -> B256
pub fn signature_hash(&self) -> B256
Calculate the signing hash for the transaction.
source§impl<T> Signed<T>where
T: RlpEcdsaTx,
impl<T> Signed<T>where
T: RlpEcdsaTx,
sourcepub fn rlp_encoded_length(&self) -> usize
pub fn rlp_encoded_length(&self) -> usize
Get the length of the transaction when RLP encoded.
sourcepub fn rlp_encode(&self, out: &mut dyn BufMut)
pub fn rlp_encode(&self, out: &mut dyn BufMut)
RLP encode the signed transaction.
sourcepub fn eip2718_encoded_length(&self) -> usize
pub fn eip2718_encoded_length(&self) -> usize
Get the length of the transaction when EIP-2718 encoded.
sourcepub fn eip2718_encode_with_type(&self, ty: u8, out: &mut dyn BufMut)
pub fn eip2718_encode_with_type(&self, ty: u8, out: &mut dyn BufMut)
EIP-2718 encode the signed transaction with a specified type flag.
sourcepub fn eip2718_encode(&self, out: &mut dyn BufMut)
pub fn eip2718_encode(&self, out: &mut dyn BufMut)
EIP-2718 encode the signed transaction.
sourcepub fn network_encoded_length(&self) -> usize
pub fn network_encoded_length(&self) -> usize
Get the length of the transaction when network encoded.
sourcepub fn network_encode_with_type(&self, ty: u8, out: &mut dyn BufMut)
pub fn network_encode_with_type(&self, ty: u8, out: &mut dyn BufMut)
Network encode the signed transaction with a specified type flag.
sourcepub fn network_encode(&self, out: &mut dyn BufMut)
pub fn network_encode(&self, out: &mut dyn BufMut)
Network encode the signed transaction.
sourcepub fn rlp_decode(buf: &mut &[u8]) -> Result<Self>
pub fn rlp_decode(buf: &mut &[u8]) -> Result<Self>
RLP decode the signed transaction.
sourcepub fn eip2718_decode_with_type(buf: &mut &[u8], ty: u8) -> Eip2718Result<Self>
pub fn eip2718_decode_with_type(buf: &mut &[u8], ty: u8) -> Eip2718Result<Self>
EIP-2718 decode the signed transaction with a specified type flag.
sourcepub fn eip2718_decode(buf: &mut &[u8]) -> Eip2718Result<Self>
pub fn eip2718_decode(buf: &mut &[u8]) -> Eip2718Result<Self>
EIP-2718 decode the signed transaction.
sourcepub fn network_decode_with_type(buf: &mut &[u8], ty: u8) -> Eip2718Result<Self>
pub fn network_decode_with_type(buf: &mut &[u8], ty: u8) -> Eip2718Result<Self>
Network decode the signed transaction with a specified type flag.
sourcepub fn network_decode(buf: &mut &[u8]) -> Eip2718Result<Self>
pub fn network_decode(buf: &mut &[u8]) -> Eip2718Result<Self>
Network decode the signed 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>,
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
source§impl From<Signed<TxEip4844WithSidecar>> for PooledTransaction
impl From<Signed<TxEip4844WithSidecar>> for PooledTransaction
source§fn from(v: Signed<TxEip4844WithSidecar>) -> Self
fn from(v: Signed<TxEip4844WithSidecar>) -> Self
source§impl From<Signed<TxEip4844WithSidecar>> for Signed<TxEip4844Variant>
impl From<Signed<TxEip4844WithSidecar>> for Signed<TxEip4844Variant>
source§fn from(value: Signed<TxEip4844WithSidecar>) -> Self
fn from(value: Signed<TxEip4844WithSidecar>) -> Self
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
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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.