does anyone know how to fix this please? I tried using a let expression but it ended up in a halting problem... The error ocucrs because of the "seeds" variable
pub fn exec_payout(ctx: Context<MyInstruction>, amount: u64, bump:u8, p1:Pubkey, p2:Pubkey, rstring:String) -> Result<()> {
let cpi_program = ctx.accounts.system_program.to_account_info();
let cpi_accounts = system_program::Transfer {
from: ctx.accounts.account_a.clone(),
to: ctx.accounts.account_b.clone(),
};
let seeds = [rstring.as_bytes().as_ref(), p1.as_ref(), p2.as_ref(), &[bump]].as_slice();
let seedz = &[seeds.clone()];
let cpi_context = CpiContext::new(cpi_program, cpi_accounts)
.with_signer(seedz);
system_program::transfer(cpi_context, amount)?;
Ok(())
}
I tried writing it like this but it ended up into the same error... can someone help me please
let cpi_context = CpiContext::new(cpi_program, cpi_accounts)
.with_signer(&[&[rstring.as_bytes().as_ref(), p1.as_ref(), p2.as_ref(), &[bump]]]);