I am getting this error when I try to pass an account info into a function and then want to use it in a spl transfer:
pub fn move_in_direction(
&mut self,
direction: u8,
player: AccountInfo,
chest_vault: AccountInfo,
vault_token_account: AccountInfo,
player_token_account: AccountInfo,
token_account_owner_pda: AccountInfo,
token_program: AccountInfo,
tokenOwnerBump: u8,
) -> Result<()> {
let mut player_position: Option<(usize, usize)> = None;
let bump = tokenOwnerBump;
let transfer_instruction = Transfer {
from: vault_token_account,
to: player_token_account,
authority: token_account_owner_pda,
};
I do not quite understand why I am getting this error. Can someone explain my what it means that a generic argument becomes invariant? I was using AccountInfo in functions before but only if I afterwards use it in a transfer which has <'info> as generic type i get this error. So my guess is that <'info> is more specific than AccountInfo without the type but what does 'info actually do?