@@ -82,22 +82,21 @@ use std::path::PathBuf;
8282#[ allow( clippy:: too_many_arguments) ] // TODO: Refactor this function, use NoncedVerificationData
8383pub async fn submit_multiple_and_wait_verification (
8484 eth_rpc_url : & str ,
85- network : Network ,
85+ network : & Network ,
8686 verification_data : & [ VerificationData ] ,
8787 max_fee : U256 ,
8888 wallet : Wallet < SigningKey > ,
8989 nonce : U256 ,
9090) -> Vec < Result < AlignedVerificationData , errors:: SubmitError > > {
9191 let mut aligned_verification_data =
92- submit_multiple ( network. clone ( ) , verification_data, max_fee, wallet, nonce) . await ;
92+ submit_multiple ( network, verification_data, max_fee, wallet, nonce) . await ;
9393
9494 // TODO: open issue: use a join to .await all at the same time, avoiding the loop
9595 // And await only once per batch, no need to await multiple proofs if they are in the same batch.
9696 let mut error_awaiting_batch_verification: Option < errors:: SubmitError > = None ;
9797 for aligned_verification_data_item in aligned_verification_data. iter ( ) . flatten ( ) {
9898 if let Err ( e) =
99- await_batch_verification ( aligned_verification_data_item, eth_rpc_url, network. clone ( ) )
100- . await
99+ await_batch_verification ( aligned_verification_data_item, eth_rpc_url, network) . await
101100 {
102101 error_awaiting_batch_verification = Some ( e) ;
103102 break ;
@@ -230,7 +229,7 @@ async fn fetch_gas_price(
230229/// * `ProofQueueFlushed` if there is an error in the batcher and the proof queue is flushed.
231230/// * `GenericError` if the error doesn't match any of the previous ones.
232231pub async fn submit_multiple (
233- network : Network ,
232+ network : & Network ,
234233 verification_data : & [ VerificationData ] ,
235234 max_fee : U256 ,
236235 wallet : Wallet < SigningKey > ,
@@ -263,7 +262,7 @@ pub async fn submit_multiple(
263262async fn _submit_multiple (
264263 ws_write : Arc < Mutex < SplitSink < WebSocketStream < MaybeTlsStream < TcpStream > > , Message > > > ,
265264 mut ws_read : SplitStream < WebSocketStream < MaybeTlsStream < TcpStream > > > ,
266- network : Network ,
265+ network : & Network ,
267266 verification_data : & [ VerificationData ] ,
268267 max_fee : U256 ,
269268 wallet : Wallet < SigningKey > ,
@@ -351,7 +350,7 @@ async fn _submit_multiple(
351350#[ allow( clippy:: too_many_arguments) ] // TODO: Refactor this function, use NoncedVerificationData
352351pub async fn submit_and_wait_verification (
353352 eth_rpc_url : & str ,
354- network : Network ,
353+ network : & Network ,
355354 verification_data : & VerificationData ,
356355 max_fee : U256 ,
357356 wallet : Wallet < SigningKey > ,
@@ -406,7 +405,7 @@ pub async fn submit_and_wait_verification(
406405/// * `ProofQueueFlushed` if there is an error in the batcher and the proof queue is flushed.
407406/// * `GenericError` if the error doesn't match any of the previous ones.
408407pub async fn submit (
409- network : Network ,
408+ network : & Network ,
410409 verification_data : & VerificationData ,
411410 max_fee : U256 ,
412411 wallet : Wallet < SigningKey > ,
@@ -442,7 +441,7 @@ pub async fn submit(
442441/// * `HexDecodingError` if there is an error decoding the Aligned service manager contract address.
443442pub async fn is_proof_verified (
444443 aligned_verification_data : & AlignedVerificationData ,
445- network : Network ,
444+ network : & Network ,
446445 eth_rpc_url : & str ,
447446) -> Result < bool , errors:: VerificationError > {
448447 let eth_rpc_provider =
@@ -455,10 +454,10 @@ pub async fn is_proof_verified(
455454
456455async fn _is_proof_verified (
457456 aligned_verification_data : & AlignedVerificationData ,
458- network : Network ,
457+ network : & Network ,
459458 eth_rpc_provider : Provider < Http > ,
460459) -> Result < bool , errors:: VerificationError > {
461- let contract_address = network. clone ( ) . get_aligned_service_manager_address ( ) ;
460+ let contract_address = network. get_aligned_service_manager_address ( ) ;
462461 let payment_service_addr = network. get_batcher_payment_service_address ( ) ;
463462
464463 // All the elements from the merkle proof have to be concatenated
@@ -532,7 +531,7 @@ pub fn get_vk_commitment(
532531/// # Errors
533532/// * `EthRpcError` if the batcher has an error in the Ethereum call when retrieving the nonce if not already cached.
534533pub async fn get_nonce_from_batcher (
535- network : Network ,
534+ network : & Network ,
536535 address : Address ,
537536) -> Result < U256 , GetNonceError > {
538537 let ( ws_stream, _) = connect_async ( network. get_batcher_url ( ) )
@@ -608,7 +607,7 @@ pub async fn get_nonce_from_batcher(
608607pub async fn get_nonce_from_ethereum (
609608 eth_rpc_url : & str ,
610609 submitter_addr : Address ,
611- network : Network ,
610+ network : & Network ,
612611) -> Result < U256 , GetNonceError > {
613612 let eth_rpc_provider = Provider :: < Http > :: try_from ( eth_rpc_url)
614613 . map_err ( |e| GetNonceError :: EthRpcError ( e. to_string ( ) ) ) ?;
0 commit comments