pub trait SignedTransaction:
Send
+ Sync
+ Unpin
+ Clone
+ Debug
+ PartialEq
+ Eq
+ Hash
+ Encodable
+ Decodable
+ Encodable2718
+ Decodable2718
+ Transaction
+ MaybeSerde
+ InMemorySize {
Show 13 methods
// Required methods
fn tx_hash(&self) -> &TxHash;
fn signature(&self) -> &Signature;
fn recover_signer(&self) -> Result<Address, RecoveryError>;
fn recover_signer_unchecked_with_buf(
&self,
buf: &mut Vec<u8>,
) -> Result<Address, RecoveryError>;
// Provided methods
fn is_broadcastable_in_full(&self) -> bool { ... }
fn try_recover(&self) -> Result<Address, RecoveryError> { ... }
fn recover_signer_unchecked(&self) -> Result<Address, RecoveryError> { ... }
fn try_recover_unchecked(&self) -> Result<Address, RecoveryError> { ... }
fn recalculate_hash(&self) -> B256 { ... }
fn try_clone_into_recovered(&self) -> Result<Recovered<Self>, RecoveryError> { ... }
fn try_into_recovered(self) -> Result<Recovered<Self>, Self> { ... }
fn into_recovered_unchecked(self) -> Result<Recovered<Self>, RecoveryError> { ... }
fn with_signer(self, signer: Address) -> Recovered<Self> { ... }
}
Expand description
A signed transaction.
Required Methods§
Sourcefn recover_signer(&self) -> Result<Address, RecoveryError>
fn recover_signer(&self) -> Result<Address, RecoveryError>
Recover signer from signature and hash.
Returns RecoveryError
if the transaction’s signature is invalid following EIP-2, see also reth_primitives::transaction::recover_signer
.
Note:
This can fail for some early ethereum mainnet transactions pre EIP-2, use
Self::recover_signer_unchecked
if you want to recover the signer without ensuring that
the signature has a low s
value.
Sourcefn recover_signer_unchecked_with_buf(
&self,
buf: &mut Vec<u8>,
) -> Result<Address, RecoveryError>
fn recover_signer_unchecked_with_buf( &self, buf: &mut Vec<u8>, ) -> Result<Address, RecoveryError>
Same as Self::recover_signer_unchecked
but receives a buffer to operate on. This is used
during batch recovery to avoid allocating a new buffer for each transaction.
Provided Methods§
Sourcefn is_broadcastable_in_full(&self) -> bool
fn is_broadcastable_in_full(&self) -> bool
Returns whether this transaction type can be broadcasted as full transaction over the network.
Some transactions are not broadcastable as objects and only allowed to be broadcasted as hashes, e.g. because they missing context (e.g. blob sidecar).
Sourcefn try_recover(&self) -> Result<Address, RecoveryError>
fn try_recover(&self) -> Result<Address, RecoveryError>
Recover signer from signature and hash.
Returns an error if the transaction’s signature is invalid.
Sourcefn recover_signer_unchecked(&self) -> Result<Address, RecoveryError>
fn recover_signer_unchecked(&self) -> Result<Address, RecoveryError>
Recover signer from signature and hash without ensuring that the signature has a low s
value.
Returns None
if the transaction’s signature is invalid, see also
reth_primitives::transaction::recover_signer_unchecked
.
Sourcefn try_recover_unchecked(&self) -> Result<Address, RecoveryError>
fn try_recover_unchecked(&self) -> Result<Address, RecoveryError>
Recover signer from signature and hash without ensuring that the signature has a low s
value.
Returns an error if the transaction’s signature is invalid.
Sourcefn recalculate_hash(&self) -> B256
fn recalculate_hash(&self) -> B256
Calculate transaction hash, eip2728 transaction does not contain rlp header and start with tx type.
Sourcefn try_clone_into_recovered(&self) -> Result<Recovered<Self>, RecoveryError>
fn try_clone_into_recovered(&self) -> Result<Recovered<Self>, RecoveryError>
Tries to recover signer and return Recovered
by cloning the type.
Sourcefn try_into_recovered(self) -> Result<Recovered<Self>, Self>
fn try_into_recovered(self) -> Result<Recovered<Self>, Self>
Tries to recover signer and return Recovered
.
Returns Err(Self)
if the transaction’s signature is invalid, see also
SignedTransaction::recover_signer
.
Sourcefn into_recovered_unchecked(self) -> Result<Recovered<Self>, RecoveryError>
fn into_recovered_unchecked(self) -> Result<Recovered<Self>, RecoveryError>
Consumes the type, recover signer and return Recovered
without
ensuring that the signature has a low s
value (EIP-2).
Returns None
if the transaction’s signature is invalid.
Sourcefn with_signer(self, signer: Address) -> Recovered<Self>
fn with_signer(self, signer: Address) -> Recovered<Self>
Returns the Recovered
transaction with the given sender.
Note: assumes the given signer is the signer of this transaction.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl SignedTransaction for OpPooledTransaction
Available on crate feature op
only.
impl SignedTransaction for OpPooledTransaction
op
only.