@@ -132,7 +132,7 @@ async fn prepare_evm_transactions<Client: EthRpcClient + Sync + Send>(
132132 let mut transactions = Vec :: new ( ) ;
133133 for i in ( 0 ..count) . rev ( ) {
134134 let nonce = start_nonce. saturating_add ( U256 :: from ( i as u64 ) ) ;
135- let tx_builder = TransactionBuilder :: new ( client)
135+ let tx_builder = TransactionBuilder :: new ( Arc :: clone ( client) )
136136 . signer ( signer. clone ( ) )
137137 . nonce ( nonce)
138138 . value ( amount)
@@ -309,7 +309,11 @@ async fn test_transfer(client: Arc<WsClient>) -> anyhow::Result<()> {
309309 let initial_balance = client. get_balance ( ethan. address ( ) , BlockTag :: Latest . into ( ) ) . await ?;
310310
311311 let value = 1_000_000_000_000_000_000_000u128 . into ( ) ;
312- let tx = TransactionBuilder :: new ( & client) . value ( value) . to ( ethan. address ( ) ) . send ( ) . await ?;
312+ let tx = TransactionBuilder :: new ( client. clone ( ) )
313+ . value ( value)
314+ . to ( ethan. address ( ) )
315+ . send ( )
316+ . await ?;
313317
314318 let receipt = tx. wait_for_receipt ( ) . await ?;
315319 assert_eq ! (
@@ -335,7 +339,11 @@ async fn test_deploy_and_call(client: Arc<WsClient>) -> anyhow::Result<()> {
335339 let ethan = Account :: from ( subxt_signer:: eth:: dev:: ethan ( ) ) ;
336340 let initial_balance = client. get_balance ( ethan. address ( ) , BlockTag :: Latest . into ( ) ) . await ?;
337341 let value = 1_000_000_000_000_000_000_000u128 . into ( ) ;
338- let tx = TransactionBuilder :: new ( & client) . value ( value) . to ( ethan. address ( ) ) . send ( ) . await ?;
342+ let tx = TransactionBuilder :: new ( client. clone ( ) )
343+ . value ( value)
344+ . to ( ethan. address ( ) )
345+ . send ( )
346+ . await ?;
339347
340348 let receipt = tx. wait_for_receipt ( ) . await ?;
341349 assert_eq ! (
@@ -358,7 +366,7 @@ async fn test_deploy_and_call(client: Arc<WsClient>) -> anyhow::Result<()> {
358366 let ( bytes, _) = pallet_revive_fixtures:: compile_module ( "dummy" ) ?;
359367 let input = bytes. into_iter ( ) . chain ( data. clone ( ) ) . collect :: < Vec < u8 > > ( ) ;
360368 let nonce = client. get_transaction_count ( account. address ( ) , BlockTag :: Latest . into ( ) ) . await ?;
361- let tx = TransactionBuilder :: new ( & client) . value ( value) . input ( input) . send ( ) . await ?;
369+ let tx = TransactionBuilder :: new ( client. clone ( ) ) . value ( value) . input ( input) . send ( ) . await ?;
362370 let receipt = tx. wait_for_receipt ( ) . await ?;
363371 let contract_address = create1 ( & account. address ( ) , nonce. try_into ( ) . unwrap ( ) ) ;
364372 assert_eq ! (
@@ -379,7 +387,7 @@ async fn test_deploy_and_call(client: Arc<WsClient>) -> anyhow::Result<()> {
379387 ) ;
380388
381389 // Call contract
382- let tx = TransactionBuilder :: new ( & client)
390+ let tx = TransactionBuilder :: new ( client. clone ( ) )
383391 . value ( value)
384392 . to ( contract_address)
385393 . send ( )
@@ -397,7 +405,7 @@ async fn test_deploy_and_call(client: Arc<WsClient>) -> anyhow::Result<()> {
397405
398406 // Balance transfer to contract
399407 let initial_balance = client. get_balance ( contract_address, BlockTag :: Latest . into ( ) ) . await ?;
400- let tx = TransactionBuilder :: new ( & client)
408+ let tx = TransactionBuilder :: new ( client. clone ( ) )
401409 . value ( value)
402410 . to ( contract_address)
403411 . send ( )
@@ -448,7 +456,7 @@ async fn test_runtime_api_dry_run_addr_works(client: Arc<WsClient>) -> anyhow::R
448456async fn test_invalid_transaction ( client : Arc < WsClient > ) -> anyhow:: Result < ( ) > {
449457 let ethan = Account :: from ( subxt_signer:: eth:: dev:: ethan ( ) ) ;
450458
451- let err = TransactionBuilder :: new ( & client)
459+ let err = TransactionBuilder :: new ( client. clone ( ) )
452460 . value ( U256 :: from ( 1_000_000_000_000u128 ) )
453461 . to ( ethan. address ( ) )
454462 . mutate ( |tx| match tx {
@@ -492,7 +500,7 @@ async fn test_evm_blocks_should_match(client: Arc<WsClient>) -> anyhow::Result<(
492500 // Deploy a contract to have some interesting blocks
493501 let ( bytes, _) = pallet_revive_fixtures:: compile_module ( "dummy" ) ?;
494502 let value = U256 :: from ( 5_000_000_000_000u128 ) ;
495- let tx = TransactionBuilder :: new ( & client)
503+ let tx = TransactionBuilder :: new ( client. clone ( ) )
496504 . value ( value)
497505 . input ( bytes. to_vec ( ) )
498506 . send ( )
@@ -536,7 +544,7 @@ async fn test_evm_blocks_hydrated_should_match(client: Arc<WsClient>) -> anyhow:
536544 let value = U256 :: from ( 5_000_000_000_000u128 ) ;
537545 let signer = Account :: default ( ) ;
538546 let signer_copy = Account :: default ( ) ;
539- let tx = TransactionBuilder :: new ( & client)
547+ let tx = TransactionBuilder :: new ( client. clone ( ) )
540548 . value ( value)
541549 . signer ( signer)
542550 . input ( bytes. to_vec ( ) )
@@ -589,7 +597,7 @@ async fn test_block_hash_for_tag_with_proper_ethereum_block_hash_works(
589597 // Deploy a transaction to create a block with transactions
590598 let ( bytes, _) = pallet_revive_fixtures:: compile_module ( "dummy" ) ?;
591599 let value = U256 :: from ( 5_000_000_000_000u128 ) ;
592- let tx = TransactionBuilder :: new ( & client)
600+ let tx = TransactionBuilder :: new ( client. clone ( ) )
593601 . value ( value)
594602 . input ( bytes. to_vec ( ) )
595603 . send ( )
@@ -764,7 +772,7 @@ async fn test_runtime_pallets_address_upload_code(client: Arc<WsClient>) -> anyh
764772 let encoded_call = node_client. tx ( ) . call_data ( & upload_call) ?;
765773
766774 // Step 2: Send the encoded call to RUNTIME_PALLETS_ADDR
767- let tx = TransactionBuilder :: new ( & client)
775+ let tx = TransactionBuilder :: new ( client. clone ( ) )
768776 . signer ( signer. clone ( ) )
769777 . to ( pallet_revive:: RUNTIME_PALLETS_ADDR )
770778 . input ( encoded_call. clone ( ) )
@@ -803,12 +811,12 @@ async fn test_fibonacci_large_value_runs_out_of_gas(client: Arc<WsClient>) -> an
803811
804812 let account = Account :: default ( ) ;
805813 let nonce = client. get_transaction_count ( account. address ( ) , BlockTag :: Latest . into ( ) ) . await ?;
806- let tx = TransactionBuilder :: new ( & client) . input ( bytes. to_vec ( ) ) . send ( ) . await ?;
814+ let tx = TransactionBuilder :: new ( client. clone ( ) ) . input ( bytes. to_vec ( ) ) . send ( ) . await ?;
807815 let receipt = tx. wait_for_receipt ( ) . await ?;
808816 let contract_address = create1 ( & account. address ( ) , nonce. try_into ( ) . unwrap ( ) ) ;
809817 assert_eq ! ( Some ( contract_address) , receipt. contract_address) ;
810818
811- let result = TransactionBuilder :: new ( & client)
819+ let result = TransactionBuilder :: new ( client. clone ( ) )
812820 . to ( contract_address)
813821 . input ( Fibonacci :: fibCall { n : 100u64 } . abi_encode ( ) )
814822 . eth_call ( )
0 commit comments