diff --git a/src/processor.rs b/src/processor.rs index 1ba6e63..bb92368 100644 --- a/src/processor.rs +++ b/src/processor.rs @@ -85,7 +85,7 @@ impl Processor { )?; msg!("Calling the token program to transfer token account ownership..."); - msg!("Token program: {}. Transferring ownership {}->{}", token_program.key, initializer.key, pda); + msg!("Token program: {}. Transferring ownership {} -> {}", token_program.key, initializer.key, pda); invoke( &owner_change_ix, &[ diff --git a/tests/functional_test.rs b/tests/functional_test.rs index 1b2d08e..e93fdad 100644 --- a/tests/functional_test.rs +++ b/tests/functional_test.rs @@ -248,72 +248,7 @@ async fn test_token() { assert_eq!(alice_account_temp_account.owner, spl_token::id()); let internal_account = spl_token::state::Account::unpack(&alice_account_temp_account.data).unwrap(); let (pda, _bump_seed) = Pubkey::find_program_address(&[b"escrow"], &hearttoken::id()); - // Ensure that + + // Ensure that the escrow account's ownership assert_eq!(internal_account.owner, pda); } - -// #[tokio::test] -// https://github.com/solana-labs/solana-program-library/blob/2b3f71ead5b81f4ea4a2fd3e4fe9583a6e39b6a4/record/program/tests/functional.rs -// async fn test_escrow() { -// let spl_token::id() = Pubkey::new_unique(); -// let mut program_test = -// ProgramTest::new("token_test", hearttoken::id(), processor!(process_instruction)); - -// let hearttoken::id() = Pubkey::new_unique(); - -// // Create a SPL token -// // Create a main token account for Alice -// // Create temporary token account for Alice -// // Create a receiving account for Alice -// // Create Escrow program - -// let alice_pubkey = Pubkey::new_unique(); -// let destination_pubkey = Pubkey::new_unique(); -// // TODO: Create SPL token program & transactions? -// // let mut program_test = -// ProgramTest::new("escrow_test", hearttoken::id(), processor!(process_instruction)); -// // add_usdc_mint(&mut program_test); - -// // Start the test client -// let (mut banks_client, payer, recent_blockhash) = program_test.start().await; - -// let mut transaction = Transaction::new_with_payer( -// &[Instruction { -// hearttoken::id(), -// accounts: vec![AccountMeta::new(payer.pubkey(), false)], -// data: vec![1, 2, 3], -// }], -// Some(&payer.pubkey()), -// ); -// transaction.sign(&[&payer], recent_blockhash); -// // assert_eq!(true, false); -// assert_matches!(banks_client.process_transaction(transaction).await, Ok(())); -// } - -// pub struct TestQuoteMint { -// pub pubkey: Pubkey, -// pub authority: Keypair, -// pub decimals: u8, -// } - -// pub fn add_usdc_mint(test: &mut ProgramTest) -> TestQuoteMint { -// let authority = Keypair::new(); -// let pubkey = Pubkey::from_str(USDC_MINT).unwrap(); -// let decimals = 6; -// test.add_packable_account( -// pubkey, -// u32::MAX as u64, -// &Mint { -// is_initialized: true, -// mint_authority: COption::Some(authority.pubkey()), -// decimals, -// ..Mint::default() -// }, -// &spl_token::id(), -// ); -// TestQuoteMint { -// pubkey, -// authority, -// decimals, -// } -// }