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.
Source§impl<T: SignableTransaction<PrimitiveSignature>> Signed<T, PrimitiveSignature>
impl<T: SignableTransaction<PrimitiveSignature>> Signed<T, PrimitiveSignature>
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<'a, T: SignableTransaction<PrimitiveSignature> + Arbitrary<'a>> Arbitrary<'a> for Signed<T, PrimitiveSignature>
Available on crate features arbitrary
and k256
only.
impl<'a, T: SignableTransaction<PrimitiveSignature> + Arbitrary<'a>> Arbitrary<'a> for Signed<T, PrimitiveSignature>
arbitrary
and k256
only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self
from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured
this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured
this type
needs to construct itself. Read moreSource§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 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
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: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)