diff --git a/account-compression/sdk/package.json b/account-compression/sdk/package.json index 7fb7ec01b67..73952932c4f 100644 --- a/account-compression/sdk/package.json +++ b/account-compression/sdk/package.json @@ -69,7 +69,7 @@ "@types/jest": "^29.5.12", "@types/node": "^22.2.0", "@types/node-fetch": "^2.6.11", - "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", "@typescript-eslint/parser": "^8.1.0", "eslint": "^8.57.0", "eslint-config-turbo": "^2.0.12", diff --git a/account-compression/sdk/tests/accountCompression.test.ts b/account-compression/sdk/tests/accountCompression.test.ts index 257e02e476f..d7a3338b7eb 100644 --- a/account-compression/sdk/tests/accountCompression.test.ts +++ b/account-compression/sdk/tests/accountCompression.test.ts @@ -298,7 +298,7 @@ describe('Account Compression', () => { try { await execute(provider, [ix], [payerKeypair]); assert(false, 'Closing a tree account before it is empty should ALWAYS error'); - } catch (e) {} + } catch {} }); }); @@ -343,7 +343,7 @@ describe('Account Compression', () => { try { await execute(provider, [replaceIx], [payerKeypair]); assert(false, 'Attacker was able to successfully write fake existence of a leaf'); - } catch (e) {} + } catch {} const splCMT = await ConcurrentMerkleTreeAccount.fromAccountAddress(connection, cmt); @@ -503,7 +503,7 @@ describe('Account Compression', () => { try { await execute(provider, [replaceIx], [payerKeypair]); throw Error('This replace instruction should have failed because the leaf index is OOB'); - } catch (_e) {} + } catch {} }); }); }); diff --git a/libraries/type-length-value/js/package.json b/libraries/type-length-value/js/package.json index a1a81e78083..88b4c71af5d 100644 --- a/libraries/type-length-value/js/package.json +++ b/libraries/type-length-value/js/package.json @@ -49,7 +49,7 @@ "@types/chai": "^4.3.17", "@types/mocha": "^10.0.7", "@types/node": "^22.2.0", - "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", "@typescript-eslint/parser": "^8.1.0", "chai": "^5.1.1", "eslint": "^8.57.0", diff --git a/libraries/type-length-value/js/test/tlvData.test.ts b/libraries/type-length-value/js/test/tlvData.test.ts index 2ac06aff7e9..d43604ff37b 100644 --- a/libraries/type-length-value/js/test/tlvData.test.ts +++ b/libraries/type-length-value/js/test/tlvData.test.ts @@ -92,7 +92,7 @@ describe('tlvData', () => { type[0] = 2; expect(tlv.firstBytes(type)).to.be.deep.equal(Buffer.from([1, 2])); type[0] = 3; - expect(tlv.firstBytes(type)).to.be.null; + expect(tlv.firstBytes(type)).to.equal(null); }; it('should get the entries individually', () => { diff --git a/memo/js/package.json b/memo/js/package.json index bf10f58ac8b..3b41ae76069 100644 --- a/memo/js/package.json +++ b/memo/js/package.json @@ -56,7 +56,7 @@ "@types/jest": "^29.5.12", "@types/node": "^22.2.0", "@types/node-fetch": "^2.6.11", - "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", "@typescript-eslint/parser": "^8.1.0", "chai": "^5.1.1", "eslint": "^8.57.0", diff --git a/name-service/js/package.json b/name-service/js/package.json index a85733135a5..a4ff24206b4 100644 --- a/name-service/js/package.json +++ b/name-service/js/package.json @@ -46,7 +46,7 @@ "@types/bn.js": "^5.1.1", "@types/jest": "^29.5.12", "@types/node": "^22.2.0", - "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", "@typescript-eslint/parser": "^8.1.0", "eslint": "^8.57.0", "eslint-plugin-eslint-comments": "^3.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6a7ee3bfed9..4a98f616cbe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -62,7 +62,7 @@ importers: version: 0.20.1 '@solana/eslint-config-solana': specifier: ^3.0.3 - version: 3.0.3(@typescript-eslint/eslint-plugin@7.17.0)(@typescript-eslint/parser@8.1.0)(eslint-plugin-jest@28.8.0)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-simple-import-sort@12.1.1)(eslint-plugin-sort-keys-fix@1.1.2)(eslint-plugin-typescript-sort-keys@3.2.0)(eslint@8.57.0)(typescript@5.5.4) + version: 3.0.3(@typescript-eslint/eslint-plugin@8.1.0)(@typescript-eslint/parser@8.1.0)(eslint-plugin-jest@28.8.0)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-simple-import-sort@12.1.1)(eslint-plugin-sort-keys-fix@1.1.2)(eslint-plugin-typescript-sort-keys@3.2.0)(eslint@8.57.0)(typescript@5.5.4) '@types/bn.js': specifier: ^5.1.0 version: 5.1.5 @@ -76,8 +76,8 @@ importers: specifier: ^2.6.11 version: 2.6.11 '@typescript-eslint/eslint-plugin': - specifier: ^7.17.0 - version: 7.17.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) + specifier: ^8.1.0 + version: 8.1.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': specifier: ^8.1.0 version: 8.1.0(eslint@8.57.0)(typescript@5.5.4) @@ -92,7 +92,7 @@ importers: version: 2.29.1(@typescript-eslint/parser@8.1.0)(eslint@8.57.0) eslint-plugin-jest: specifier: ^28.8.0 - version: 28.8.0(@typescript-eslint/eslint-plugin@7.17.0)(eslint@8.57.0)(jest@29.7.0)(typescript@5.5.4) + version: 28.8.0(@typescript-eslint/eslint-plugin@8.1.0)(eslint@8.57.0)(jest@29.7.0)(typescript@5.5.4) eslint-plugin-mocha: specifier: ^10.5.0 version: 10.5.0(eslint@8.57.0) @@ -146,8 +146,8 @@ importers: specifier: ^22.2.0 version: 22.2.0 '@typescript-eslint/eslint-plugin': - specifier: ^7.17.0 - version: 7.17.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) + specifier: ^8.1.0 + version: 8.1.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': specifier: ^8.1.0 version: 8.1.0(eslint@8.57.0)(typescript@5.5.4) @@ -201,8 +201,8 @@ importers: specifier: ^2.6.11 version: 2.6.11 '@typescript-eslint/eslint-plugin': - specifier: ^7.17.0 - version: 7.17.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) + specifier: ^8.1.0 + version: 8.1.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': specifier: ^8.1.0 version: 8.1.0(eslint@8.57.0)(typescript@5.5.4) @@ -268,8 +268,8 @@ importers: specifier: ^22.2.0 version: 22.2.0 '@typescript-eslint/eslint-plugin': - specifier: ^7.17.0 - version: 7.17.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) + specifier: ^8.1.0 + version: 8.1.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': specifier: ^8.1.0 version: 8.1.0(eslint@8.57.0)(typescript@5.5.4) @@ -323,8 +323,8 @@ importers: specifier: ^22.2.0 version: 22.2.0 '@typescript-eslint/eslint-plugin': - specifier: ^7.17.0 - version: 7.17.0(@typescript-eslint/parser@7.18.0)(eslint@8.57.0)(typescript@5.5.4) + specifier: ^8.1.0 + version: 8.1.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) ava: specifier: ^6.1.3 version: 6.1.3(@ava/typescript@5.0.0) @@ -357,8 +357,8 @@ importers: specifier: ^22.2.0 version: 22.2.0 '@typescript-eslint/eslint-plugin': - specifier: ^7.17.0 - version: 7.17.0(@typescript-eslint/parser@7.18.0)(eslint@8.57.0)(typescript@5.5.4) + specifier: ^8.1.0 + version: 8.1.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) eslint: specifier: ^8.57.0 version: 8.57.0 @@ -424,8 +424,8 @@ importers: specifier: ^2.6.11 version: 2.6.11 '@typescript-eslint/eslint-plugin': - specifier: ^7.17.0 - version: 7.17.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) + specifier: ^8.1.0 + version: 8.1.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': specifier: ^8.1.0 version: 8.1.0(eslint@8.57.0)(typescript@5.5.4) @@ -476,8 +476,8 @@ importers: specifier: ^22.2.0 version: 22.2.0 '@typescript-eslint/eslint-plugin': - specifier: ^7.17.0 - version: 7.17.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) + specifier: ^8.1.0 + version: 8.1.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': specifier: ^8.1.0 version: 8.1.0(eslint@8.57.0)(typescript@5.5.4) @@ -549,8 +549,8 @@ importers: specifier: ^22.2.0 version: 22.2.0 '@typescript-eslint/eslint-plugin': - specifier: ^7.17.0 - version: 7.17.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) + specifier: ^8.1.0 + version: 8.1.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': specifier: ^8.1.0 version: 8.1.0(eslint@8.57.0)(typescript@5.5.4) @@ -598,8 +598,8 @@ importers: specifier: ^22.2.0 version: 22.2.0 '@typescript-eslint/eslint-plugin': - specifier: ^7.17.0 - version: 7.17.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) + specifier: ^8.1.0 + version: 8.1.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': specifier: ^8.1.0 version: 8.1.0(eslint@8.57.0)(typescript@5.5.4) @@ -662,8 +662,8 @@ importers: specifier: ^10.0.7 version: 10.0.7 '@typescript-eslint/eslint-plugin': - specifier: ^7.17.0 - version: 7.17.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) + specifier: ^8.1.0 + version: 8.1.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': specifier: ^8.1.0 version: 8.1.0(eslint@8.57.0)(typescript@5.5.4) @@ -732,8 +732,8 @@ importers: specifier: ^2.6.11 version: 2.6.11 '@typescript-eslint/eslint-plugin': - specifier: ^7.17.0 - version: 7.17.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) + specifier: ^8.1.0 + version: 8.1.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': specifier: ^8.1.0 version: 8.1.0(eslint@8.57.0)(typescript@5.5.4) @@ -2380,7 +2380,7 @@ packages: typescript: 5.5.4 dev: true - /@solana/eslint-config-solana@3.0.3(@typescript-eslint/eslint-plugin@7.17.0)(@typescript-eslint/parser@8.1.0)(eslint-plugin-jest@28.8.0)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-simple-import-sort@12.1.1)(eslint-plugin-sort-keys-fix@1.1.2)(eslint-plugin-typescript-sort-keys@3.2.0)(eslint@8.57.0)(typescript@5.5.4): + /@solana/eslint-config-solana@3.0.3(@typescript-eslint/eslint-plugin@8.1.0)(@typescript-eslint/parser@8.1.0)(eslint-plugin-jest@28.8.0)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-simple-import-sort@12.1.1)(eslint-plugin-sort-keys-fix@1.1.2)(eslint-plugin-typescript-sort-keys@3.2.0)(eslint@8.57.0)(typescript@5.5.4): resolution: {integrity: sha512-yTaeCbOBwjmK4oUkknixOpwOzzAK8+4YWvJEJFNHuueESetieDnAeEHV7rzJllFgHEWa9nXps9Q3aD4/XJp71A==} peerDependencies: '@typescript-eslint/eslint-plugin': ^6.0.0 @@ -2393,10 +2393,10 @@ packages: eslint-plugin-typescript-sort-keys: ^3.2.0 typescript: ^5.1.6 dependencies: - '@typescript-eslint/eslint-plugin': 7.17.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/eslint-plugin': 8.1.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': 8.1.0(eslint@8.57.0)(typescript@5.5.4) eslint: 8.57.0 - eslint-plugin-jest: 28.8.0(@typescript-eslint/eslint-plugin@7.17.0)(eslint@8.57.0)(jest@29.7.0)(typescript@5.5.4) + eslint-plugin-jest: 28.8.0(@typescript-eslint/eslint-plugin@8.1.0)(eslint@8.57.0)(jest@29.7.0)(typescript@5.5.4) eslint-plugin-react-hooks: 4.6.0(eslint@8.57.0) eslint-plugin-simple-import-sort: 12.1.1(eslint@8.57.0) eslint-plugin-sort-keys-fix: 1.1.2 @@ -2756,39 +2756,12 @@ packages: - supports-color dev: true - /@typescript-eslint/eslint-plugin@7.17.0(@typescript-eslint/parser@7.18.0)(eslint@8.57.0)(typescript@5.5.4): - resolution: {integrity: sha512-pyiDhEuLM3PuANxH7uNYan1AaFs5XE0zw1hq69JBvGvE7gSuEoQl1ydtEe/XQeoC3GQxLXyOVa5kNOATgM638A==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - '@typescript-eslint/parser': ^7.0.0 - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.18.0(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/scope-manager': 7.17.0 - '@typescript-eslint/type-utils': 7.17.0(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/utils': 7.17.0(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/visitor-keys': 7.17.0 - eslint: 8.57.0 - graphemer: 1.4.0 - ignore: 5.3.1 - natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.5.4) - typescript: 5.5.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/eslint-plugin@7.17.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4): - resolution: {integrity: sha512-pyiDhEuLM3PuANxH7uNYan1AaFs5XE0zw1hq69JBvGvE7gSuEoQl1ydtEe/XQeoC3GQxLXyOVa5kNOATgM638A==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/eslint-plugin@8.1.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4): + resolution: {integrity: sha512-LlNBaHFCEBPHyD4pZXb35mzjGkuGKXU5eeCA1SxvHfiRES0E82dOounfVpL4DCqYvJEKab0bZIA0gCRpdLKkCw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^7.0.0 - eslint: ^8.56.0 + '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 typescript: '*' peerDependenciesMeta: typescript: @@ -2796,10 +2769,10 @@ packages: dependencies: '@eslint-community/regexpp': 4.10.0 '@typescript-eslint/parser': 8.1.0(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/scope-manager': 7.17.0 - '@typescript-eslint/type-utils': 7.17.0(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/utils': 7.17.0(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/visitor-keys': 7.17.0 + '@typescript-eslint/scope-manager': 8.1.0 + '@typescript-eslint/type-utils': 8.1.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.1.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.1.0 eslint: 8.57.0 graphemer: 1.4.0 ignore: 5.3.1 @@ -2844,27 +2817,6 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4): - resolution: {integrity: sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) - '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.6(supports-color@8.1.1) - eslint: 8.57.0 - typescript: 5.5.4 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/parser@8.1.0(eslint@8.57.0)(typescript@5.5.4): resolution: {integrity: sha512-U7iTAtGgJk6DPX9wIWPPOlt1gO57097G06gIcl0N0EEnNw8RGD62c+2/DiP/zL7KrkqnnqF7gtFGR7YgzPllTA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -2902,22 +2854,6 @@ packages: '@typescript-eslint/visitor-keys': 6.21.0 dev: true - /@typescript-eslint/scope-manager@7.17.0: - resolution: {integrity: sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==} - engines: {node: ^18.18.0 || >=20.0.0} - dependencies: - '@typescript-eslint/types': 7.17.0 - '@typescript-eslint/visitor-keys': 7.17.0 - dev: true - - /@typescript-eslint/scope-manager@7.18.0: - resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} - engines: {node: ^18.18.0 || >=20.0.0} - dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 - dev: true - /@typescript-eslint/scope-manager@8.0.0: resolution: {integrity: sha512-V0aa9Csx/ZWWv2IPgTfY7T4agYwJyILESu/PVqFtTFz9RIS823mAze+NbnBI8xiwdX3iqeQbcTYlvB04G9wyQw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -2954,28 +2890,8 @@ packages: - supports-color dev: true - /@typescript-eslint/type-utils@7.17.0(eslint@8.57.0)(typescript@5.5.4): - resolution: {integrity: sha512-XD3aaBt+orgkM/7Cei0XNEm1vwUxQ958AOLALzPlbPqb8C1G8PZK85tND7Jpe69Wualri81PLU+Zc48GVKIMMA==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/typescript-estree': 7.17.0(typescript@5.5.4) - '@typescript-eslint/utils': 7.17.0(eslint@8.57.0)(typescript@5.5.4) - debug: 4.3.6(supports-color@8.1.1) - eslint: 8.57.0 - ts-api-utils: 1.3.0(typescript@5.5.4) - typescript: 5.5.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/type-utils@8.0.0(eslint@8.57.0)(typescript@5.5.4): - resolution: {integrity: sha512-mJAFP2mZLTBwAn5WI4PMakpywfWFH5nQZezUQdSKV23Pqo6o9iShQg1hP2+0hJJXP2LnZkWPphdIq4juYYwCeg==} + /@typescript-eslint/type-utils@8.1.0(eslint@8.57.0)(typescript@5.5.4): + resolution: {integrity: sha512-oLYvTxljVvsMnldfl6jIKxTaU7ok7km0KDrwOt1RHYu6nxlhN3TIx8k5Q52L6wR33nOwDgM7VwW1fT1qMNfFIA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -2983,8 +2899,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/typescript-estree': 8.1.0(typescript@5.5.4) + '@typescript-eslint/utils': 8.1.0(eslint@8.57.0)(typescript@5.5.4) debug: 4.3.6(supports-color@8.1.1) ts-api-utils: 1.3.0(typescript@5.5.4) typescript: 5.5.4 @@ -3003,16 +2919,6 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/types@7.17.0: - resolution: {integrity: sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==} - engines: {node: ^18.18.0 || >=20.0.0} - dev: true - - /@typescript-eslint/types@7.18.0: - resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} - engines: {node: ^18.18.0 || >=20.0.0} - dev: true - /@typescript-eslint/types@8.0.0: resolution: {integrity: sha512-wgdSGs9BTMWQ7ooeHtu5quddKKs5Z5dS+fHLbrQI+ID0XWJLODGMHRfhwImiHoeO2S5Wir2yXuadJN6/l4JRxw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -3066,50 +2972,6 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree@7.17.0(typescript@5.5.4): - resolution: {integrity: sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 7.17.0 - '@typescript-eslint/visitor-keys': 7.17.0 - debug: 4.3.6(supports-color@8.1.1) - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.5 - semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.5.4) - typescript: 5.5.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/typescript-estree@7.18.0(typescript@5.5.4): - resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.6(supports-color@8.1.1) - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.5 - semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.5.4) - typescript: 5.5.4 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/typescript-estree@8.0.0(typescript@5.5.4): resolution: {integrity: sha512-5b97WpKMX+Y43YKi4zVcCVLtK5F98dFls3Oxui8LbnmRsseKenbbDinmvxrWegKDMmlkIq/XHuyy0UGLtpCDKg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -3193,32 +3055,32 @@ packages: - typescript dev: true - /@typescript-eslint/utils@7.17.0(eslint@8.57.0)(typescript@5.5.4): - resolution: {integrity: sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/utils@8.0.0(eslint@8.57.0)(typescript@5.5.4): + resolution: {integrity: sha512-k/oS/A/3QeGLRvOWCg6/9rATJL5rec7/5s1YmdS0ZU6LHveJyGFwBvLhSRBv6i9xaj7etmosp+l+ViN1I9Aj/Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 + eslint: ^8.57.0 || ^9.0.0 dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@typescript-eslint/scope-manager': 7.17.0 - '@typescript-eslint/types': 7.17.0 - '@typescript-eslint/typescript-estree': 7.17.0(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.0.0 + '@typescript-eslint/types': 8.0.0 + '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.4) eslint: 8.57.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/utils@8.0.0(eslint@8.57.0)(typescript@5.5.4): - resolution: {integrity: sha512-k/oS/A/3QeGLRvOWCg6/9rATJL5rec7/5s1YmdS0ZU6LHveJyGFwBvLhSRBv6i9xaj7etmosp+l+ViN1I9Aj/Q==} + /@typescript-eslint/utils@8.1.0(eslint@8.57.0)(typescript@5.5.4): + resolution: {integrity: sha512-ypRueFNKTIFwqPeJBfeIpxZ895PQhNyH4YID6js0UoBImWYoSjBsahUn9KMiJXh94uOjVBgHD9AmkyPsPnFwJA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@typescript-eslint/scope-manager': 8.0.0 - '@typescript-eslint/types': 8.0.0 - '@typescript-eslint/typescript-estree': 8.0.0(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.1.0 + '@typescript-eslint/types': 8.1.0 + '@typescript-eslint/typescript-estree': 8.1.0(typescript@5.5.4) eslint: 8.57.0 transitivePeerDependencies: - supports-color @@ -3241,22 +3103,6 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/visitor-keys@7.17.0: - resolution: {integrity: sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==} - engines: {node: ^18.18.0 || >=20.0.0} - dependencies: - '@typescript-eslint/types': 7.17.0 - eslint-visitor-keys: 3.4.3 - dev: true - - /@typescript-eslint/visitor-keys@7.18.0: - resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} - engines: {node: ^18.18.0 || >=20.0.0} - dependencies: - '@typescript-eslint/types': 7.18.0 - eslint-visitor-keys: 3.4.3 - dev: true - /@typescript-eslint/visitor-keys@8.0.0: resolution: {integrity: sha512-oN0K4nkHuOyF3PVMyETbpP5zp6wfyOvm7tWhTMfoqxSSsPmJIh6JNASuZDlODE8eE+0EB9uar+6+vxr9DBTYOA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -4702,7 +4548,7 @@ packages: - typescript dev: true - /eslint-plugin-jest@28.8.0(@typescript-eslint/eslint-plugin@7.17.0)(eslint@8.57.0)(jest@29.7.0)(typescript@5.5.4): + /eslint-plugin-jest@28.8.0(@typescript-eslint/eslint-plugin@8.1.0)(eslint@8.57.0)(jest@29.7.0)(typescript@5.5.4): resolution: {integrity: sha512-Tubj1hooFxCl52G4qQu0edzV/+EZzPUeN8p2NnW5uu4fbDs+Yo7+qDVDc4/oG3FbCqEBmu/OC3LSsyiU22oghw==} engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} peerDependencies: @@ -4715,7 +4561,7 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 7.17.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/eslint-plugin': 8.1.0(@typescript-eslint/parser@8.1.0)(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/utils': 8.0.0(eslint@8.57.0)(typescript@5.5.4) eslint: 8.57.0 jest: 29.7.0(@types/node@22.2.0)(ts-node@10.9.2) @@ -5768,7 +5614,7 @@ packages: eslint: '*' typescript: '>=4.7.4' dependencies: - '@typescript-eslint/type-utils': 8.0.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/type-utils': 8.1.0(eslint@8.57.0)(typescript@5.5.4) eslint: 8.57.0 ts-api-utils: 1.3.0(typescript@5.5.4) ts-declaration-location: 1.0.4(typescript@5.5.4) diff --git a/single-pool/js/packages/classic/package.json b/single-pool/js/packages/classic/package.json index cd45bceb666..45742ed1ec2 100644 --- a/single-pool/js/packages/classic/package.json +++ b/single-pool/js/packages/classic/package.json @@ -20,7 +20,7 @@ "devDependencies": { "@types/node": "^22.2.0", "@ava/typescript": "^5.0.0", - "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", "ava": "^6.1.3", "eslint": "^8.57.0", "solana-bankrun": "^0.2.0", diff --git a/single-pool/js/packages/modern/package.json b/single-pool/js/packages/modern/package.json index cd899a5ef91..4de031514c5 100644 --- a/single-pool/js/packages/modern/package.json +++ b/single-pool/js/packages/modern/package.json @@ -17,7 +17,7 @@ }, "devDependencies": { "@types/node": "^22.2.0", - "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", "eslint": "^8.57.0", "typescript": "^5.5.4" }, diff --git a/stake-pool/js/package.json b/stake-pool/js/package.json index b9fb4f5da22..83f72c699da 100644 --- a/stake-pool/js/package.json +++ b/stake-pool/js/package.json @@ -63,7 +63,7 @@ "@types/jest": "^29.5.12", "@types/node": "^22.2.0", "@types/node-fetch": "^2.6.11", - "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", "@typescript-eslint/parser": "^8.1.0", "cross-env": "^7.0.3", "eslint": "^8.57.0", diff --git a/token-group/js/package.json b/token-group/js/package.json index 64db8c60975..0cc73151d67 100644 --- a/token-group/js/package.json +++ b/token-group/js/package.json @@ -54,7 +54,7 @@ "@types/chai": "^4.3.17", "@types/mocha": "^10.0.7", "@types/node": "^22.2.0", - "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", "@typescript-eslint/parser": "^8.1.0", "chai": "^5.1.1", "eslint": "^8.57.0", diff --git a/token-lending/js/package.json b/token-lending/js/package.json index e219193686f..c0c36ec3804 100644 --- a/token-lending/js/package.json +++ b/token-lending/js/package.json @@ -48,7 +48,7 @@ "@solana/web3.js": "^1.95.2", "@types/eslint": "^8.56.7", "@types/node": "^22.2.0", - "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", "@typescript-eslint/parser": "^8.1.0", "eslint": "^8.57.0", "gh-pages": "^6.1.1", diff --git a/token-metadata/js/package.json b/token-metadata/js/package.json index 9d2e0f605b8..fb0dffae694 100644 --- a/token-metadata/js/package.json +++ b/token-metadata/js/package.json @@ -54,7 +54,7 @@ "@types/chai": "^4.3.17", "@types/mocha": "^10.0.7", "@types/node": "^22.2.0", - "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", "@typescript-eslint/parser": "^8.1.0", "chai": "^5.1.1", "eslint": "^8.57.0", diff --git a/token-swap/js/package.json b/token-swap/js/package.json index e40d27aa7ae..a952e94e9ab 100644 --- a/token-swap/js/package.json +++ b/token-swap/js/package.json @@ -55,7 +55,7 @@ "@types/chai-as-promised": "^7.1.4", "@types/chai": "^4.3.17", "@types/mocha": "^10.0.7", - "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", "@typescript-eslint/parser": "^8.1.0", "eslint": "^8.57.0", "eslint-plugin-import": "^2.29.1", diff --git a/token/js/package.json b/token/js/package.json index 1e98c7b9518..af45613d31b 100644 --- a/token/js/package.json +++ b/token/js/package.json @@ -68,7 +68,7 @@ "@types/mocha": "^10.0.7", "@types/node": "^22.2.0", "@types/node-fetch": "^2.6.11", - "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/eslint-plugin": "^8.1.0", "@typescript-eslint/parser": "^8.1.0", "chai": "^5.1.1", "chai-as-promised": "^8.0.0", diff --git a/token/js/test/e2e-2022/closeMint.test.ts b/token/js/test/e2e-2022/closeMint.test.ts index 4e83df50560..0f144dc6aeb 100644 --- a/token/js/test/e2e-2022/closeMint.test.ts +++ b/token/js/test/e2e-2022/closeMint.test.ts @@ -62,14 +62,15 @@ describe('closeMint', () => { account = await createAccount(connection, payer, mint, owner.publicKey, undefined, undefined, TEST_PROGRAM_ID); const amount = BigInt(1000); await mintTo(connection, payer, mint, account, mintAuthority, amount, [], undefined, TEST_PROGRAM_ID); - expect(closeAccount(connection, payer, mint, destination, closeAuthority, [], undefined, TEST_PROGRAM_ID)).to.be - .rejected; + expect( + closeAccount(connection, payer, mint, destination, closeAuthority, [], undefined, TEST_PROGRAM_ID), + ).to.be.rejectedWith(Error); }); it('works', async () => { destination = Keypair.generate().publicKey; const accountInfo = await connection.getAccountInfo(mint); let rentExemptAmount; - expect(accountInfo).to.not.be.null; + expect(accountInfo).to.not.equal(null); if (accountInfo !== null) { rentExemptAmount = accountInfo.lamports; } @@ -77,10 +78,10 @@ describe('closeMint', () => { await closeAccount(connection, payer, mint, destination, closeAuthority, [], undefined, TEST_PROGRAM_ID); const closedInfo = await connection.getAccountInfo(mint); - expect(closedInfo).to.be.null; + expect(closedInfo).to.equal(null); const destinationInfo = await connection.getAccountInfo(destination); - expect(destinationInfo).to.not.be.null; + expect(destinationInfo).to.not.equal(null); if (destinationInfo !== null) { expect(destinationInfo.lamports).to.eql(rentExemptAmount); } @@ -99,7 +100,7 @@ describe('closeMint', () => { ); const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const mintCloseAuthority = getMintCloseAuthority(mintInfo); - expect(mintCloseAuthority).to.not.be.null; + expect(mintCloseAuthority).to.not.equal(null); if (mintCloseAuthority !== null) { expect(mintCloseAuthority.closeAuthority).to.eql(PublicKey.default); } diff --git a/token/js/test/e2e-2022/cpiGuard.test.ts b/token/js/test/e2e-2022/cpiGuard.test.ts index 2de51093e9c..aee7aa0f24d 100644 --- a/token/js/test/e2e-2022/cpiGuard.test.ts +++ b/token/js/test/e2e-2022/cpiGuard.test.ts @@ -68,7 +68,7 @@ describe('cpiGuard', () => { let accountInfo = await getAccount(connection, account, undefined, TEST_PROGRAM_ID); let cpiGuard = getCpiGuard(accountInfo); - expect(cpiGuard).to.be.null; + expect(cpiGuard).to.equal(null); let transaction = new Transaction().add( createEnableCpiGuardInstruction(account, owner.publicKey, [], TEST_PROGRAM_ID), @@ -78,9 +78,9 @@ describe('cpiGuard', () => { accountInfo = await getAccount(connection, account, undefined, TEST_PROGRAM_ID); cpiGuard = getCpiGuard(accountInfo); - expect(cpiGuard).to.not.be.null; + expect(cpiGuard).to.not.equal(null); if (cpiGuard !== null) { - expect(cpiGuard.lockCpi).to.be.true; + expect(cpiGuard.lockCpi).to.equal(true); } transaction = new Transaction().add( @@ -91,9 +91,9 @@ describe('cpiGuard', () => { accountInfo = await getAccount(connection, account, undefined, TEST_PROGRAM_ID); cpiGuard = getCpiGuard(accountInfo); - expect(cpiGuard).to.not.be.null; + expect(cpiGuard).to.not.equal(null); if (cpiGuard !== null) { - expect(cpiGuard.lockCpi).to.be.false; + expect(cpiGuard.lockCpi).to.equal(false); } }); @@ -101,16 +101,16 @@ describe('cpiGuard', () => { let accountInfo = await getAccount(connection, account, undefined, TEST_PROGRAM_ID); let cpiGuard = getCpiGuard(accountInfo); - expect(cpiGuard).to.be.null; + expect(cpiGuard).to.equal(null); await enableCpiGuard(connection, payer, account, owner, [], undefined, TEST_PROGRAM_ID); accountInfo = await getAccount(connection, account, undefined, TEST_PROGRAM_ID); cpiGuard = getCpiGuard(accountInfo); - expect(cpiGuard).to.not.be.null; + expect(cpiGuard).to.not.equal(null); if (cpiGuard !== null) { - expect(cpiGuard.lockCpi).to.be.true; + expect(cpiGuard.lockCpi).to.equal(true); } await disableCpiGuard(connection, payer, account, owner, [], undefined, TEST_PROGRAM_ID); @@ -118,9 +118,9 @@ describe('cpiGuard', () => { accountInfo = await getAccount(connection, account, undefined, TEST_PROGRAM_ID); cpiGuard = getCpiGuard(accountInfo); - expect(cpiGuard).to.not.be.null; + expect(cpiGuard).to.not.equal(null); if (cpiGuard !== null) { - expect(cpiGuard.lockCpi).to.be.false; + expect(cpiGuard.lockCpi).to.equal(false); } }); }); diff --git a/token/js/test/e2e-2022/defaultAccountState.test.ts b/token/js/test/e2e-2022/defaultAccountState.test.ts index 8ce73e24e3f..898bb2e6a7c 100644 --- a/token/js/test/e2e-2022/defaultAccountState.test.ts +++ b/token/js/test/e2e-2022/defaultAccountState.test.ts @@ -59,7 +59,7 @@ describe('defaultAccountState', () => { it('defaults to frozen', async () => { const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const defaultAccountState = getDefaultAccountState(mintInfo); - expect(defaultAccountState).to.not.be.null; + expect(defaultAccountState).to.not.equal(null); if (defaultAccountState !== null) { expect(defaultAccountState.state).to.eql(TEST_STATE); } @@ -74,8 +74,8 @@ describe('defaultAccountState', () => { TEST_PROGRAM_ID, ); const accountInfo = await getAccount(connection, account, undefined, TEST_PROGRAM_ID); - expect(accountInfo.isFrozen).to.be.true; - expect(accountInfo.isInitialized).to.be.true; + expect(accountInfo.isFrozen).to.equal(true); + expect(accountInfo.isInitialized).to.equal(true); }); it('defaults to initialized after update', async () => { await updateDefaultAccountState( @@ -99,7 +99,7 @@ describe('defaultAccountState', () => { TEST_PROGRAM_ID, ); const accountInfo = await getAccount(connection, account, undefined, TEST_PROGRAM_ID); - expect(accountInfo.isFrozen).to.be.false; - expect(accountInfo.isInitialized).to.be.true; + expect(accountInfo.isFrozen).to.equal(false); + expect(accountInfo.isInitialized).to.equal(true); }); }); diff --git a/token/js/test/e2e-2022/immutableOwner.test.ts b/token/js/test/e2e-2022/immutableOwner.test.ts index cbec767fc18..43088a2e144 100644 --- a/token/js/test/e2e-2022/immutableOwner.test.ts +++ b/token/js/test/e2e-2022/immutableOwner.test.ts @@ -73,6 +73,6 @@ describe('immutableOwner', () => { undefined, TEST_PROGRAM_ID, ), - ).to.be.rejected; + ).to.be.rejectedWith(Error); }); }); diff --git a/token/js/test/e2e-2022/interestBearingMint.test.ts b/token/js/test/e2e-2022/interestBearingMint.test.ts index 341bb7a29c2..3561abe42d4 100644 --- a/token/js/test/e2e-2022/interestBearingMint.test.ts +++ b/token/js/test/e2e-2022/interestBearingMint.test.ts @@ -50,7 +50,7 @@ describe('interestBearingMint', () => { ); const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const interestBearingMintConfigState = getInterestBearingMintConfigState(mintInfo); - expect(interestBearingMintConfigState).to.not.be.null; + expect(interestBearingMintConfigState).to.not.equal(null); if (interestBearingMintConfigState !== null) { expect(interestBearingMintConfigState.rateAuthority).to.eql(rateAuthority.publicKey); expect(interestBearingMintConfigState.preUpdateAverageRate).to.eql(TEST_RATE); @@ -72,7 +72,7 @@ describe('interestBearingMint', () => { const mintInfoUpdatedRate = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const updatedRateConfigState = getInterestBearingMintConfigState(mintInfoUpdatedRate); - expect(updatedRateConfigState).to.not.be.null; + expect(updatedRateConfigState).to.not.equal(null); if (updatedRateConfigState !== null) { expect(updatedRateConfigState.rateAuthority).to.eql(rateAuthority.publicKey); expect(updatedRateConfigState.currentRate).to.eql(TEST_UPDATE_RATE); @@ -95,7 +95,7 @@ describe('interestBearingMint', () => { ); const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const rateConfigState = getInterestBearingMintConfigState(mintInfo); - expect(rateConfigState).to.not.be.null; + expect(rateConfigState).to.not.equal(null); if (rateConfigState !== null) { expect(rateConfigState.rateAuthority).to.eql(PublicKey.default); } diff --git a/token/js/test/e2e-2022/memoTransfer.test.ts b/token/js/test/e2e-2022/memoTransfer.test.ts index 4f5ca6976cb..e7200ebe36a 100644 --- a/token/js/test/e2e-2022/memoTransfer.test.ts +++ b/token/js/test/e2e-2022/memoTransfer.test.ts @@ -95,19 +95,21 @@ describe('memoTransfer', () => { it('fails without memo when enabled', async () => { const accountInfo = await getAccount(connection, destination, undefined, TEST_PROGRAM_ID); const memoTransfer = getMemoTransfer(accountInfo); - expect(memoTransfer).to.not.be.null; + expect(memoTransfer).to.not.equal(null); if (memoTransfer !== null) { - expect(memoTransfer.requireIncomingTransferMemos).to.be.true; + expect(memoTransfer.requireIncomingTransferMemos).to.equal(true); } - expect(transfer(connection, payer, source, destination, owner, TRANSFER_AMOUNT, [], undefined, TEST_PROGRAM_ID)) - .to.be.rejected; + expect( + transfer(connection, payer, source, destination, owner, TRANSFER_AMOUNT, [], undefined, TEST_PROGRAM_ID), + ).to.be.rejectedWith(Error); }); it('works without memo when disabled', async () => { await disableRequiredMemoTransfers(connection, payer, destination, owner, [], undefined, TEST_PROGRAM_ID); await transfer(connection, payer, source, destination, owner, TRANSFER_AMOUNT, [], undefined, TEST_PROGRAM_ID); await enableRequiredMemoTransfers(connection, payer, destination, owner, [], undefined, TEST_PROGRAM_ID); - expect(transfer(connection, payer, source, destination, owner, TRANSFER_AMOUNT, [], undefined, TEST_PROGRAM_ID)) - .to.be.rejected; + expect( + transfer(connection, payer, source, destination, owner, TRANSFER_AMOUNT, [], undefined, TEST_PROGRAM_ID), + ).to.be.rejectedWith(Error); }); it('works with memo when enabled', async () => { const transaction = new Transaction().add( diff --git a/token/js/test/e2e-2022/nonTransferableMint.test.ts b/token/js/test/e2e-2022/nonTransferableMint.test.ts index 37afa1d3533..1261b6cef29 100644 --- a/token/js/test/e2e-2022/nonTransferableMint.test.ts +++ b/token/js/test/e2e-2022/nonTransferableMint.test.ts @@ -54,7 +54,7 @@ describe('nonTransferable', () => { it('fails transfer', async () => { const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const nonTransferable = getNonTransferable(mintInfo); - expect(nonTransferable).to.not.be.null; + expect(nonTransferable).to.not.equal(null); const owner = Keypair.generate(); const accountLen = getAccountLen([ExtensionType.ImmutableOwner, ExtensionType.NonTransferableAccount]); @@ -93,7 +93,8 @@ describe('nonTransferable', () => { const amount = BigInt(1000); await mintTo(connection, payer, mint, source, mintAuthority, amount, [], undefined, TEST_PROGRAM_ID); - expect(transfer(connection, payer, source, destination, owner, amount, [], undefined, TEST_PROGRAM_ID)).to.be - .rejected; + expect( + transfer(connection, payer, source, destination, owner, amount, [], undefined, TEST_PROGRAM_ID), + ).to.be.rejectedWith(Error); }); }); diff --git a/token/js/test/e2e-2022/permanentDelegate.test.ts b/token/js/test/e2e-2022/permanentDelegate.test.ts index 0d454fdb337..29e69cd3a55 100644 --- a/token/js/test/e2e-2022/permanentDelegate.test.ts +++ b/token/js/test/e2e-2022/permanentDelegate.test.ts @@ -59,7 +59,7 @@ describe('permanentDelegate', () => { await mintTo(connection, payer, mint, account, mintAuthority, 5, [], undefined, TEST_PROGRAM_ID); await burn(connection, payer, account, mint, permanentDelegate, 2, undefined, undefined, TEST_PROGRAM_ID); const info = await connection.getTokenAccountBalance(account); - expect(info).to.not.be.null; + expect(info).to.not.equal(null); if (info !== null) { expect(info.value.uiAmount).to.eql(3); } @@ -93,8 +93,8 @@ describe('permanentDelegate', () => { ); const source_info = await connection.getTokenAccountBalance(account); const destination_info = await connection.getTokenAccountBalance(destination); - expect(source_info).to.not.be.null; - expect(destination_info).to.not.be.null; + expect(source_info).to.not.equal(null); + expect(destination_info).to.not.equal(null); if (source_info !== null) { expect(source_info.value.uiAmount).to.eql(3); } @@ -116,7 +116,7 @@ describe('permanentDelegate', () => { ); const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const permanentDelegateConfig = getPermanentDelegate(mintInfo); - expect(permanentDelegateConfig).to.not.be.null; + expect(permanentDelegateConfig).to.not.equal(null); if (permanentDelegateConfig !== null) { expect(permanentDelegateConfig.delegate).to.eql(PublicKey.default); } diff --git a/token/js/test/e2e-2022/reallocate.test.ts b/token/js/test/e2e-2022/reallocate.test.ts index 891fffb5937..399b917f2ea 100644 --- a/token/js/test/e2e-2022/reallocate.test.ts +++ b/token/js/test/e2e-2022/reallocate.test.ts @@ -46,7 +46,7 @@ describe('reallocate', () => { ); await sendAndConfirmTransaction(connection, transaction, [payer, owner], undefined); const info = await connection.getAccountInfo(account); - expect(info).to.not.be.null; + expect(info).to.not.equal(null); if (info !== null) { const expectedAccountLen = getAccountLen(EXTENSIONS); expect(info.data.length).to.eql(expectedAccountLen); diff --git a/token/js/test/e2e-2022/tlv.test.ts b/token/js/test/e2e-2022/tlv.test.ts index 98071093d37..b75c30ed821 100644 --- a/token/js/test/e2e-2022/tlv.test.ts +++ b/token/js/test/e2e-2022/tlv.test.ts @@ -31,7 +31,7 @@ describe('tlv test', () => { }); // test that the parser gracefully handles accounts with arbitrary extra bytes - it('parse account with extra bytes', async () => { + it('parses account with extra bytes', async () => { const initTestAccount = async (extraBytes: number) => { const mintKeypair = Keypair.generate(); const accountKeypair = Keypair.generate(); @@ -81,7 +81,7 @@ describe('tlv test', () => { getExtensionData(extension, accountInfo.tlvData), `account parse test failed: found ${ExtensionType[extension]}, but should not have. \ test case: no extensions, ${i} extra bytes`, - ).to.be.null; + ).to.equal(null); } return Promise.resolve(undefined); }), diff --git a/token/js/test/e2e-2022/transferFee.test.ts b/token/js/test/e2e-2022/transferFee.test.ts index d98ebd8d6f6..edea4158385 100644 --- a/token/js/test/e2e-2022/transferFee.test.ts +++ b/token/js/test/e2e-2022/transferFee.test.ts @@ -137,7 +137,7 @@ describe('transferFee', () => { it('initializes', async () => { const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const transferFeeConfig = getTransferFeeConfig(mintInfo); - expect(transferFeeConfig).to.not.be.null; + expect(transferFeeConfig).to.not.equal(null); if (transferFeeConfig !== null) { expect(transferFeeConfig.transferFeeConfigAuthority).to.eql(transferFeeConfigAuthority.publicKey); expect(transferFeeConfig.withdrawWithheldAuthority).to.eql(withdrawWithheldAuthority.publicKey); @@ -150,7 +150,7 @@ describe('transferFee', () => { const accountInfo = await getAccount(connection, destinationAccount, undefined, TEST_PROGRAM_ID); const transferFeeAmount = getTransferFeeAmount(accountInfo); - expect(transferFeeAmount).to.not.be.null; + expect(transferFeeAmount).to.not.equal(null); if (transferFeeAmount !== null) { expect(transferFeeAmount.withheldAmount).to.eql(FEE); } @@ -172,7 +172,7 @@ describe('transferFee', () => { ); const accountInfo = await getAccount(connection, destinationAccount, undefined, TEST_PROGRAM_ID); const transferFeeAmount = getTransferFeeAmount(accountInfo); - expect(transferFeeAmount).to.not.be.null; + expect(transferFeeAmount).to.not.equal(null); if (transferFeeAmount !== null) { expect(transferFeeAmount.withheldAmount).to.eql(FEE * BigInt(2)); } @@ -192,7 +192,7 @@ describe('transferFee', () => { const accountInfo = await getAccount(connection, destinationAccount, undefined, TEST_PROGRAM_ID); expect(accountInfo.amount).to.eql(TRANSFER_AMOUNT); const transferFeeAmount = getTransferFeeAmount(accountInfo); - expect(transferFeeAmount).to.not.be.null; + expect(transferFeeAmount).to.not.equal(null); if (transferFeeAmount !== null) { expect(transferFeeAmount.withheldAmount).to.eql(BigInt(0)); } @@ -208,13 +208,13 @@ describe('transferFee', () => { ); const accountInfo = await getAccount(connection, destinationAccount, undefined, TEST_PROGRAM_ID); const transferFeeAmount = getTransferFeeAmount(accountInfo); - expect(transferFeeAmount).to.not.be.null; + expect(transferFeeAmount).to.not.equal(null); if (transferFeeAmount !== null) { expect(transferFeeAmount.withheldAmount).to.eql(BigInt(0)); } const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const transferFeeConfig = getTransferFeeConfig(mintInfo); - expect(transferFeeConfig).to.not.be.null; + expect(transferFeeConfig).to.not.equal(null); if (transferFeeConfig !== null) { expect(transferFeeConfig.withheldAmount).to.eql(FEE); } @@ -241,13 +241,13 @@ describe('transferFee', () => { const accountInfo = await getAccount(connection, destinationAccount, undefined, TEST_PROGRAM_ID); expect(accountInfo.amount).to.eql(TRANSFER_AMOUNT); const transferFeeAmount = getTransferFeeAmount(accountInfo); - expect(transferFeeAmount).to.not.be.null; + expect(transferFeeAmount).to.not.equal(null); if (transferFeeAmount !== null) { expect(transferFeeAmount.withheldAmount).to.eql(BigInt(0)); } const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const transferFeeConfig = getTransferFeeConfig(mintInfo); - expect(transferFeeConfig).to.not.be.null; + expect(transferFeeConfig).to.not.equal(null); if (transferFeeConfig !== null) { expect(transferFeeConfig.withheldAmount).to.eql(BigInt(0)); } @@ -266,7 +266,7 @@ describe('transferFee', () => { ); const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const transferFeeConfig = getTransferFeeConfig(mintInfo); - expect(transferFeeConfig).to.not.be.null; + expect(transferFeeConfig).to.not.equal(null); if (transferFeeConfig !== null) { expect(transferFeeConfig.transferFeeConfigAuthority).to.eql(PublicKey.default); } @@ -285,7 +285,7 @@ describe('transferFee', () => { ); const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const transferFeeConfig = getTransferFeeConfig(mintInfo); - expect(transferFeeConfig).to.not.be.null; + expect(transferFeeConfig).to.not.equal(null); if (transferFeeConfig !== null) { expect(transferFeeConfig.withdrawWithheldAuthority).to.eql(PublicKey.default); } @@ -307,7 +307,7 @@ describe('transferFee', () => { ); const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const transferFeeConfig = getTransferFeeConfig(mintInfo); - expect(transferFeeConfig).to.not.be.null; + expect(transferFeeConfig).to.not.equal(null); if (transferFeeConfig !== null) { expect(transferFeeConfig.transferFeeConfigAuthority).to.eql(transferFeeConfigAuthority.publicKey); expect(transferFeeConfig.olderTransferFee.transferFeeBasisPoints).to.eql(FEE_BASIS_POINTS); @@ -325,7 +325,7 @@ describe('transferFee', () => { const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const transferFeeConfig = getTransferFeeConfig(mintInfo); - expect(transferFeeConfig).to.not.be.null; + expect(transferFeeConfig).to.not.equal(null); if (transferFeeConfig !== null) { expect(transferFeeConfig.transferFeeConfigAuthority).to.eql(PublicKey.default); expect(transferFeeConfig.withdrawWithheldAuthority).to.eql(withdrawWithheldAuthority.publicKey); @@ -342,7 +342,7 @@ describe('transferFee', () => { const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const transferFeeConfig = getTransferFeeConfig(mintInfo); - expect(transferFeeConfig).to.not.be.null; + expect(transferFeeConfig).to.not.equal(null); if (transferFeeConfig !== null) { expect(transferFeeConfig.transferFeeConfigAuthority).to.eql(transferFeeConfigAuthority.publicKey); expect(transferFeeConfig.withdrawWithheldAuthority).to.eql(PublicKey.default); @@ -358,7 +358,7 @@ describe('transferFee', () => { const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const transferFeeConfig = getTransferFeeConfig(mintInfo); - expect(transferFeeConfig).to.not.be.null; + expect(transferFeeConfig).to.not.equal(null); if (transferFeeConfig !== null) { expect(transferFeeConfig.transferFeeConfigAuthority).to.eql(PublicKey.default); expect(transferFeeConfig.withdrawWithheldAuthority).to.eql(PublicKey.default); diff --git a/token/js/test/e2e-2022/transferHook.test.ts b/token/js/test/e2e-2022/transferHook.test.ts index 209dcb78b77..12256286163 100644 --- a/token/js/test/e2e-2022/transferHook.test.ts +++ b/token/js/test/e2e-2022/transferHook.test.ts @@ -84,7 +84,7 @@ describe('transferHook', () => { it('is initialized', async () => { const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const transferHook = getTransferHook(mintInfo); - expect(transferHook).to.not.be.null; + expect(transferHook).to.not.equal(null); if (transferHook !== null) { expect(transferHook.authority).to.eql(transferHookAuthority.publicKey); expect(transferHook.programId).to.eql(TRANSFER_HOOK_TEST_PROGRAM_ID); @@ -104,7 +104,7 @@ describe('transferHook', () => { ); const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const transferHook = getTransferHook(mintInfo); - expect(transferHook).to.not.be.null; + expect(transferHook).to.not.equal(null); if (transferHook !== null) { expect(transferHook.authority).to.eql(transferHookAuthority.publicKey); expect(transferHook.programId).to.eql(newTransferHookProgramId); @@ -124,7 +124,7 @@ describe('transferHook', () => { ); const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); const transferHook = getTransferHook(mintInfo); - expect(transferHook).to.not.be.null; + expect(transferHook).to.not.equal(null); if (transferHook !== null) { expect(transferHook.authority).to.eql(PublicKey.default); } diff --git a/token/js/test/e2e/close.test.ts b/token/js/test/e2e/close.test.ts index 9acfe7a0306..deb2dde7667 100644 --- a/token/js/test/e2e/close.test.ts +++ b/token/js/test/e2e/close.test.ts @@ -41,13 +41,14 @@ describe('close', () => { it('failsWithNonZeroAmount', async () => { const amount = BigInt(1000); await mintTo(connection, payer, mint, account, mintAuthority, amount, [], undefined, TEST_PROGRAM_ID); - expect(closeAccount(connection, payer, account, destination, owner, [], undefined, TEST_PROGRAM_ID)).to.be - .rejected; + expect( + closeAccount(connection, payer, account, destination, owner, [], undefined, TEST_PROGRAM_ID), + ).to.be.rejectedWith(Error); }); it('works', async () => { const accountInfo = await connection.getAccountInfo(account); let tokenRentExemptAmount; - expect(accountInfo).to.not.be.null; + expect(accountInfo).to.not.equal(null); if (accountInfo !== null) { tokenRentExemptAmount = accountInfo.lamports; } @@ -55,10 +56,10 @@ describe('close', () => { await closeAccount(connection, payer, account, destination, owner, [], undefined, TEST_PROGRAM_ID); const closedInfo = await connection.getAccountInfo(account); - expect(closedInfo).to.be.null; + expect(closedInfo).to.equal(null); const destinationInfo = await connection.getAccountInfo(destination); - expect(destinationInfo).to.not.be.null; + expect(destinationInfo).to.not.equal(null); if (destinationInfo !== null) { expect(destinationInfo.lamports).to.eql(tokenRentExemptAmount); } diff --git a/token/js/test/e2e/create.test.ts b/token/js/test/e2e/create.test.ts index 578d84bc76a..570f38a51f3 100644 --- a/token/js/test/e2e/create.test.ts +++ b/token/js/test/e2e/create.test.ts @@ -40,7 +40,7 @@ describe('createMint', () => { expect(mintInfo.mintAuthority).to.eql(testMintAuthority.publicKey); expect(mintInfo.supply).to.eql(BigInt(0)); expect(mintInfo.decimals).to.eql(TEST_TOKEN_DECIMALS); - expect(mintInfo.isInitialized).to.be.true; + expect(mintInfo.isInitialized).to.equal(true); expect(mintInfo.freezeAuthority).to.eql(testMintAuthority.publicKey); }); }); @@ -64,147 +64,147 @@ describe('createAccount', () => { undefined, TEST_PROGRAM_ID, ); - }), - it('auxiliary token account', async () => { - const owner = Keypair.generate(); - const account = await createAccount( - connection, - payer, - mint, - owner.publicKey, - Keypair.generate(), - undefined, - TEST_PROGRAM_ID, - ); - const accountInfo = await getAccount(connection, account, undefined, TEST_PROGRAM_ID); - expect(accountInfo.mint).to.eql(mint); - expect(accountInfo.owner).to.eql(owner.publicKey); - expect(accountInfo.amount).to.eql(BigInt(0)); - expect(accountInfo.delegate).to.be.null; - expect(accountInfo.delegatedAmount).to.eql(BigInt(0)); - expect(accountInfo.isInitialized).to.be.true; - expect(accountInfo.isFrozen).to.be.false; - expect(accountInfo.isNative).to.be.false; - expect(accountInfo.rentExemptReserve).to.be.null; - expect(accountInfo.closeAuthority).to.be.null; - - // you can create as many accounts as with same owner - const account2 = await createAccount( - connection, - payer, - mint, - owner.publicKey, - Keypair.generate(), - undefined, - TEST_PROGRAM_ID, - ); - expect(account2).to.not.eql(account); - }), - it('creates associated token account if it does not exist', async () => { - const owner = Keypair.generate(); - const associatedAddress = await getAssociatedTokenAddress( - mint, - owner.publicKey, - false, - TEST_PROGRAM_ID, - ASSOCIATED_TOKEN_PROGRAM_ID, - ); + }); + it('auxiliary token account', async () => { + const owner = Keypair.generate(); + const account = await createAccount( + connection, + payer, + mint, + owner.publicKey, + Keypair.generate(), + undefined, + TEST_PROGRAM_ID, + ); + const accountInfo = await getAccount(connection, account, undefined, TEST_PROGRAM_ID); + expect(accountInfo.mint).to.eql(mint); + expect(accountInfo.owner).to.eql(owner.publicKey); + expect(accountInfo.amount).to.eql(BigInt(0)); + expect(accountInfo.delegate).to.equal(null); + expect(accountInfo.delegatedAmount).to.eql(BigInt(0)); + expect(accountInfo.isInitialized).to.equal(true); + expect(accountInfo.isFrozen).to.equal(false); + expect(accountInfo.isNative).to.equal(false); + expect(accountInfo.rentExemptReserve).to.equal(null); + expect(accountInfo.closeAuthority).to.equal(null); + + // you can create as many accounts as with same owner + const account2 = await createAccount( + connection, + payer, + mint, + owner.publicKey, + Keypair.generate(), + undefined, + TEST_PROGRAM_ID, + ); + expect(account2).to.not.eql(account); + }); + it('creates associated token account if it does not exist', async () => { + const owner = Keypair.generate(); + const associatedAddress = await getAssociatedTokenAddress( + mint, + owner.publicKey, + false, + TEST_PROGRAM_ID, + ASSOCIATED_TOKEN_PROGRAM_ID, + ); - // associated account shouldn't exist - const info = await connection.getAccountInfo(associatedAddress); - expect(info).to.be.null; + // associated account shouldn't exist + const info = await connection.getAccountInfo(associatedAddress); + expect(info).to.equal(null); - const createdAccountInfo = await getOrCreateAssociatedTokenAccount( - connection, - payer, - mint, - owner.publicKey, - false, - undefined, - undefined, - TEST_PROGRAM_ID, - ASSOCIATED_TOKEN_PROGRAM_ID, - ); - expect(createdAccountInfo.mint).to.eql(mint); - expect(createdAccountInfo.owner).to.eql(owner.publicKey); - expect(createdAccountInfo.amount).to.eql(BigInt(0)); - expect(createdAccountInfo.delegate).to.be.null; - expect(createdAccountInfo.delegatedAmount).to.eql(BigInt(0)); - expect(createdAccountInfo.isInitialized).to.be.true; - expect(createdAccountInfo.isFrozen).to.be.false; - expect(createdAccountInfo.isNative).to.be.false; - expect(createdAccountInfo.rentExemptReserve).to.be.null; - expect(createdAccountInfo.closeAuthority).to.be.null; - - // do it again, just gives the account info - const accountInfo = await getOrCreateAssociatedTokenAccount( + const createdAccountInfo = await getOrCreateAssociatedTokenAccount( + connection, + payer, + mint, + owner.publicKey, + false, + undefined, + undefined, + TEST_PROGRAM_ID, + ASSOCIATED_TOKEN_PROGRAM_ID, + ); + expect(createdAccountInfo.mint).to.eql(mint); + expect(createdAccountInfo.owner).to.eql(owner.publicKey); + expect(createdAccountInfo.amount).to.eql(BigInt(0)); + expect(createdAccountInfo.delegate).to.equal(null); + expect(createdAccountInfo.delegatedAmount).to.eql(BigInt(0)); + expect(createdAccountInfo.isInitialized).to.equal(true); + expect(createdAccountInfo.isFrozen).to.equal(false); + expect(createdAccountInfo.isNative).to.equal(false); + expect(createdAccountInfo.rentExemptReserve).to.equal(null); + expect(createdAccountInfo.closeAuthority).to.equal(null); + + // do it again, just gives the account info + const accountInfo = await getOrCreateAssociatedTokenAccount( + connection, + payer, + mint, + owner.publicKey, + false, + undefined, + undefined, + TEST_PROGRAM_ID, + ASSOCIATED_TOKEN_PROGRAM_ID, + ); + + expect(createdAccountInfo).to.eql(accountInfo); + }); + it('associated token account', async () => { + const owner = Keypair.generate(); + const associatedAddress = await getAssociatedTokenAddress( + mint, + owner.publicKey, + false, + TEST_PROGRAM_ID, + ASSOCIATED_TOKEN_PROGRAM_ID, + ); + + // associated account shouldn't exist + const info = await connection.getAccountInfo(associatedAddress); + expect(info).to.equal(null); + + const createdAddress = await createAccount( + connection, + payer, + mint, + owner.publicKey, + undefined, // uses ATA by default + undefined, + TEST_PROGRAM_ID, + ); + expect(createdAddress).to.eql(associatedAddress); + + const accountInfo = await getAccount(connection, associatedAddress, undefined, TEST_PROGRAM_ID); + expect(accountInfo).to.not.equal(null); + expect(accountInfo.mint).to.eql(mint); + expect(accountInfo.owner).to.eql(owner.publicKey); + expect(accountInfo.amount).to.eql(BigInt(0)); + + // creating again should cause TX error for the associated token account + expect( + createAccount( connection, payer, mint, owner.publicKey, - false, - undefined, + undefined, // uses ATA by default undefined, TEST_PROGRAM_ID, - ASSOCIATED_TOKEN_PROGRAM_ID, - ); - - expect(createdAccountInfo).to.eql(accountInfo); - }), - it('associated token account', async () => { - const owner = Keypair.generate(); - const associatedAddress = await getAssociatedTokenAddress( - mint, - owner.publicKey, - false, - TEST_PROGRAM_ID, - ASSOCIATED_TOKEN_PROGRAM_ID, - ); - - // associated account shouldn't exist - const info = await connection.getAccountInfo(associatedAddress); - expect(info).to.be.null; + ), + ).to.be.rejectedWith(Error); - const createdAddress = await createAccount( + // when creating again but with idempotent mode, TX should not throw error + return expect( + createAssociatedTokenAccountIdempotent( connection, payer, mint, owner.publicKey, - undefined, // uses ATA by default undefined, TEST_PROGRAM_ID, - ); - expect(createdAddress).to.eql(associatedAddress); - - const accountInfo = await getAccount(connection, associatedAddress, undefined, TEST_PROGRAM_ID); - expect(accountInfo).to.not.be.null; - expect(accountInfo.mint).to.eql(mint); - expect(accountInfo.owner).to.eql(owner.publicKey); - expect(accountInfo.amount).to.eql(BigInt(0)); - - // creating again should cause TX error for the associated token account - expect( - createAccount( - connection, - payer, - mint, - owner.publicKey, - undefined, // uses ATA by default - undefined, - TEST_PROGRAM_ID, - ), - ).to.be.rejected; - - // when creating again but with idempotent mode, TX should not throw error - return expect( - createAssociatedTokenAccountIdempotent( - connection, - payer, - mint, - owner.publicKey, - undefined, - TEST_PROGRAM_ID, - ), - ).to.be.fulfilled; - }); + ), + ).to.be.fulfilled; + }); }); diff --git a/token/js/test/e2e/freeze.test.ts b/token/js/test/e2e/freeze.test.ts index 9e5cbb141fd..b013edf1642 100644 --- a/token/js/test/e2e/freeze.test.ts +++ b/token/js/test/e2e/freeze.test.ts @@ -44,8 +44,9 @@ describe('freezeThaw', () => { it('freezes', async () => { await freezeAccount(connection, payer, account, mint, freezeAuthority, [], undefined, TEST_PROGRAM_ID); - expect(burn(connection, payer, account, mint, owner, burnAmount, [], undefined, TEST_PROGRAM_ID)).to.be - .rejected; + expect( + burn(connection, payer, account, mint, owner, burnAmount, [], undefined, TEST_PROGRAM_ID), + ).to.be.rejectedWith(Error); }); it('thaws', async () => { await freezeAccount(connection, payer, account, mint, freezeAuthority, [], undefined, TEST_PROGRAM_ID); diff --git a/token/js/test/e2e/initialize.test.ts b/token/js/test/e2e/initialize.test.ts index 891edaa9514..ae635120adf 100644 --- a/token/js/test/e2e/initialize.test.ts +++ b/token/js/test/e2e/initialize.test.ts @@ -47,7 +47,7 @@ describe('initialize mint', () => { expect(mintInfo.mintAuthority).to.eql(mintAuthority); expect(mintInfo.supply).to.eql(BigInt(0)); expect(mintInfo.decimals).to.eql(TEST_TOKEN_DECIMALS); - expect(mintInfo.isInitialized).to.be.true; + expect(mintInfo.isInitialized).to.equal(true); expect(mintInfo.freezeAuthority).to.eql(freezeAuthority); }); it('works with null freeze authority', async () => { @@ -73,8 +73,8 @@ describe('initialize mint', () => { expect(mintInfo.mintAuthority).to.eql(mintAuthority); expect(mintInfo.supply).to.eql(BigInt(0)); expect(mintInfo.decimals).to.eql(TEST_TOKEN_DECIMALS); - expect(mintInfo.isInitialized).to.be.true; - expect(mintInfo.freezeAuthority).to.be.null; + expect(mintInfo.isInitialized).to.equal(true); + expect(mintInfo.freezeAuthority).to.equal(null); }); }); describe('initialize mint 2', () => { @@ -112,7 +112,7 @@ describe('initialize mint 2', () => { expect(mintInfo.mintAuthority).to.eql(mintAuthority); expect(mintInfo.supply).to.eql(BigInt(0)); expect(mintInfo.decimals).to.eql(TEST_TOKEN_DECIMALS); - expect(mintInfo.isInitialized).to.be.true; + expect(mintInfo.isInitialized).to.equal(true); expect(mintInfo.freezeAuthority).to.eql(freezeAuthority); }); it('works with null freeze authority', async () => { @@ -138,7 +138,7 @@ describe('initialize mint 2', () => { expect(mintInfo.mintAuthority).to.eql(mintAuthority); expect(mintInfo.supply).to.eql(BigInt(0)); expect(mintInfo.decimals).to.eql(TEST_TOKEN_DECIMALS); - expect(mintInfo.isInitialized).to.be.true; - expect(mintInfo.freezeAuthority).to.be.null; + expect(mintInfo.isInitialized).to.equal(true); + expect(mintInfo.freezeAuthority).to.equal(null); }); }); diff --git a/token/js/test/e2e/mint.test.ts b/token/js/test/e2e/mint.test.ts index 73952c2cb78..2dfe0cb0623 100644 --- a/token/js/test/e2e/mint.test.ts +++ b/token/js/test/e2e/mint.test.ts @@ -61,6 +61,6 @@ describe('mint', () => { expect( mintToChecked(connection, payer, mint, account, mintAuthority, amount, 1, [], undefined, TEST_PROGRAM_ID), - ).to.be.rejected; + ).to.be.rejectedWith(Error); }); }); diff --git a/token/js/test/e2e/native.test.ts b/token/js/test/e2e/native.test.ts index 47cb3390ee0..6eb32350974 100644 --- a/token/js/test/e2e/native.test.ts +++ b/token/js/test/e2e/native.test.ts @@ -46,13 +46,13 @@ describe('native', () => { }); it('works', async () => { const accountInfo = await getAccount(connection, account, undefined, TEST_PROGRAM_ID); - expect(accountInfo.isNative).to.be.true; + expect(accountInfo.isNative).to.equal(true); expect(accountInfo.amount).to.eql(BigInt(amount)); }); it('syncNative', async () => { let balance = 0; const preInfo = await connection.getAccountInfo(account); - expect(preInfo).to.not.be.null; + expect(preInfo).to.not.equal(null); if (preInfo != null) { balance = preInfo.lamports; } @@ -73,12 +73,12 @@ describe('native', () => { // no change in the amount const preAccountInfo = await getAccount(connection, account, undefined, TEST_PROGRAM_ID); - expect(preAccountInfo.isNative).to.be.true; + expect(preAccountInfo.isNative).to.equal(true); expect(preAccountInfo.amount).to.eql(BigInt(amount)); // but change in lamports const postInfo = await connection.getAccountInfo(account); - expect(postInfo).to.not.be.null; + expect(postInfo).to.not.equal(null); if (postInfo !== null) { expect(postInfo.lamports).to.eql(balance + additionalLamports); } @@ -86,22 +86,22 @@ describe('native', () => { // sync, amount changes await syncNative(connection, payer, account, undefined, TEST_PROGRAM_ID); const postAccountInfo = await getAccount(connection, account, undefined, TEST_PROGRAM_ID); - expect(postAccountInfo.isNative).to.be.true; + expect(postAccountInfo.isNative).to.equal(true); expect(postAccountInfo.amount).to.eql(BigInt(amount + additionalLamports)); }); it('closeAccount', async () => { let balance = 0; const preInfo = await connection.getAccountInfo(account); - expect(preInfo).to.not.be.null; + expect(preInfo).to.not.equal(null); if (preInfo != null) { balance = preInfo.lamports; } const destination = Keypair.generate().publicKey; await closeAccount(connection, payer, account, destination, owner, [], undefined, TEST_PROGRAM_ID); const nullInfo = await connection.getAccountInfo(account); - expect(nullInfo).to.be.null; + expect(nullInfo).to.equal(null); const destinationInfo = await connection.getAccountInfo(destination); - expect(destinationInfo).to.not.be.null; + expect(destinationInfo).to.not.equal(null); if (destinationInfo != null) { expect(destinationInfo.lamports).to.eql(balance); } diff --git a/token/js/test/e2e/recoverNested.test.ts b/token/js/test/e2e/recoverNested.test.ts index 4de0f95c19f..fc11e8dcc99 100644 --- a/token/js/test/e2e/recoverNested.test.ts +++ b/token/js/test/e2e/recoverNested.test.ts @@ -97,26 +97,26 @@ describe('recoverNested', () => { undefined, TEST_PROGRAM_ID, ); - }), - it('success', async () => { - // create destination associated token - const destinationAssociatedToken = await createAssociatedTokenAccount( - connection, - payer, - nestedMint, - owner.publicKey, - undefined, - TEST_PROGRAM_ID, - ); + }); + it('success', async () => { + // create destination associated token + const destinationAssociatedToken = await createAssociatedTokenAccount( + connection, + payer, + nestedMint, + owner.publicKey, + undefined, + TEST_PROGRAM_ID, + ); - await recoverNested(connection, payer, owner, mint, nestedMint, undefined, TEST_PROGRAM_ID); + await recoverNested(connection, payer, owner, mint, nestedMint, undefined, TEST_PROGRAM_ID); - expect(await connection.getAccountInfo(nestedAssociatedToken)).to.be.null; + expect(await connection.getAccountInfo(nestedAssociatedToken)).to.equal(null); - const accountInfo = await getAccount(connection, destinationAssociatedToken, undefined, TEST_PROGRAM_ID); - expect(accountInfo).to.not.be.null; - expect(accountInfo.mint).to.eql(nestedMint); - expect(accountInfo.owner).to.eql(owner.publicKey); - expect(accountInfo.amount).to.eql(BigInt(nestedMintAmount)); - }); + const accountInfo = await getAccount(connection, destinationAssociatedToken, undefined, TEST_PROGRAM_ID); + expect(accountInfo).to.not.equal(null); + expect(accountInfo.mint).to.eql(nestedMint); + expect(accountInfo.owner).to.eql(owner.publicKey); + expect(accountInfo.amount).to.eql(BigInt(nestedMintAmount)); + }); }); diff --git a/token/js/test/e2e/setAuthority.test.ts b/token/js/test/e2e/setAuthority.test.ts index 839f04bd029..cc17bcfd9e7 100644 --- a/token/js/test/e2e/setAuthority.test.ts +++ b/token/js/test/e2e/setAuthority.test.ts @@ -84,7 +84,7 @@ describe('setAuthority', () => { undefined, TEST_PROGRAM_ID, ), - ).to.be.rejected; + ).to.be.rejectedWith(Error); }); it('MintAuthority', async () => { await setAuthority( @@ -99,7 +99,7 @@ describe('setAuthority', () => { TEST_PROGRAM_ID, ); const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); - expect(mintInfo.mintAuthority).to.be.null; + expect(mintInfo.mintAuthority).to.equal(null); }); it('CloseAuthority', async () => { const closeAuthority = Keypair.generate(); @@ -130,6 +130,6 @@ describe('setAuthority', () => { TEST_PROGRAM_ID, ); const mintInfo = await getMint(connection, mint, undefined, TEST_PROGRAM_ID); - expect(mintInfo.freezeAuthority).to.be.null; + expect(mintInfo.freezeAuthority).to.equal(null); }); }); diff --git a/token/js/test/e2e/transfer.test.ts b/token/js/test/e2e/transfer.test.ts index 008f389bb73..019b0ff9fd8 100644 --- a/token/js/test/e2e/transfer.test.ts +++ b/token/js/test/e2e/transfer.test.ts @@ -113,7 +113,7 @@ describe('transfer', () => { undefined, TEST_PROGRAM_ID, ), - ).to.be.rejected; + ).to.be.rejectedWith(Error); }); it('approveRevoke', async () => { const delegate = Keypair.generate(); @@ -135,7 +135,7 @@ describe('transfer', () => { await revoke(connection, payer, account1, owner1, [], undefined, TEST_PROGRAM_ID); const revokedAccountInfo = await getAccount(connection, account1, undefined, TEST_PROGRAM_ID); expect(revokedAccountInfo.delegatedAmount).to.eql(BigInt(0)); - expect(revokedAccountInfo.delegate).to.be.null; + expect(revokedAccountInfo.delegate).to.equal(null); }); it('delegateTransfer', async () => { const delegate = Keypair.generate(); @@ -158,7 +158,8 @@ describe('transfer', () => { const accountInfo = await getAccount(connection, account1, undefined, TEST_PROGRAM_ID); expect(accountInfo.delegatedAmount).to.eql(delegatedAmount - transferAmount); expect(accountInfo.delegate).to.eql(delegate.publicKey); - expect(transfer(connection, payer, account1, account2, delegate, BigInt(2), [], undefined, TEST_PROGRAM_ID)).to - .be.rejected; + expect( + transfer(connection, payer, account1, account2, delegate, BigInt(2), [], undefined, TEST_PROGRAM_ID), + ).to.be.rejectedWith(Error); }); }); diff --git a/token/js/test/unit/transferHook.test.ts b/token/js/test/unit/transferHook.test.ts index 3c871ebbefc..56ed5e96821 100644 --- a/token/js/test/unit/transferHook.test.ts +++ b/token/js/test/unit/transferHook.test.ts @@ -134,7 +134,7 @@ describe('transferHook', () => { lamports: 0, }; const parsedExtraAccounts = getExtraAccountMetas(accountInfo); - expect(parsedExtraAccounts).to.not.be.null; + expect(parsedExtraAccounts).to.not.equal(null); if (parsedExtraAccounts == null) { return; } @@ -146,18 +146,18 @@ describe('transferHook', () => { expect(parsedExtraAccounts[0].discriminator).to.eql(0); expect(parsedExtraAccounts[0].addressConfig).to.eql(plainAccount.toBuffer()); - expect(parsedExtraAccounts[0].isSigner).to.be.false; - expect(parsedExtraAccounts[0].isWritable).to.be.false; + expect(parsedExtraAccounts[0].isSigner).to.equal(false); + expect(parsedExtraAccounts[0].isWritable).to.equal(false); expect(parsedExtraAccounts[1].discriminator).to.eql(1); expect(parsedExtraAccounts[1].addressConfig).to.eql(addressConfig); - expect(parsedExtraAccounts[1].isSigner).to.be.true; - expect(parsedExtraAccounts[1].isWritable).to.be.false; + expect(parsedExtraAccounts[1].isSigner).to.equal(true); + expect(parsedExtraAccounts[1].isWritable).to.equal(false); expect(parsedExtraAccounts[2].discriminator).to.eql(128); expect(parsedExtraAccounts[2].addressConfig).to.eql(addressConfig); - expect(parsedExtraAccounts[2].isSigner).to.be.false; - expect(parsedExtraAccounts[2].isWritable).to.be.true; + expect(parsedExtraAccounts[2].isSigner).to.equal(false); + expect(parsedExtraAccounts[2].isWritable).to.equal(true); }); it('can resolve extra metas', async () => { @@ -170,8 +170,8 @@ describe('transferHook', () => { ); expect(resolvedPlainAccount.pubkey).to.eql(plainAccount); - expect(resolvedPlainAccount.isSigner).to.be.false; - expect(resolvedPlainAccount.isWritable).to.be.false; + expect(resolvedPlainAccount.isSigner).to.equal(false); + expect(resolvedPlainAccount.isWritable).to.equal(false); const resolvedPdaAccount = await resolveExtraAccountMeta( connection, @@ -182,8 +182,8 @@ describe('transferHook', () => { ); expect(resolvedPdaAccount.pubkey).to.eql(pdaPublicKey); - expect(resolvedPdaAccount.isSigner).to.be.true; - expect(resolvedPdaAccount.isWritable).to.be.false; + expect(resolvedPdaAccount.isSigner).to.equal(true); + expect(resolvedPdaAccount.isWritable).to.equal(false); const resolvedPdaAccountWithProgramId = await resolveExtraAccountMeta( connection, @@ -194,8 +194,8 @@ describe('transferHook', () => { ); expect(resolvedPdaAccountWithProgramId.pubkey).to.eql(pdaPublicKeyWithProgramId); - expect(resolvedPdaAccountWithProgramId.isSigner).to.be.false; - expect(resolvedPdaAccountWithProgramId.isWritable).to.be.true; + expect(resolvedPdaAccountWithProgramId.isSigner).to.equal(false); + expect(resolvedPdaAccountWithProgramId.isWritable).to.equal(true); }); });