diff --git a/artifacts/program_methods/privacy_preserving_circuit.bin b/artifacts/program_methods/privacy_preserving_circuit.bin index 94b09997..3d0855b1 100644 Binary files a/artifacts/program_methods/privacy_preserving_circuit.bin and b/artifacts/program_methods/privacy_preserving_circuit.bin differ diff --git a/integration_tests/tests/account.rs b/integration_tests/tests/account.rs index 1b655704..47fda69f 100644 --- a/integration_tests/tests/account.rs +++ b/integration_tests/tests/account.rs @@ -4,7 +4,7 @@ )] use anyhow::Result; -use integration_tests::TestContext; +use integration_tests::{TestContext, format_private_account_id}; use log::info; use nssa::program::Program; use sequencer_service_rpc::RpcClient as _; @@ -70,33 +70,29 @@ async fn new_public_account_with_label() -> Result<()> { } #[test] -async fn new_private_account_with_label() -> Result<()> { +async fn add_label_to_existing_account() -> Result<()> { let mut ctx = TestContext::new().await?; + let account_id = ctx.existing_private_accounts()[0]; let label = "my-test-private-account".to_owned(); - let command = Command::Account(AccountSubcommand::New(NewSubcommand::PrivateAccountsKey { - cci: None, - })); + let command = Command::Account(AccountSubcommand::Label { + account_id: Some(format_private_account_id(account_id)), + account_label: None, + label: label.clone(), + }); - let result = execute_subcommand(ctx.wallet_mut(), command).await?; + execute_subcommand(ctx.wallet_mut(), command).await?; - // Extract the account_id from the result - - let wallet::cli::SubcommandReturnValue::RegisterAccount { account_id } = result else { - panic!("Expected RegisterAccount return value") - }; - - // Verify the label was stored let stored_label = ctx .wallet() .storage() .labels .get(&account_id.to_string()) - .expect("Label should be stored for the new account"); + .expect("Label should be stored for the account"); assert_eq!(stored_label.to_string(), label); - info!("Successfully created private account with label"); + info!("Successfully set label on existing private account"); Ok(()) } diff --git a/key_protocol/src/key_management/mod.rs b/key_protocol/src/key_management/mod.rs index 995dded5..726533eb 100644 --- a/key_protocol/src/key_management/mod.rs +++ b/key_protocol/src/key_management/mod.rs @@ -174,7 +174,7 @@ mod tests { // /2 let second_chain_index = key_tree_private.generate_new_node_layered().unwrap(); - key_tree_private.key_map[&second_chain_index].value.0.clone() + key_tree_private.key_map.get(&second_chain_index).expect("Node was just inserted").value.0.clone() } #[test]