I have a PD vault account, I transfer some amount of SOL to WSOL token account for this vault and then I try to call the SyncNative instruction that results into err:
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]',
'Program log: Instruction: SyncNative',
'Program log: Error: IncorrectProgramId',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 884 of 153908 compute units',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA failed: incorrect program id for instruction',
'Program 7Ppq5s4BFH4uyx3p8y4e33Sp7GL9NCBJeBcrw8ojnY6z consumed 46976 of 200000 compute units',
'Program 7Ppq5s4BFH4uyx3p8y4e33Sp7GL9NCBJeBcrw8ojnY6z failed: incorrect program id for instruction'
here is a piece of code:
// Sync the native token to reflect the new SOL balance as wSOL
let cpi_accounts = token::SyncNative {
account: wsol_account.to_account_info(),
};
let cpi_program = token_program_account.to_account_info();
let cpi_ctx = CpiContext::new_with_signer(cpi_program, cpi_accounts, vault_signer);
token::sync_native(cpi_ctx)?;
and here are the accounts I pass the call:
{ pubkey: vault, isSigner: false, isWritable: true },
{ pubkey: signer, isSigner: true, isWritable: true },
{ pubkey: SYSTEM_PROGRAM_ID, isSigner: false, isWritable: false },
{ pubkey: TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
{ pubkey: vaultAssociatedTokenAccount, isSigner: false, isWritable: true }