mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-07-25 23:23:11 +00:00
feat: allow private authorized uninitialized accounts
This commit is contained in:
@@ -1681,6 +1681,49 @@ pub fn prepare_function_map() -> HashMap<String, TestFunction> {
|
||||
info!("Success!");
|
||||
}
|
||||
|
||||
#[nssa_integration_test]
|
||||
pub async fn test_authenticated_transfer_initialize_function_private() {
|
||||
info!("########## test initialize private account for authenticated transfer ##########");
|
||||
let command =
|
||||
Command::Account(AccountSubcommand::New(NewSubcommand::Private { cci: None }));
|
||||
let SubcommandReturnValue::RegisterAccount { account_id } =
|
||||
wallet::cli::execute_subcommand(command).await.unwrap()
|
||||
else {
|
||||
panic!("Error creating account");
|
||||
};
|
||||
|
||||
let command = Command::AuthTransfer(AuthTransferSubcommand::Init {
|
||||
account_id: make_private_account_input_from_str(&account_id.to_string()),
|
||||
});
|
||||
wallet::cli::execute_subcommand(command).await.unwrap();
|
||||
|
||||
tokio::time::sleep(Duration::from_secs(TIME_TO_WAIT_FOR_BLOCK_SECONDS)).await;
|
||||
|
||||
info!("Checking correct execution");
|
||||
let command = Command::Account(AccountSubcommand::SyncPrivate {});
|
||||
wallet::cli::execute_subcommand(command).await.unwrap();
|
||||
|
||||
let wallet_config = fetch_config().await.unwrap();
|
||||
let seq_client = SequencerClient::new(wallet_config.sequencer_addr.clone()).unwrap();
|
||||
let wallet_storage = WalletCore::start_from_config_update_chain(wallet_config)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let new_commitment1 = wallet_storage
|
||||
.get_private_account_commitment(&account_id)
|
||||
.unwrap();
|
||||
assert!(verify_commitment_is_in_state(new_commitment1, &seq_client).await);
|
||||
|
||||
let account = wallet_storage.get_account_private(&account_id).unwrap();
|
||||
|
||||
let expected_program_owner = Program::authenticated_transfer_program().id();
|
||||
let expected_balance = 0;
|
||||
|
||||
assert_eq!(account.program_owner, expected_program_owner);
|
||||
assert_eq!(account.balance, expected_balance);
|
||||
assert!(account.data.is_empty());
|
||||
}
|
||||
|
||||
#[nssa_integration_test]
|
||||
pub async fn test_pinata_private_receiver() {
|
||||
info!("########## test_pinata_private_receiver ##########");
|
||||
|
||||
@@ -168,7 +168,7 @@ fn build_privacy_transaction() -> PrivacyPreservingTransaction {
|
||||
(recipient_npk.clone(), recipient_ss),
|
||||
],
|
||||
&[sender_nsk],
|
||||
&[proof],
|
||||
&[Some(proof)],
|
||||
&program.into(),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user