8000 accounts is borrowed for 'info · Issue #3415 · solana-foundation/anchor · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
accounts is borrowed for 'info #3415
Open
@cxp-13

Description

@cxp-13
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.

fbc83ba68919fab094857cdbc31588a

The result is written in this way, but it cannot pass the limit of the problem I posted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0