lang: Fix remaining_accounts for interface attribute CPIs
@@ -197,7 +197,7 @@ pub fn interface(
let sighash_tts: proc_macro2::TokenStream =
format!("{:?}", sighash_arr).parse().unwrap();
quote! {
- pub fn #method_name<'a,'b, 'c, 'info, T: anchor_lang::ToAccountMetas + anchor_lang::ToAccountInfos<'info>>(
+ pub fn #method_name<'a,'b, 'c, 'info, T: anchor_lang::Accounts<'info> + anchor_lang::ToAccountMetas + anchor_lang::ToAccountInfos<'info>>(
ctx: anchor_lang::CpiContext<'a, 'b, 'c, 'info, T>,
#(#args),*
) -> anchor_lang::solana_program::entrypoint::ProgramResult {
@@ -211,14 +211,14 @@ pub fn interface(
.map_err(|_| anchor_lang::__private::ErrorCode::InstructionDidNotSerialize)?;
let mut data = #sighash_tts.to_vec();
data.append(&mut ix_data);
- let accounts = ctx.accounts.to_account_metas(None);
+ let accounts = ctx.to_account_metas(None);
anchor_lang::solana_program::instruction::Instruction {
program_id: *ctx.program.key,
accounts,
data,
}
};
- let mut acc_infos = ctx.accounts.to_account_infos();
+ let mut acc_infos = ctx.to_account_infos();
acc_infos.push(ctx.program.clone());
anchor_lang::solana_program::program::invoke_signed(
&ix,
