Skip to content

Commit

Permalink
fix test, correctly burn
Browse files Browse the repository at this point in the history
  • Loading branch information
nhanphan committed Mar 5, 2024
1 parent 478b141 commit 716dacf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clients/js/test/plugins/asset/burn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test('it can burn an asset as the owner', async (t) => {
const afterAsset = await umi.rpc.getAccount(assetAddress.publicKey);
t.true(afterAsset.exists);
assertAccountExists(afterAsset);
t.deepEqual(afterAsset.lamports, sol(0.00089784));
t.deepEqual(afterAsset.lamports, sol(0.00089784 + 0.0015));
t.is(afterAsset.data.length, 1);
t.is(afterAsset.data[0], Key.Uninitialized);
});
Expand Down
2 changes: 1 addition & 1 deletion programs/mpl-core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub(crate) fn close_program_account<'a>(
**funds_dest_account_info.lamports.borrow_mut() = dest_starting_lamports
.checked_add(amount_to_return)
.ok_or(MplCoreError::NumericalOverflowError)?;
**account_to_close_info.lamports.borrow_mut() = one_byte_rent;
**account_to_close_info.try_borrow_mut_lamports()? -= amount_to_return;

account_to_close_info.realloc(1, false)?;
account_to_close_info.data.borrow_mut()[0] = Key::Uninitialized.to_u8().unwrap();
Expand Down

0 comments on commit 716dacf

Please sign in to comment.