Open
Description
12 | #[program]
| ^^^^^^^^^-
| | |
| | `__accounts` dropped here while still borrowed
| borrowed value does not live long enough
| lifetime `'info` defined here
| argument requires that `__accounts` is borrowed for `'info`
I don't why life time error happen when I add 'b
on lib.rs
pub fn battle_log<'b: 'info, 'c: 'info, 'info>(
ctx: Context<'_, 'b, 'c, 'info, BattleLog<'info>>,
battle_info: BattleInfo,
warrior_card_collect_mints: Vec<Pubkey>
) -> Result<()> {
battle_log_process(ctx, battle_info, warrior_card_collect_mints)
}
I want to extract the logic of creating an account into a function, and then it will report an error, asking me to add the relationship between b and info.
The result is written in this way, but it cannot pass the limit of the problem I posted.