Skip to content

Commit

Permalink
spl: change "to" to "from" in token::burn
Browse files Browse the repository at this point in the history
  • Loading branch information
inso- committed Nov 29, 2021
1 parent 926c024 commit 6df6e6a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ incremented for features.

## [Unreleased]

### Breaking

* spl: Change "to" to "from" in `token::burn` ([#161](https://github.com/project-serum/anchor/pull/1080)).

### Fixes

* lang: Add `deprecated` attribute to `ProgramAccount` ([#1014](https://github.com/project-serum/anchor/pull/1014)).
Expand Down
4 changes: 2 additions & 2 deletions spl/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn burn<'a, 'b, 'c, 'info>(
) -> ProgramResult {
let ix = spl_token::instruction::burn(
&spl_token::ID,
ctx.accounts.to.key,
ctx.accounts.from.key,
ctx.accounts.mint.key,
ctx.accounts.authority.key,
&[],
Expand Down Expand Up @@ -261,7 +261,7 @@ pub struct MintTo<'info> {
#[derive(Accounts)]
pub struct Burn<'info> {
pub mint: AccountInfo<'info>,
pub to: AccountInfo<'info>,
pub from: AccountInfo<'info>,
pub authority: AccountInfo<'info>,
}

Expand Down
4 changes: 2 additions & 2 deletions tests/spl/token-proxy/programs/token-proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub struct ProxyBurn<'info> {
#[account(mut)]
pub mint: AccountInfo<'info>,
#[account(mut)]
pub to: AccountInfo<'info>,
pub from: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
}

Expand Down Expand Up @@ -116,7 +116,7 @@ impl<'a, 'b, 'c, 'info> From<&mut ProxyBurn<'info>> for CpiContext<'a, 'b, 'c, '
fn from(accounts: &mut ProxyBurn<'info>) -> CpiContext<'a, 'b, 'c, 'info, Burn<'info>> {
let cpi_accounts = Burn {
mint: accounts.mint.clone(),
to: accounts.to.clone(),
from: accounts.from.clone(),
authority: accounts.authority.clone(),
};
let cpi_program = accounts.token_program.clone();
Expand Down

0 comments on commit 6df6e6a

Please sign in to comment.