11use alloy:: {
2- consensus:: Transaction ,
2+ consensus:: { SignableTransaction , Transaction , TxEip1559 , TxEnvelope } ,
33 network:: { EthereumWallet , TransactionBuilder } ,
4- primitives:: U256 ,
4+ primitives:: { Address , U256 } ,
55 providers:: { Provider , ProviderBuilder } ,
66 signers:: local:: MnemonicBuilder ,
77 sol_types:: SolEvent ,
88} ;
99use alloy_eips:: eip2718:: Encodable2718 ;
10- use alloy_network:: Ethereum ;
10+ use alloy_network:: { Ethereum , TxSignerSync } ;
1111use alloy_primitives:: Bytes ;
1212use alloy_rpc_types_eth:: TransactionRequest ;
13- use reth_e2e_test_utils :: transaction :: TransactionTestContext ;
13+ use tempo_chainspec :: spec :: TEMPO_BASE_FEE ;
1414use tempo_contracts:: precompiles:: { IRolesAuth , ITIP20 , ITIP20Factory } ;
1515use tempo_node:: node:: TempoNode ;
1616use tempo_precompiles:: {
4040 tx_req. nonce = Some ( nonce) ;
4141 tx_req. chain_id = Some ( chain_id) ;
4242 tx_req. gas = tx_req. gas . or ( Some ( 200_000 ) ) ;
43- tx_req. max_fee_per_gas = tx_req. max_fee_per_gas . or ( Some ( 20e9 as u128 ) ) ;
44- tx_req. max_priority_fee_per_gas =
45- tx_req. max_priority_fee_per_gas . or ( Some ( 20e9 as u128 ) ) ;
43+ tx_req. max_fee_per_gas = tx_req. max_fee_per_gas . or ( Some ( TEMPO_BASE_FEE as u128 ) ) ;
44+ tx_req. max_priority_fee_per_gas = tx_req
45+ . max_priority_fee_per_gas
46+ . or ( Some ( TEMPO_BASE_FEE as u128 ) ) ;
4647
4748 let signed =
4849 <TransactionRequest as TransactionBuilder < Ethereum > >:: build ( tx_req, & signer_clone)
@@ -113,8 +114,23 @@ async fn inject_non_payment_txs(
113114 let wallet_signer = MnemonicBuilder :: from_phrase ( crate :: utils:: TEST_MNEMONIC )
114115 . index ( start_index + i as u32 ) ?
115116 . build ( ) ?;
116- let raw_tx = TransactionTestContext :: transfer_tx_bytes ( chain_id, wallet_signer) . await ;
117- node. rpc . inject_tx ( raw_tx) . await ?;
117+ let mut tx = TxEip1559 {
118+ chain_id,
119+ gas_limit : 21000 ,
120+ to : Address :: ZERO . into ( ) ,
121+ max_fee_per_gas : TEMPO_BASE_FEE as u128 ,
122+ max_priority_fee_per_gas : TEMPO_BASE_FEE as u128 ,
123+ ..Default :: default ( )
124+ } ;
125+ let signature = wallet_signer. sign_transaction_sync ( & mut tx) . unwrap ( ) ;
126+
127+ node. rpc
128+ . inject_tx (
129+ TxEnvelope :: Eip1559 ( tx. into_signed ( signature) )
130+ . encoded_2718 ( )
131+ . into ( ) ,
132+ )
133+ . await ?;
118134 }
119135 Ok ( ( ) )
120136}
@@ -140,8 +156,8 @@ where
140156 tx_request. nonce = Some ( current_nonce + i as u64 ) ;
141157 tx_request. chain_id = Some ( chain_id) ;
142158 tx_request. gas = Some ( 100_000 ) ;
143- tx_request. max_fee_per_gas = Some ( 20e9 as u128 ) ;
144- tx_request. max_priority_fee_per_gas = Some ( 20e9 as u128 ) ;
159+ tx_request. max_fee_per_gas = Some ( TEMPO_BASE_FEE as u128 ) ;
160+ tx_request. max_priority_fee_per_gas = Some ( TEMPO_BASE_FEE as u128 ) ;
145161
146162 let signed_tx =
147163 <TransactionRequest as TransactionBuilder < Ethereum > >:: build ( tx_request, & signer)
@@ -336,7 +352,20 @@ async fn test_block_building_only_non_payment_txs() -> eyre::Result<()> {
336352 . with_chain_id ( chain_id)
337353 . wallet_gen ( ) ;
338354 for wallet_signer in wallets {
339- let raw_tx = TransactionTestContext :: transfer_tx_bytes ( chain_id, wallet_signer) . await ;
355+ let raw_tx = {
356+ let mut tx = TxEip1559 {
357+ chain_id,
358+ gas_limit : 21000 ,
359+ to : Address :: ZERO . into ( ) ,
360+ max_fee_per_gas : TEMPO_BASE_FEE as u128 ,
361+ max_priority_fee_per_gas : TEMPO_BASE_FEE as u128 ,
362+ ..Default :: default ( )
363+ } ;
364+ let signature = wallet_signer. sign_transaction_sync ( & mut tx) . unwrap ( ) ;
365+ TxEnvelope :: Eip1559 ( tx. into_signed ( signature) )
366+ . encoded_2718 ( )
367+ . into ( )
368+ } ;
340369 setup. node . rpc . inject_tx ( raw_tx) . await ?;
341370 }
342371
0 commit comments