In an anchor based project, I've seen something like this in an instruction:
**user_pda_account.to_account_info().try_borrow_mut_lamports()? -= amount;
**transfer_to.try_borrow_mut_lamports()? += amount;
My question is that does this really change the balance of the user_pda_account
account?
Note that the user_pda_account
is actually indicating this field:
#[account(init, payer = signer, space = 100, seeds = [b"elevens", player.key().as_ref()], bump)]
pub user_pda: Account<'info, UserPda>,
And this is UserPda
:
#[account]
pub struct UserPda{
user_wallet: Pubkey,
}