From f343436322f3d61f26058057ee9a83f42cc4b125 Mon Sep 17 00:00:00 2001 From: Stanislav Cherviakov Date: Thu, 22 Aug 2024 15:59:02 +0100 Subject: [PATCH] fix formatting, update lock file and generated idl versions --- account-compression/Cargo.lock | 6 +++--- .../sdk/idl/spl_account_compression.json | 2 +- .../sdk/tests/accountCompression.test.ts | 20 +++++++++---------- .../concurrentMerkleTreeAccount.test.ts | 20 +++++++++++-------- 4 files changed, 26 insertions(+), 22 deletions(-) diff --git a/account-compression/Cargo.lock b/account-compression/Cargo.lock index c5764a640be..495e39b6904 100644 --- a/account-compression/Cargo.lock +++ b/account-compression/Cargo.lock @@ -544,9 +544,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.16.1" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" +checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31" dependencies = [ "bytemuck_derive", ] @@ -1563,7 +1563,7 @@ dependencies = [ [[package]] name = "spl-account-compression" -version = "0.3.0" +version = "0.3.1" dependencies = [ "anchor-lang", "bytemuck", diff --git a/account-compression/sdk/idl/spl_account_compression.json b/account-compression/sdk/idl/spl_account_compression.json index fc0825eed53..a9477f25eca 100644 --- a/account-compression/sdk/idl/spl_account_compression.json +++ b/account-compression/sdk/idl/spl_account_compression.json @@ -1,5 +1,5 @@ { - "version": "0.3.0", + "version": "0.3.1", "name": "spl_account_compression", "instructions": [ { diff --git a/account-compression/sdk/tests/accountCompression.test.ts b/account-compression/sdk/tests/accountCompression.test.ts index 02e77cfdab6..deb7a2e3173 100644 --- a/account-compression/sdk/tests/accountCompression.test.ts +++ b/account-compression/sdk/tests/accountCompression.test.ts @@ -179,7 +179,7 @@ describe('Account Compression', () => { assert(false, 'Double finalizing should have failed'); } catch {} }); - + it('Should be able to close a prepared tree', async () => { let payerInfo = await provider.connection.getAccountInfo(payer, 'confirmed')!; let treeInfo = await provider.connection.getAccountInfo(cmt, 'confirmed')!; @@ -189,12 +189,12 @@ describe('Account Compression', () => { const closeIx = createCloseEmptyTreeIx(cmt, payer, payer); await execute(provider, [closeIx], [payerKeypair]); - + payerInfo = await provider.connection.getAccountInfo(payer, 'confirmed')!; const finalLamports = payerInfo!.lamports; assert( finalLamports === payerLamports + treeLamports - 5000, - 'Expected payer to have received the lamports from the closed tree account' + 'Expected payer to have received the lamports from the closed tree account', ); treeInfo = await provider.connection.getAccountInfo(cmt, 'confirmed'); @@ -499,7 +499,7 @@ describe('Account Compression', () => { }); it('Should be able to close a prepared tree after setting the canopy', async () => { const merkleTreeRaw = new MerkleTree(leaves); - + const appendIx = createAppendCanopyNodesIx( cmt, payer, @@ -518,12 +518,12 @@ describe('Account Compression', () => { const closeIx = createCloseEmptyTreeIx(cmt, payer, payer); await execute(provider, [closeIx], [payerKeypair]); - + payerInfo = await provider.connection.getAccountInfo(payer, 'confirmed')!; const finalLamports = payerInfo!.lamports; assert( finalLamports === payerLamports + treeLamports - 5000, - 'Expected payer to have received the lamports from the closed tree account' + 'Expected payer to have received the lamports from the closed tree account', ); treeInfo = await provider.connection.getAccountInfo(cmt, 'confirmed'); @@ -565,7 +565,7 @@ describe('Account Compression', () => { 'confirmed', ); }); - + it('Should be able to finalize an empty tree with empty canopy and close it afterwards', async () => { const merkleTreeRaw = new MerkleTree(leaves); const root = merkleTreeRaw.root; @@ -588,12 +588,12 @@ describe('Account Compression', () => { const closeIx = createCloseEmptyTreeIx(cmt, payer, payer); await execute(provider, [closeIx], [payerKeypair]); - + payerInfo = await provider.connection.getAccountInfo(payer, 'confirmed')!; const finalLamports = payerInfo!.lamports; assert( finalLamports === payerLamports + treeLamports - 5000, - 'Expected payer to have received the lamports from the closed tree account' + 'Expected payer to have received the lamports from the closed tree account', ); treeInfo = await provider.connection.getAccountInfo(cmt, 'confirmed'); @@ -1054,7 +1054,7 @@ describe('Account Compression', () => { payerKeypair, 0, { maxBufferSize: 8, maxDepth: DEPTH }, - DEPTH // Store full tree on chain + DEPTH, // Store full tree on chain ); cmt = cmtKeypair.publicKey; const appendIx = createAppendCanopyNodesIx(cmt, payer, [crypto.randomBytes(32)], 0); diff --git a/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts b/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts index c3dcbcb85c9..5e85aaca0c9 100644 --- a/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts +++ b/account-compression/sdk/tests/accounts/concurrentMerkleTreeAccount.test.ts @@ -35,7 +35,7 @@ export function assertCMTProperties( } assert( onChainCMT.getIsBatchInitialized() === expectedIsBatchInitialized, - 'On chain isBatchInitialized does not match expected value' + 'On chain isBatchInitialized does not match expected value', ); } @@ -153,20 +153,24 @@ describe('ConcurrentMerkleTreeAccount tests', () => { // The account data was generated by running: // $ solana account 27QMkDMpBoAhmWj6xxQNYdqXZL5nnC8tkZcEtkNxCqeX \ // --output-file tests/fixtures/pre-batch-init-tree-account.json \ - // --output json + // --output json const deployedAccount = new PublicKey('27QMkDMpBoAhmWj6xxQNYdqXZL5nnC8tkZcEtkNxCqeX'); - const cmt = await ConcurrentMerkleTreeAccount.fromAccountAddress( - connection, - deployedAccount, - 'confirmed' - ); + const cmt = await ConcurrentMerkleTreeAccount.fromAccountAddress(connection, deployedAccount, 'confirmed'); const expectedMaxDepth = 10; const expectedMaxBufferSize = 32; const expectedCanopyDepth = 0; const expectedAuthority = new PublicKey('BFNT941iRwYPe2Js64dTJSoksGCptWAwrkKMaSN73XK2'); const expectedRoot = new PublicKey('83UjseEuEgxyVyDTmrJCQ9QbeksdRZ7KPDZGQYc5cAgF').toBuffer(); const expectedIsBatchInitialized = false; - await assertCMTProperties(cmt, expectedMaxDepth, expectedMaxBufferSize, expectedAuthority, expectedRoot, expectedCanopyDepth, expectedIsBatchInitialized); + await assertCMTProperties( + cmt, + expectedMaxDepth, + expectedMaxBufferSize, + expectedAuthority, + expectedRoot, + expectedCanopyDepth, + expectedIsBatchInitialized, + ); }); }); });