Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 7939

how to convert from AccountInfo to UncheckedAccount?

$
0
0
use anchor_lang::prelude::*;use anchor_spl::token::TokenAccount;#[derive(Accounts, Clone)]pub struct InstructionTest<'info> {    pub account: Account<'info, TokenAccount>,}pub fn test(ctx: Context<InstructionTest>) {    let account_info = ctx.accounts.account.to_account_info();    let unchecked_account = UncheckedAccount::try_from(&account_info); // report error}

account_info does not live long enough


Viewing all articles
Browse latest Browse all 7939

Trending Articles



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