@@ -541,33 +541,33 @@ async fn main() -> Result<(), AlignedError> {
541541 let chain_id = get_chain_id ( eth_rpc_url. as_str ( ) ) . await ?;
542542 wallet = wallet. with_chain_id ( chain_id) ;
543543
544+ let used_network: Network = submit_args. network . clone ( ) . into ( ) ;
545+
544546 let nonce = match & submit_args. nonce {
545547 Some ( nonce) => U256 :: from_dec_str ( nonce) . map_err ( |_| SubmitError :: InvalidNonce ) ?,
546- None => {
547- get_nonce_from_batcher ( submit_args. network . clone ( ) . into ( ) , wallet. address ( ) )
548- . await
549- . map_err ( |e| match e {
550- aligned_sdk:: common:: errors:: GetNonceError :: EthRpcError ( e) => {
551- SubmitError :: GetNonceError ( e)
552- }
553- aligned_sdk:: common:: errors:: GetNonceError :: ConnectionFailed ( e) => {
554- SubmitError :: GenericError ( e)
555- }
556- aligned_sdk:: common:: errors:: GetNonceError :: InvalidRequest ( e) => {
557- SubmitError :: GenericError ( e)
558- }
559- aligned_sdk:: common:: errors:: GetNonceError :: SerializationError ( e) => {
560- SubmitError :: GenericError ( e)
561- }
562- aligned_sdk:: common:: errors:: GetNonceError :: ProtocolMismatch {
563- current,
564- expected,
565- } => SubmitError :: ProtocolVersionMismatch { current, expected } ,
566- aligned_sdk:: common:: errors:: GetNonceError :: UnexpectedResponse ( e) => {
567- SubmitError :: UnexpectedBatcherResponse ( e)
568- }
569- } ) ?
570- }
548+ None => get_nonce_from_batcher ( used_network. clone ( ) , wallet. address ( ) )
549+ . await
550+ . map_err ( |e| match e {
551+ aligned_sdk:: common:: errors:: GetNonceError :: EthRpcError ( e) => {
552+ SubmitError :: GetNonceError ( e)
553+ }
554+ aligned_sdk:: common:: errors:: GetNonceError :: ConnectionFailed ( e) => {
555+ SubmitError :: GenericError ( e)
556+ }
557+ aligned_sdk:: common:: errors:: GetNonceError :: InvalidRequest ( e) => {
558+ SubmitError :: GenericError ( e)
559+ }
560+ aligned_sdk:: common:: errors:: GetNonceError :: SerializationError ( e) => {
561+ SubmitError :: GenericError ( e)
562+ }
563+ aligned_sdk:: common:: errors:: GetNonceError :: ProtocolMismatch {
564+ current,
565+ expected,
566+ } => SubmitError :: ProtocolVersionMismatch { current, expected } ,
567+ aligned_sdk:: common:: errors:: GetNonceError :: UnexpectedResponse ( e) => {
568+ SubmitError :: UnexpectedBatcherResponse ( e)
569+ }
570+ } ) ?,
571571 } ;
572572
573573 warn ! ( "Nonce: {nonce}" ) ;
@@ -587,10 +587,10 @@ async fn main() -> Result<(), AlignedError> {
587587 info ! ( "Submitting proofs to the Aligned batcher..." ) ;
588588
589589 let aligned_verification_data_vec = submit_multiple (
590- submit_args . network . clone ( ) . into ( ) ,
590+ used_network . clone ( ) ,
591591 & verification_data_arr,
592592 max_fee_wei,
593- wallet. clone ( ) ,
593+ wallet,
594594 nonce,
595595 )
596596 . await ;
@@ -625,7 +625,7 @@ async fn main() -> Result<(), AlignedError> {
625625 }
626626
627627 for batch_merkle_root in unique_batch_merkle_roots {
628- let base_url = match submit_args . network . clone ( ) . into ( ) {
628+ let base_url = match used_network {
629629 Network :: Holesky => "https://holesky.explorer.alignedlayer.com/batches/0x" ,
630630 Network :: HoleskyStage => "https://stage.explorer.alignedlayer.com/batches/0x" ,
631631 Network :: Mainnet => "https://explorer.alignedlayer.com/batches/0x" ,
@@ -725,7 +725,7 @@ async fn main() -> Result<(), AlignedError> {
725725 let chain_id = get_chain_id ( eth_rpc_url. as_str ( ) ) . await ?;
726726 wallet = wallet. with_chain_id ( chain_id) ;
727727
728- let client = SignerMiddleware :: new ( eth_rpc_provider. clone ( ) , wallet. clone ( ) ) ;
728+ let client = SignerMiddleware :: new ( eth_rpc_provider, wallet) ;
729729
730730 match deposit_to_aligned ( amount_wei, client, deposit_to_batcher_args. network . into ( ) )
731731 . await
@@ -777,8 +777,7 @@ async fn main() -> Result<(), AlignedError> {
777777 }
778778 GetUserNonceFromEthereum ( args) => {
779779 let address = H160 :: from_str ( & args. address ) . unwrap ( ) ;
780- let network = args. network . into ( ) ;
781- match get_nonce_from_ethereum ( & args. eth_rpc_url , address, network) . await {
780+ match get_nonce_from_ethereum ( & args. eth_rpc_url , address, args. network . into ( ) ) . await {
782781 Ok ( nonce) => {
783782 info ! (
784783 "Nonce for address {} in BatcherPaymentService contract is {}" ,
0 commit comments