diff --git a/clients/js/test/burnV1.test.ts b/clients/js/test/burnV1.test.ts index 2b54c246..c42921f1 100644 --- a/clients/js/test/burnV1.test.ts +++ b/clients/js/test/burnV1.test.ts @@ -1,4 +1,8 @@ -import { generateSigner } from '@metaplex-foundation/umi'; +import { + assertAccountExists, + generateSigner, + sol +} from '@metaplex-foundation/umi'; import test from 'ava'; import { TokenStandard, @@ -33,10 +37,16 @@ test('it can burn a NonFungible', async (t) => { }).sendAndConfirm(umi); // Then the following accounts have been deleted. - t.false(await umi.rpc.accountExists(da.metadata.publicKey)); t.false(await umi.rpc.accountExists(da.edition!.publicKey)); t.false(await umi.rpc.accountExists(da.token.publicKey)); + // And the Metadata account still exists but it was drained and is left with the create fees. + const metadata = await umi.rpc.getAccount(da.metadata.publicKey); + t.true(metadata.exists); + assertAccountExists(metadata); + t.deepEqual(metadata.lamports, sol(0.01)); + t.is(metadata.data.length, 0); + // But the mint account still exists. t.true(await umi.rpc.accountExists(mint)); }); @@ -64,11 +74,17 @@ test('it can burn a ProgrammableNonFungible', async (t) => { }).sendAndConfirm(umi); // Then the following accounts have been deleted. - t.false(await umi.rpc.accountExists(da.metadata.publicKey)); t.false(await umi.rpc.accountExists(da.edition!.publicKey)); t.false(await umi.rpc.accountExists(da.token.publicKey)); t.false(await umi.rpc.accountExists(da.tokenRecord!.publicKey)); + // And the Metadata account still exists but it was drained and is left with the create fees. + const metadata = await umi.rpc.getAccount(da.metadata.publicKey); + t.true(metadata.exists); + assertAccountExists(metadata); + t.deepEqual(metadata.lamports, sol(0.01)); + t.is(metadata.data.length, 0); + // But the mint account still exists. t.true(await umi.rpc.accountExists(mint)); }); diff --git a/clients/js/test/createV1.test.ts b/clients/js/test/createV1.test.ts index 90973cef..fe12efe6 100644 --- a/clients/js/test/createV1.test.ts +++ b/clients/js/test/createV1.test.ts @@ -5,6 +5,7 @@ import { Mint, } from '@metaplex-foundation/mpl-toolbox'; import { + addAmounts, generateSigner, none, percentAmount, @@ -346,6 +347,7 @@ test('an explicit payer can be used for storage fees', async (t) => { // Then the payer has paid the storage fees. const storageFees = await builder.getRentCreatedOnChain(umi); + const totalFees = addAmounts(storageFees, sol(0.01)); // Create fee. const payerBalance = await umi.rpc.getBalance(payer.publicKey); - t.deepEqual(payerBalance, subtractAmounts(sol(10), storageFees)); + t.deepEqual(payerBalance, subtractAmounts(sol(10), totalFees)); });