From 313425f6f8dfede3c786c24ceaf7028d96f8cef5 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 3 Oct 2025 17:06:45 -0300 Subject: [PATCH] rename --- integration_tests/src/lib.rs | 32 ++++++++++++++++---------------- wallet/src/lib.rs | 22 +++++++++++----------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/integration_tests/src/lib.rs b/integration_tests/src/lib.rs index 58d2edc..f27669c 100644 --- a/integration_tests/src/lib.rs +++ b/integration_tests/src/lib.rs @@ -467,17 +467,17 @@ pub async fn test_success_private_transfer_to_another_owned_account() { info!("Waiting for next block creation"); tokio::time::sleep(Duration::from_secs(TIME_TO_WAIT_FOR_BLOCK_SECONDS)).await; - let command = Command::ClaimPrivateAccount { + let command = Command::FetchPrivateAccount { tx_hash: tx_hash.clone(), acc_addr: from.to_string(), - ciph_id: 0, + output_id: 0, }; wallet::execute_subcommand(command).await.unwrap(); - let command = Command::ClaimPrivateAccount { + let command = Command::FetchPrivateAccount { tx_hash, acc_addr: to.to_string(), - ciph_id: 1, + output_id: 1, }; wallet::execute_subcommand(command).await.unwrap(); @@ -519,10 +519,10 @@ pub async fn test_success_private_transfer_to_another_foreign_account() { info!("Waiting for next block creation"); tokio::time::sleep(Duration::from_secs(TIME_TO_WAIT_FOR_BLOCK_SECONDS)).await; - let command = Command::ClaimPrivateAccount { + let command = Command::FetchPrivateAccount { tx_hash: tx_hash.clone(), acc_addr: from.to_string(), - ciph_id: 0, + output_id: 0, }; wallet::execute_subcommand(command).await.unwrap(); @@ -582,10 +582,10 @@ pub async fn test_success_private_transfer_to_another_owned_account_claiming_pat let tx = fetch_privacy_preserving_tx(&seq_client, tx_hash.clone()).await; - let command = Command::ClaimPrivateAccount { + let command = Command::FetchPrivateAccount { tx_hash, acc_addr: to_addr.to_string(), - ciph_id: 1, + output_id: 1, }; wallet::execute_subcommand(command).await.unwrap(); let wallet_storage = WalletCore::start_from_config_update_chain(wallet_config).unwrap(); @@ -633,10 +633,10 @@ pub async fn test_success_deshielded_transfer_to_another_account() { info!("Waiting for next block creation"); tokio::time::sleep(Duration::from_secs(TIME_TO_WAIT_FOR_BLOCK_SECONDS)).await; - let command = Command::ClaimPrivateAccount { + let command = Command::FetchPrivateAccount { tx_hash, acc_addr: from.to_string(), - ciph_id: 0, + output_id: 0, }; wallet::execute_subcommand(command).await.unwrap(); let wallet_storage = WalletCore::start_from_config_update_chain(wallet_config).unwrap(); @@ -680,10 +680,10 @@ pub async fn test_success_shielded_transfer_to_another_owned_account() { info!("Waiting for next block creation"); tokio::time::sleep(Duration::from_secs(TIME_TO_WAIT_FOR_BLOCK_SECONDS)).await; - let command = Command::ClaimPrivateAccount { + let command = Command::FetchPrivateAccount { tx_hash, acc_addr: to.to_string(), - ciph_id: 0, + output_id: 0, }; wallet::execute_subcommand(command).await.unwrap(); let wallet_storage = WalletCore::start_from_config_update_chain(wallet_config).unwrap(); @@ -961,8 +961,8 @@ async fn verify_commitment_is_in_state( commitment: Commitment, seq_client: &SequencerClient, ) -> bool { - match seq_client.get_proof_for_commitment(commitment).await { - Ok(Some(_)) => true, - _ => false, - } + matches!( + seq_client.get_proof_for_commitment(commitment).await, + Ok(Some(_)) + ) } diff --git a/wallet/src/lib.rs b/wallet/src/lib.rs index e89a28a..d3bcc8e 100644 --- a/wallet/src/lib.rs +++ b/wallet/src/lib.rs @@ -304,16 +304,16 @@ pub enum Command { amount: u128, }, ///Claim account `acc_addr` generated in transaction `tx_hash`, using secret `sh_secret` at ciphertext id `ciph_id` - ClaimPrivateAccount { + FetchPrivateAccount { ///tx_hash - valid 32 byte hex string #[arg(long)] tx_hash: String, ///acc_addr - valid 32 byte hex string #[arg(long)] acc_addr: String, - ///ciph_id - id of cipher in transaction + ///output_id - id of the output in the transaction #[arg(long)] - ciph_id: usize, + output_id: usize, }, ///Get private account with `addr` from storage GetPrivateAccount { @@ -330,17 +330,17 @@ pub enum Command { tx_hash: String, }, ///Get account `addr` balance - GetAccountBalance { + GetPublicAccountBalance { #[arg(short, long)] addr: String, }, ///Get account `addr` nonce - GetAccountNonce { + GetPublicAccountNonce { #[arg(short, long)] addr: String, }, ///Get account at address `addr` - GetAccount { + GetPublicAccount { #[arg(short, long)] addr: String, }, @@ -671,10 +671,10 @@ pub async fn execute_subcommand(command: Command) -> Result { let acc_addr: Address = acc_addr.parse().unwrap(); @@ -761,7 +761,7 @@ pub async fn execute_subcommand(command: Command) -> Result { + Command::GetPublicAccountBalance { addr } => { let addr = Address::from_str(&addr)?; let balance = wallet_core.get_account_balance(addr).await?; @@ -769,7 +769,7 @@ pub async fn execute_subcommand(command: Command) -> Result { + Command::GetPublicAccountNonce { addr } => { let addr = Address::from_str(&addr)?; let nonce = wallet_core.get_accounts_nonces(vec![addr]).await?[0]; @@ -777,7 +777,7 @@ pub async fn execute_subcommand(command: Command) -> Result { + Command::GetPublicAccount { addr } => { let addr: Address = addr.parse()?; let account = wallet_core.get_account_public(addr).await?; let account_hr: HumanReadableAccount = account.clone().into();