Skip to content

Commit

Permalink
spl: atoken error redesign (#1507)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-schaaf committed Feb 22, 2022
1 parent de08fec commit febb0d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spl/src/associated_token.rs
@@ -1,11 +1,11 @@
use anchor_lang::solana_program::account_info::AccountInfo;
use anchor_lang::solana_program::entrypoint::ProgramResult;
use anchor_lang::solana_program::pubkey::Pubkey;
use anchor_lang::Result;
use anchor_lang::{context::CpiContext, Accounts};

pub use spl_associated_token_account::{get_associated_token_address, ID};

pub fn create<'info>(ctx: CpiContext<'_, '_, '_, 'info, Create<'info>>) -> ProgramResult {
pub fn create<'info>(ctx: CpiContext<'_, '_, '_, 'info, Create<'info>>) -> Result<()> {
let ix = spl_associated_token_account::create_associated_token_account(
ctx.accounts.payer.key,
ctx.accounts.authority.key,
Expand All @@ -24,6 +24,7 @@ pub fn create<'info>(ctx: CpiContext<'_, '_, '_, 'info, Create<'info>>) -> Progr
],
ctx.signer_seeds,
)
.map_err(Into::into)
}

#[derive(Accounts)]
Expand Down

0 comments on commit febb0d0

Please sign in to comment.