0

I have something like the following in my account struct for one of my instructions

#[derive(Accounts)]
pub struct DripOrcaWhirlpool<'info> {
    #[account(mut)]
    /// CHECK: Temporary
    pub whirlpool: Box<Account<'info, Whirlpool>>,

}

I copied the Whirlpool from the orca whirlpool repo, and I am passing in whirlpool accounts owned by the orca whirlpool program into my instruction. However, I get the following error with this setup.

  logs: [
    'Program dripTrkvSyQKvkyWg7oi4jmeEGMA5scSYowHArJ9Vwk invoke [1]',
    'Program log: Instruction: DripOrcaWhirlpool',
    'Program log: AnchorError caused by account: whirlpool. Error Code: AccountOwnedByWrongProgram. Error Number: 3007. Error Message: The given account is owned by a different program than expected.',
    'Program log: Left:',
    'Program log: whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc',
    'Program log: Right:',
    'Program log: dripTrkvSyQKvkyWg7oi4jmeEGMA5scSYowHArJ9Vwk',
  ]
1
  • Does it deserialise fine without #[account(mut)]?
    – sohrab
    Commented Aug 4, 2022 at 23:03

1 Answer 1

1

My fix was to create a dummy program in my project with the correct declare_id! set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.