If I want to use instruction data in my account constraints, I can do it like so:
#[derive(Accounts)]#[instruction(my_param: u32)]pub struct MyAccounts<'info> { #[account( seeds = [my_param.to_le_bytes().as_ref()], bump )] pub my_account: Account<'info, MyAccount>,}
Let's say I want to use multiple params. Intuitively, I tried the below:
#[derive(Accounts)]#[instruction(my_param: u32)]#[instruction(my_second_param: u32)]pub struct MyAccounts<'info> { #[account( seeds = [my_param.to_le_bytes().as_ref(), my_second_param.to_le_bytes().as_ref()], bump )] pub my_account: Account<'info, MyAccount>,}
This gives me the error cannot find value "my_second_param" in this scope
. Is there a way to achieve this out of the box (which isn't merging my two params into a struct)? Or does anchor only allow one instruction constraint?