@@ -7,28 +7,6 @@ use alloy_rpc_types_eth::{request::TransactionRequest, TransactionInfo};
77use reth_primitives:: { RecoveredTx , TransactionSigned } ;
88use serde:: { Deserialize , Serialize } ;
99
10- /// Create a new rpc transaction result for a mined transaction, using the given block hash,
11- /// number, and tx index fields to populate the corresponding fields in the rpc result.
12- ///
13- /// The block hash, number, and tx index fields should be from the original block where the
14- /// transaction was mined.
15- pub fn from_recovered_with_block_context < Tx , T : TransactionCompat < Tx > > (
16- tx : RecoveredTx < Tx > ,
17- tx_info : TransactionInfo ,
18- resp_builder : & T ,
19- ) -> Result < T :: Transaction , T :: Error > {
20- resp_builder. fill ( tx, tx_info)
21- }
22-
23- /// Create a new rpc transaction result for a _pending_ signed transaction, setting block
24- /// environment related fields to `None`.
25- pub fn from_recovered < Tx , T : TransactionCompat < Tx > > (
26- tx : RecoveredTx < Tx > ,
27- resp_builder : & T ,
28- ) -> Result < T :: Transaction , T :: Error > {
29- resp_builder. fill ( tx, TransactionInfo :: default ( ) )
30- }
31-
3210/// Builds RPC transaction w.r.t. network.
3311pub trait TransactionCompat < T = TransactionSigned > :
3412 Send + Sync + Unpin + Clone + fmt:: Debug
@@ -45,8 +23,18 @@ pub trait TransactionCompat<T = TransactionSigned>:
4523 /// RPC transaction error type.
4624 type Error : error:: Error + Into < jsonrpsee_types:: ErrorObject < ' static > > ;
4725
26+ /// Wrapper for `fill()` with default `TransactionInfo`
4827 /// Create a new rpc transaction result for a _pending_ signed transaction, setting block
4928 /// environment related fields to `None`.
29+ fn fill_pending ( & self , tx : RecoveredTx < T > ) -> Result < Self :: Transaction , Self :: Error > {
30+ self . fill ( tx, TransactionInfo :: default ( ) )
31+ }
32+
33+ /// Create a new rpc transaction result for a mined transaction, using the given block hash,
34+ /// number, and tx index fields to populate the corresponding fields in the rpc result.
35+ ///
36+ /// The block hash, number, and tx index fields should be from the original block where the
37+ /// transaction was mined.
5038 fn fill (
5139 & self ,
5240 tx : RecoveredTx < T > ,
0 commit comments