pub trait TransactionCompat<T = TransactionSigned>:
Send
+ Sync
+ Unpin
+ Clone
+ Debug {
type Transaction: Serialize + for<'de> Deserialize<'de> + Send + Sync + Unpin + Clone + Debug;
type Error: Error + Into<ErrorObject<'static>>;
// Required methods
fn fill(
&self,
tx: Recovered<T>,
tx_inf: TransactionInfo,
) -> Result<Self::Transaction, Self::Error>;
fn build_simulate_v1_transaction(
&self,
request: TransactionRequest,
) -> Result<T, Self::Error>;
fn otterscan_api_truncate_input(tx: &mut Self::Transaction);
// Provided method
fn fill_pending(
&self,
tx: Recovered<T>,
) -> Result<Self::Transaction, Self::Error> { ... }
}
Expand description
Builds RPC transaction w.r.t. network.
Required Associated Types§
Sourcetype Transaction: Serialize + for<'de> Deserialize<'de> + Send + Sync + Unpin + Clone + Debug
type Transaction: Serialize + for<'de> Deserialize<'de> + Send + Sync + Unpin + Clone + Debug
RPC transaction response type.
Required Methods§
Sourcefn fill(
&self,
tx: Recovered<T>,
tx_inf: TransactionInfo,
) -> Result<Self::Transaction, Self::Error>
fn fill( &self, tx: Recovered<T>, tx_inf: TransactionInfo, ) -> Result<Self::Transaction, Self::Error>
Create a new rpc transaction result for a mined transaction, using the given block hash, number, and tx index fields to populate the corresponding fields in the rpc result.
The block hash, number, and tx index fields should be from the original block where the transaction was mined.
Sourcefn build_simulate_v1_transaction(
&self,
request: TransactionRequest,
) -> Result<T, Self::Error>
fn build_simulate_v1_transaction( &self, request: TransactionRequest, ) -> Result<T, Self::Error>
Builds a fake transaction from a transaction request for inclusion into block built in
eth_simulateV1
.
Sourcefn otterscan_api_truncate_input(tx: &mut Self::Transaction)
fn otterscan_api_truncate_input(tx: &mut Self::Transaction)
Truncates the input of a transaction to only the first 4 bytes.
Provided Methods§
Sourcefn fill_pending(
&self,
tx: Recovered<T>,
) -> Result<Self::Transaction, Self::Error>
fn fill_pending( &self, tx: Recovered<T>, ) -> Result<Self::Transaction, Self::Error>
Wrapper for fill()
with default TransactionInfo
Create a new rpc transaction result for a pending signed transaction, setting block
environment related fields to None
.
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.