Skip to content

Commit

Permalink
Revert "Added token::transfer_checked wrapper to token (#2351)" (#2352)
Browse files Browse the repository at this point in the history
This reverts commit a068171.
  • Loading branch information
Henry-E authored Jan 4, 2023
1 parent a068171 commit 8f3291a
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions spl/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,6 @@ pub fn transfer<'a, 'b, 'c, 'info>(
.map_err(Into::into)
}

pub fn transfer_checked<'a, 'b, 'c, 'info>(
ctx: CpiContext<'a, 'b, 'c, 'info, TransferChecked<'info>>,
amount: u64,
decimals: u8,
) -> Result<()> {
let ix = spl_token::instruction::transfer_checked(
&spl_token::ID,
ctx.accounts.from.key,
ctx.accounts.mint.key,
ctx.accounts.to.key,
ctx.accounts.authority.key,
&[],
amount,
decimals
)?;
solana_program::program::invoke_signed(
&ix, &[
ctx.accounts.from.clone(),
ctx.accounts.mint.clone(),
ctx.accounts.to.clone(),
ctx.accounts.authority.clone(),
],
ctx.signer_seeds
)
.map_err(Into::into)
}

pub fn mint_to<'a, 'b, 'c, 'info>(
ctx: CpiContext<'a, 'b, 'c, 'info, MintTo<'info>>,
amount: u64,
Expand Down Expand Up @@ -334,14 +307,6 @@ pub struct Transfer<'info> {
pub authority: AccountInfo<'info>,
}

#[derive(Accounts)]
pub struct TransferChecked<'info> {
pub from: AccountInfo<'info>,
pub mint: AccountInfo<'info>,
pub to: AccountInfo<'info>,
pub authority: AccountInfo<'info>,
}

#[derive(Accounts)]
pub struct MintTo<'info> {
pub mint: AccountInfo<'info>,
Expand Down

1 comment on commit 8f3291a

@vercel
Copy link

@vercel vercel bot commented on 8f3291a Jan 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

anchor-docs – ./

anchor-docs-git-master-200ms.vercel.app
anchor-docs-200ms.vercel.app
www.anchor-lang.com
anchor-lang.com

Please sign in to comment.