(
program_id: &Pubkey,
merkle_tree_pda_pubkey: &Pubkey,
tmp_storage_pda_pubkey: &Pubkey,
user_pda_token_pubkey: &Pubkey,
merkle_tree_pda_token_pubkey: &Pubkey,
expected_authori
| 723 | } |
| 724 | |
| 725 | pub async fn last_tx( |
| 726 | program_id: &Pubkey, |
| 727 | merkle_tree_pda_pubkey: &Pubkey, |
| 728 | tmp_storage_pda_pubkey: &Pubkey, |
| 729 | user_pda_token_pubkey: &Pubkey, |
| 730 | merkle_tree_pda_token_pubkey: &Pubkey, |
| 731 | expected_authority_pubkey: &Pubkey, |
| 732 | signer_keypair: &solana_sdk::signer::keypair::Keypair, |
| 733 | nullifier_pubkeys: &Vec<Pubkey>, |
| 734 | two_leaves_pda_pubkey: &Pubkey, |
| 735 | program_context: &mut ProgramTestContext, |
| 736 | accounts_vector: &mut Vec<(&Pubkey, usize, Option<Vec<u8>>)>, |
| 737 | token_accounts: &mut Vec<(&Pubkey, &Pubkey, u64)>, |
| 738 | relayer_pda_token_pubkey_option: Option<&Pubkey>, |
| 739 | recipient_pubkey_option: Option<&Pubkey>, |
| 740 | amount: Option<u64>, |
| 741 | mut _wsol_acc: Option<Pubkey>, |
| 742 | ) -> ProgramTestContext { |
| 743 | let signer_pubkey = signer_keypair.pubkey(); |
| 744 | let mut accounts_vector_local = accounts_vector.clone(); |
| 745 | accounts_vector_local.push(( |
| 746 | tmp_storage_pda_pubkey, |
| 747 | 3900 + config::ENCRYPTED_UTXOS_LENGTH, |
| 748 | None, |
| 749 | )); |
| 750 | let mut program_context = restart_program( |
| 751 | &mut accounts_vector_local, |
| 752 | Some(token_accounts), |
| 753 | &program_id, |
| 754 | &signer_pubkey, |
| 755 | program_context, |
| 756 | ) |
| 757 | .await; |
| 758 | // let mut program_context = program_context; |
| 759 | |
| 760 | println!("user_pda_token_pubkey: {:?}", user_pda_token_pubkey); |
| 761 | println!("recipient_pubkey_option: {:?}", recipient_pubkey_option); |
| 762 | |
| 763 | println!("recipient_pubkey_option: {:?}", recipient_pubkey_option); |
| 764 | let mut ix_vec = Vec::new(); |
| 765 | //deposit case mint wrapped sol tokens and approve a program owned authority |
| 766 | if recipient_pubkey_option.is_none() && relayer_pda_token_pubkey_option.is_none() { |
| 767 | let user_ecrow_acc = Pubkey::find_program_address( |
| 768 | &[&tmp_storage_pda_pubkey.to_bytes(), &b"escrow"[..]], |
| 769 | &program_id, |
| 770 | ) |
| 771 | .0; |
| 772 | |
| 773 | if amount.is_some() { |
| 774 | let signer_account = program_context |
| 775 | .banks_client |
| 776 | .get_account(signer_pubkey) |
| 777 | .await |
| 778 | .expect("get_account") |
| 779 | .unwrap(); |
| 780 | |
| 781 | println!("last_tx_first: {:?}", user_ecrow_acc); |
| 782 |
no test coverage detected