From 42ffed35da6b2a673efacd63030a360eac3ae64e Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Sun, 15 Sep 2024 15:26:03 -0700 Subject: [PATCH] Test creating a new tree size from spl-account-compression 0.3.1 (#109) --- clients/js/test/createTree.test.ts | 29 +++++++++++++++++++++++++++++ clients/rust/tests/mint.rs | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/clients/js/test/createTree.test.ts b/clients/js/test/createTree.test.ts index 42ef21a2..e40a6fb7 100644 --- a/clients/js/test/createTree.test.ts +++ b/clients/js/test/createTree.test.ts @@ -31,3 +31,32 @@ test('it can create a Bubblegum tree', async (t) => { isPublic: false, }); }); + +test('it can create a Bubblegum tree using a newer size', async (t) => { + // Given a brand new merkle tree signer. + const umi = await createUmi(); + const merkleTree = generateSigner(umi); + + // When we create a tree at this address. + const builder = await createTree(umi, { + merkleTree, + maxDepth: 6, + maxBufferSize: 16, + }); + await builder.sendAndConfirm(umi); + + // Then an account exists at the merkle tree address. + t.true(await umi.rpc.accountExists(merkleTree.publicKey)); + + // And a tree config was created with the correct data. + const treeConfig = await fetchTreeConfigFromSeeds(umi, { + merkleTree: merkleTree.publicKey, + }); + t.like(treeConfig, { + treeCreator: publicKey(umi.identity), + treeDelegate: publicKey(umi.identity), + totalMintCapacity: 2n ** 6n, + numMinted: 0n, + isPublic: false, + }); +}); diff --git a/clients/rust/tests/mint.rs b/clients/rust/tests/mint.rs index 72915143..252e2cd5 100644 --- a/clients/rust/tests/mint.rs +++ b/clients/rust/tests/mint.rs @@ -23,7 +23,7 @@ mod mint { // Given a new merkle tree. - let mut tree_manager = TreeManager::<5, 8>::default(); + let mut tree_manager = TreeManager::<6, 16>::default(); tree_manager.create(&mut context).await.unwrap(); assert!(find_account(&mut context, &tree_manager.tree.pubkey())