pub struct Signed<T, Sig = Signature> { /* 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 fn new_unchecked(tx: T, signature: Sig, hash: B256) -> Self
pub fn new_unchecked(tx: T, signature: Sig, hash: B256) -> Self
Instantiate from a transaction and signature. Does not verify the signature.
Sourcepub const fn new_unhashed(tx: T, signature: Sig) -> Self
pub const fn new_unhashed(tx: T, signature: Sig) -> Self
Instantiate from a transaction and signature. Does not verify the signature.
Sourcepub fn strip_signature(self) -> T
pub fn strip_signature(self) -> T
Returns the transaction without signature.
Sourcepub fn convert<U>(self) -> Signed<U, Sig>where
U: From<T>,
pub fn convert<U>(self) -> Signed<U, Sig>where
U: From<T>,
Converts the transaction type to the given alternative that is From<T>
Caution: This is only intended for converting transaction types that are structurally equivalent (produce the same hash).
Sourcepub fn try_convert<U>(self) -> Result<Signed<U, Sig>, U::Error>where
U: TryFrom<T>,
pub fn try_convert<U>(self) -> Result<Signed<U, Sig>, U::Error>where
U: TryFrom<T>,
Converts the transaction to the given alternative that is TryFrom<T>
Returns the transaction with the new transaction type if all conversions were successful.
Caution: This is only intended for converting transaction types that are structurally equivalent (produce the same hash).
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: RlpEcdsaEncodableTx,
impl<T> Signed<T>where
T: RlpEcdsaEncodableTx,
Sourcepub fn into_parts(self) -> (T, Signature, B256)
pub fn into_parts(self) -> (T, Signature, B256)
Splits the transaction into parts.
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.
Source§impl<T> Signed<T>where
T: RlpEcdsaDecodableTx,
impl<T> Signed<T>where
T: RlpEcdsaDecodableTx,
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<T> Decodable2718 for Signed<T>
impl<T> Decodable2718 for Signed<T>
Source§fn typed_decode(ty: u8, buf: &mut &[u8]) -> Eip2718Result<Self>
fn typed_decode(ty: u8, buf: &mut &[u8]) -> Eip2718Result<Self>
Source§fn fallback_decode(buf: &mut &[u8]) -> Eip2718Result<Self>
fn fallback_decode(buf: &mut &[u8]) -> Eip2718Result<Self>
Source§fn extract_type_byte(buf: &mut &[u8]) -> Option<u8>
fn extract_type_byte(buf: &mut &[u8]) -> Option<u8>
Source§fn decode_2718(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
fn decode_2718(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
Source§fn network_decode(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
fn network_decode(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
Source§impl<'de, T, Sig> Deserialize<'de> for Signed<T, Sig>
impl<'de, T, Sig> Deserialize<'de> for Signed<T, Sig>
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<T> Encodable2718 for Signed<T>
impl<T> Encodable2718 for Signed<T>
Source§fn encode_2718_len(&self) -> usize
fn encode_2718_len(&self) -> usize
Source§fn encode_2718(&self, out: &mut dyn BufMut)
fn encode_2718(&self, out: &mut dyn BufMut)
Source§fn trie_hash(&self) -> B256
fn trie_hash(&self) -> B256
Source§fn encoded_2718(&self) -> Vec<u8> ⓘ
fn encoded_2718(&self) -> Vec<u8> ⓘ
Source§fn network_len(&self) -> usize
fn network_len(&self) -> usize
Source§fn network_encode(&self, out: &mut dyn BufMut)
fn network_encode(&self, out: &mut dyn BufMut)
Source§impl<Eip4844: RlpEcdsaEncodableTx> From<EthereumTxEnvelope<Eip4844>> for Signed<EthereumTypedTransaction<Eip4844>>where
EthereumTypedTransaction<Eip4844>: From<Eip4844>,
impl<Eip4844: RlpEcdsaEncodableTx> From<EthereumTxEnvelope<Eip4844>> for Signed<EthereumTypedTransaction<Eip4844>>where
EthereumTypedTransaction<Eip4844>: From<Eip4844>,
Source§fn from(value: EthereumTxEnvelope<Eip4844>) -> Self
fn from(value: EthereumTxEnvelope<Eip4844>) -> Self
Source§impl<T, Eip4844> From<Signed<T>> for EthereumTxEnvelope<Eip4844>where
EthereumTypedTransaction<Eip4844>: From<T>,
T: RlpEcdsaEncodableTx,
impl<T, Eip4844> From<Signed<T>> for EthereumTxEnvelope<Eip4844>where
EthereumTypedTransaction<Eip4844>: From<T>,
T: RlpEcdsaEncodableTx,
Source§impl<T: Encodable7594> From<Signed<TxEip4844WithSidecar<T>>> for Signed<TxEip4844Variant<T>>
impl<T: Encodable7594> From<Signed<TxEip4844WithSidecar<T>>> for Signed<TxEip4844Variant<T>>
Source§fn from(value: Signed<TxEip4844WithSidecar<T>>) -> Self
fn from(value: Signed<TxEip4844WithSidecar<T>>) -> Self
Source§impl<T: Encodable7594> TryFrom<Signed<TxEip4844Variant<T>>> for EthereumTxEnvelope<TxEip4844WithSidecar<T>>
impl<T: Encodable7594> TryFrom<Signed<TxEip4844Variant<T>>> for EthereumTxEnvelope<TxEip4844WithSidecar<T>>
Source§type Error = ValueError<Signed<TxEip4844Variant<T>>>
type Error = ValueError<Signed<TxEip4844Variant<T>>>
Source§impl<T> Typed2718 for Signed<T>
impl<T> Typed2718 for Signed<T>
Source§fn is_eip2930(&self) -> bool
fn is_eip2930(&self) -> bool
Source§fn is_eip1559(&self) -> bool
fn is_eip1559(&self) -> bool
Source§fn is_eip4844(&self) -> bool
fn is_eip4844(&self) -> bool
Source§fn is_eip7702(&self) -> bool
fn is_eip7702(&self) -> bool
impl<T: RlpEcdsaEncodableTx + PartialEq> Eq for Signed<T>
Auto Trait Implementations§
impl<T, Sig = Signature> !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§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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> ⓘ
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> ⓘ
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 more