Quantcast
Viewing all articles
Browse latest Browse all 2

Answer by Ahri for Multiple instruction constraints anchor

Turns out I'm just an idiot :)

The way to do this is simply writing all the instruction vars inside the constraint:

#[derive(Accounts)]#[instruction(my_param: u32, 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>,}

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>