diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 21c48a0..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,23 +0,0 @@ -/* eslint-env node */ -module.exports = { - parserOptions: { - sourceType: 'module', - ecmaVersion: 2024, - }, - extends: ['eslint:recommended', 'plugin:prettier/recommended'], - root: true, - env: { - es2024: true, - node: true, - jest: true, - }, - ignorePatterns: [ - '*config.js', - 'node_modules/', - 'artifacts/', - 'cache/', - 'typechain-types/', - 'jest-html-reporters-attach', - 'coverage', - ], -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..0b23e92 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,44 @@ +import pluginJest from "eslint-plugin-jest"; +import eslintConfigPrettier from "eslint-config-prettier"; +import jestExtended from 'eslint-plugin-jest-extended'; +// import js from "@eslint/js"; + + +export default [ + // js.configs.recommended, + jestExtended.configs['flat/all'], + { + plugins: { jest: pluginJest }, + languageOptions: { + globals: pluginJest.environments.globals.globals, + parserOptions: { + sourceType: "module", + ecmaVersion: 2024 + } + }, + files: ["**/*.spec.js", "**/*.test.js"], + ignores: [ + ".yarn/*", + "*config.js", + "**/node_modules/", + ".git/*", + "artifacts/", + "cache/", + "typechain-types/", + "jest-html-reporters-attach/", + "coverage/" + ], + rules: { + "indent": ["error", 2], + 'jest/prefer-expect-assertions': 'warn', + "jest/no-disabled-tests": "warn", + "jest/no-focused-tests": "error", + "jest/no-identical-title": "error", + "jest/prefer-to-have-length": "warn", + "jest/valid-expect": ["error", { minArgs: 1, maxArgs: 2 }], + "jest-extended/prefer-to-be-true": "warn", + "jest-extended/prefer-to-be-false": "error" + } + }, + eslintConfigPrettier +]; diff --git a/package.json b/package.json index 48285d8..79a9e6b 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "devDependencies": { "@babel/preset-env": "^7.23.8", "@babel/preset-typescript": "^7.23.3", + "@eslint/js": "^9.16.0", "@typechain/ethers-v6": "^0.5.1", "@typechain/hardhat": "^9.1.0", "@types/babel__core": "^7", @@ -29,8 +30,10 @@ "@types/ws": "^8.5.10", "@typescript-eslint/eslint-plugin": "^6.19.0", "@typescript-eslint/parser": "^6.19.0", - "eslint": "^8.56.0", + "eslint": "^9.16.0", "eslint-config-prettier": "^9.1.0", + "eslint-plugin-jest": "^28.9.0", + "eslint-plugin-jest-extended": "^2.4.0", "eslint-plugin-prettier": "^5.1.3", "ethers": "^6.4.0", "hardhat": "^2.14.0", @@ -64,9 +67,9 @@ "@openzeppelin/contracts": "^5.0.2", "@types/chai": "^4.3.16", "@types/proper-lockfile": "^4.1.4", - "@vechain/sdk-core": "1.0.0-rc.4", - "@vechain/sdk-logging": "1.0.0-rc.4", - "@vechain/sdk-network": "1.0.0-rc.4", + "@vechain/sdk-core": "1.0.0-rc.5", + "@vechain/sdk-logging": "1.0.0-rc.5", + "@vechain/sdk-network": "1.0.0-rc.5", "async-mutex": "^0.4.0", "axios": "^1.6.5", "bignumber.js": "^9.1.2", diff --git a/src/logs/write-logs.js b/src/logs/write-logs.js index 489d674..921caed 100644 --- a/src/logs/write-logs.js +++ b/src/logs/write-logs.js @@ -40,10 +40,7 @@ const writeTransfers = async () => { await pollReceipt(txId) - const receipt = - await Client.sdk.transactions.waitForTransaction(txId) - - return receipt + return await Client.sdk.transactions.waitForTransaction(txId) }), ) diff --git a/src/thor-client.js b/src/thor-client.js index 3e94b57..fa33c58 100644 --- a/src/thor-client.js +++ b/src/thor-client.js @@ -281,47 +281,6 @@ class ThorClient { ) } - /** - * A utility function to debug a particular clause in a reverted transaction - */ - async debugRevertedClause(txId, clauseIndex) { - const targetPrefix = await this.getDebugTargetPrefix(txId) - - if (!targetPrefix) { - return - } - - return this.traceClause({ - target: `${targetPrefix}/${clauseIndex}`, - name: 'call', - config: { - OnlyTopCall: true, - }, - }) - } - - /** - * A utility function to get the index of a transaction in a block - * @param txId - */ - async getDebugTargetPrefix(txId) { - const tx = await this.getTransaction(txId) - - if (!tx.success || !tx.body?.meta?.blockID) { - return undefined - } - - const block = await this.getBlock(tx.body.meta.blockID, false) - - if (!block.success || !block.body) { - return undefined - } - - const txIndex = block.body.transactions.indexOf(txId) - - return `${block.body.id}/${txIndex}` - } - openWebsocket(url, callback, errorCallback) { const ws = new WebSocket(url) ws.onmessage = (event) => { @@ -404,13 +363,6 @@ class LoadBalancedClient { return new Proxy(this.getRandomSDKClient(), handler) } - index(index) { - return { - sdk: this.sdkClients[index], - raw: this.clients[index], - } - } - getRandomClient() { return this.clients[Math.floor(Math.random() * this.clients.length)] } diff --git a/src/transactions.js b/src/transactions.js index aec78a4..5a6f774 100644 --- a/src/transactions.js +++ b/src/transactions.js @@ -56,9 +56,9 @@ export const pollReceipt = async (txId, timeout = 60_000) => { const blocks = blockIds.values() if ( - receipts.length == Client.clients.length && + receipts.length === Client.clients.length && HexUtils.isValid(blocks.next().value) && - blockIds.size == 1 + blockIds.size === 1 ) { clearInterval(intervalId) // Clear the interval when the receipt is found resolve(receipts[0].body) diff --git a/src/utils/legacy-bloom.js b/src/utils/legacy-bloom.js index 5ef7c2b..737985f 100644 --- a/src/utils/legacy-bloom.js +++ b/src/utils/legacy-bloom.js @@ -7,8 +7,6 @@ import HexUtils from './hex-utils' * Implementation from https://github.com/vechain/thor-devkit.js/blob/master/src/bloom.ts */ export class LegacyBloom { - /** number of hash functions */ - static MAX_K = 16 /** bits length */ static BITS_LENGTH = 2048 diff --git a/test/evm/eth-opcodes.test.js b/test/evm/eth-opcodes.test.js index 5354381..66619e8 100644 --- a/test/evm/eth-opcodes.test.js +++ b/test/evm/eth-opcodes.test.js @@ -23,8 +23,8 @@ import { pollReceipt } from '../../src/transactions' */ /** - * @group opcodes * @group evm + * @group opcodes */ describe('EVM Opcodes', () => { let wallet @@ -54,6 +54,6 @@ describe('EVM Opcodes', () => { await pollReceipt(id) const tx = await wait() - expect(tx?.reverted).toBe(true) + expect(tx?.reverted).toBeTrue() }) }) diff --git a/test/evm/evm-methods.test.js b/test/evm/evm-methods.test.js index 5832e23..6d56d65 100644 --- a/test/evm/evm-methods.test.js +++ b/test/evm/evm-methods.test.js @@ -4,6 +4,10 @@ import { HEX_REGEX_40 } from '../../src/utils/hex-utils' import { Hex, Keccak256, Txt } from '@vechain/sdk-core' import { Client } from '../../src/thor-client' +/** + * @group evm + * @group methods + */ describe('EVM methods', () => { let evmMethods const wallet = ThorWallet.withFunds() @@ -102,7 +106,7 @@ describe('EVM methods', () => { it.e2eTest('should be able to get "msg.value"', 'all', async () => { const msgValue = await evmMethods.transact.getMsgValue({ value: 100 }) const receipt = await msgValue.wait(3, 15) - expect(receipt.reverted).toEqual(false) + expect(receipt.reverted).toBeFalse() }) it.e2eTest('should be able to get "tx.gasprice"', 'all', async () => { diff --git a/test/evm/individual-opcodes.test.js b/test/evm/individual-opcodes.test.js index 16c4951..b8643a4 100644 --- a/test/evm/individual-opcodes.test.js +++ b/test/evm/individual-opcodes.test.js @@ -24,8 +24,8 @@ const opcodesInterface = Opcodes.createInterface() */ /** - * @group opcodes * @group evm + * @group opcodes */ describe('Individual OpCodes', () => { let wallet @@ -415,7 +415,7 @@ describe('Individual OpCodes', () => { expect( debugged.structLogs.some((log) => log.op === name), - ).toEqual(true) + ).toBeTrue() expect(debugged.returnValue).toBe(expected) }, ) @@ -440,7 +440,7 @@ describe('Individual OpCodes', () => { expect( debugged.structLogs.some((log) => log.op === 'BALANCE'), - ).toEqual(true) + ).toBeTrue() expect(balance).toBeGreaterThan(0) }, ) @@ -603,7 +603,7 @@ describe('Individual OpCodes', () => { const receipt = await pollReceipt(tx.id ?? '') - expect(receipt.reverted).toBe(true) + expect(receipt.reverted).toBeTrue() // 0x5f is the PUSH0 opcode const simulation = await Client.raw.executeAccountBatch({ diff --git a/test/thorest-api/accounts/contracts.test.js b/test/thorest-api/accounts/contracts.test.js index 4ff9a21..4461954 100644 --- a/test/thorest-api/accounts/contracts.test.js +++ b/test/thorest-api/accounts/contracts.test.js @@ -94,7 +94,7 @@ describe('Contracts', () => { await pollReceipt(tx.id) const receipt = await tx.wait() expect(receipt).toBeDefined() - expect(receipt.reverted).toBe(false) + expect(receipt.reverted).toBeFalse() const newValue = await counter.read.getCounter() expect(newValue[0]).toBe(startValue[0] + 3n) @@ -114,12 +114,12 @@ describe('Contracts', () => { const estimate = await Client.sdk.gas.estimateGas([ payClause.clause, ]) - expect(estimate.reverted).toBe(true) + expect(estimate.reverted).toBeTrue() expect( estimate.revertReasons.some( (reason) => reason === 'Not authorized', ), - ).toBe(true) + ).toBeTrue() const authorizeClause = authorizeTransaction.clause.authorize() @@ -132,7 +132,7 @@ describe('Contracts', () => { await pollReceipt(tx.id) const receipt = await tx.wait() expect(receipt).toBeDefined() - expect(receipt.reverted).toBe(false) + expect(receipt.reverted).toBeFalse() }, ) @@ -151,7 +151,7 @@ describe('Contracts', () => { const receipt = await wallet.sendClauses([clause], true) expect(receipt).toBeDefined() - expect(receipt.reverted).toBe(false) + expect(receipt.reverted).toBeFalse() }, ) @@ -170,7 +170,7 @@ describe('Contracts', () => { const receipt = await wallet.sendClauses([clause], true) expect(receipt).toBeDefined() - expect(receipt.reverted).toBe(true) + expect(receipt.reverted).toBeTrue() }, ) @@ -205,7 +205,7 @@ describe('Contracts', () => { const receipt = await wallet.sendClauses([clause], true) expect(receipt).toBeDefined() - expect(receipt.reverted).toBe(true) + expect(receipt.reverted).toBeTrue() const currentText = await stringer.read.text() expect(currentText[0]).toBe(priorText[0]) diff --git a/test/thorest-api/accounts/execute-codes.test.js b/test/thorest-api/accounts/execute-codes.test.js index a554304..84852bc 100644 --- a/test/thorest-api/accounts/execute-codes.test.js +++ b/test/thorest-api/accounts/execute-codes.test.js @@ -164,7 +164,7 @@ describe('POST /accounts/*', function () { expect( historicCall.body?.[0]?.reverted, 'Transaction should revert', - ).toEqual(true) + ).toBeTrue() // generated wallet was funded, so this should be successful const currentCall = await Client.raw.executeAccountBatch( @@ -180,7 +180,7 @@ describe('POST /accounts/*', function () { expect( currentCall.body?.[0]?.reverted, 'Transaction should not revert', - ).toEqual(false) + ).toBeFalse() }, ) @@ -198,8 +198,8 @@ describe('POST /accounts/*', function () { 'API response should be a success', ).toBeTrue() expect(historicCall.httpCode, 'Expected HTTP Code').toEqual(200) - expect(historicCall.body?.[0]?.reverted).toEqual(false) - expect(historicCall.body?.[1]?.reverted).toEqual(false) + expect(historicCall.body?.[0]?.reverted).toBeFalse() + expect(historicCall.body?.[1]?.reverted).toBeFalse() const balanceOf = parseInt(historicCall.body?.[0]?.data ?? '-1', 16) const totalSupply = parseInt( historicCall.body?.[1]?.data ?? '-1', @@ -225,8 +225,8 @@ describe('POST /accounts/*', function () { 'API response should be a success', ).toBeTrue() expect(res.httpCode, 'Expected HTTP Code').toEqual(200) - expect(res.body?.[0]?.reverted).toEqual(false) - expect(res.body?.[1]?.reverted).toEqual(false) + expect(res.body?.[0]?.reverted).toBeFalse() + expect(res.body?.[1]?.reverted).toBeFalse() }, ) }) diff --git a/test/thorest-api/debug/storage-range.test.js b/test/thorest-api/debug/storage-range.test.js index 50c46d9..ed4ef22 100644 --- a/test/thorest-api/debug/storage-range.test.js +++ b/test/thorest-api/debug/storage-range.test.js @@ -57,6 +57,7 @@ describe('GET /debug/storage-range', () => { }, options: { address: counter.address, maxResult: 1 }, }) + /* eslint-disable jest/prefer-to-have-length */ expect(Object.keys(storage.storage).length).toBe(1) expect(storage.nextKey).toBeNull() }, diff --git a/test/thorest-api/debug/tracers-call.test.js b/test/thorest-api/debug/tracers-call.test.js index 540c491..cf48ca6 100644 --- a/test/thorest-api/debug/tracers-call.test.js +++ b/test/thorest-api/debug/tracers-call.test.js @@ -184,8 +184,9 @@ describe('POST /debug/tracers/call', () => { const body = response.body expect(body.gas).toEqual(0) - expect(body.failed).toEqual(false) + expect(body.failed).toBeFalse() expect(body.returnValue).toMatch(HEX_AT_LEAST_1) + /* eslint-disable jest/prefer-to-have-length */ expect(response.body.structLogs.length).toBe(23) verifyStructLogs(response.body.structLogs) }) diff --git a/test/thorest-api/debug/tracers.test.js b/test/thorest-api/debug/tracers.test.js index a9b8540..9d87cdc 100644 --- a/test/thorest-api/debug/tracers.test.js +++ b/test/thorest-api/debug/tracers.test.js @@ -54,7 +54,7 @@ describe('POST /debug/tracers', () => { expect(res.httpCode).toBe(200) verifyStructLogs(res.body.structLogs) - expect(res.body.failed).toBe(false) + expect(res.body.failed).toBeFalse() expect(res.body.gas).toBeGreaterThan(0) }) @@ -63,7 +63,7 @@ describe('POST /debug/tracers', () => { expect(res.httpCode).toBe(200) verifyStructLogs(res.body.structLogs) - expect(res.body.failed).toBe(false) + expect(res.body.failed).toBeFalse() expect(res.body.gas).toBeGreaterThan(0) }) diff --git a/test/thorest-api/logs/query-events.test.js b/test/thorest-api/logs/query-events.test.js index 602b5cb..cf07de8 100644 --- a/test/thorest-api/logs/query-events.test.js +++ b/test/thorest-api/logs/query-events.test.js @@ -36,7 +36,7 @@ const buildRequestFromTransfer = async (transfer) => { /** * @group api - * @group events + * @group logs */ describe('POST /logs/event', () => { const transferDetails = readTransferDetails() diff --git a/test/thorest-api/logs/query-transfers.test.js b/test/thorest-api/logs/query-transfers.test.js index 58ec0dd..963d966 100644 --- a/test/thorest-api/logs/query-transfers.test.js +++ b/test/thorest-api/logs/query-transfers.test.js @@ -27,7 +27,7 @@ const buildRequestFromTransfer = (transfer) => { /** * @group api - * @group transfers + * @group logs */ describe('POST /logs/transfers', () => { const transferDetails = readTransferDetails() diff --git a/test/thorest-api/node/get-peers.test.js b/test/thorest-api/node/get-peers.test.js index ab2fa4b..b2efb3f 100644 --- a/test/thorest-api/node/get-peers.test.js +++ b/test/thorest-api/node/get-peers.test.js @@ -3,13 +3,13 @@ import { populatedData } from '../../../src/populated-data' /** * @group api - * @group peers + * @group node */ describe('GET /node/network/peers', () => { it.e2eTest('should get peers', 'all', async () => { const peers = await Client.raw.getPeers() - expect(peers.success).toEqual(true) + expect(peers.success).toBeTrue() expect(peers.headers['x-thorest-ver']).toBeDefined() expect(peers.headers['x-genesis-id']).toEqual( populatedData.read().genesisId, diff --git a/test/thorest-api/subscriptions/ws-beat.test.js b/test/thorest-api/subscriptions/ws-beat.test.js index 843fad4..0f6be66 100644 --- a/test/thorest-api/subscriptions/ws-beat.test.js +++ b/test/thorest-api/subscriptions/ws-beat.test.js @@ -1,12 +1,10 @@ import { Client } from '../../../src/thor-client' -import assert from 'node:assert' import { testLegacyBloomForAddress } from '../../../src/utils/legacy-bloom' import { ThorWallet } from '../../../src/wallet' /** * @group api * @group websockets - * @group beats */ describe('WS /subscriptions/beat', () => { it.e2eTest('should be able to subscribe', 'all', async () => { @@ -27,9 +25,9 @@ describe('WS /subscriptions/beat', () => { return beat.id === fundReceipt?.meta?.blockID }) - assert(relevantBeat?.bloom, 'Beat not found') - assert(relevantBeat?.k, 'Beat not found') - assert(wallet.address, 'Sender not found') + expect(relevantBeat?.bloom, 'Beat not found').toBeDefined() + expect(relevantBeat?.k, 'Beat not found').toBeDefined() + expect(wallet.address, 'Sender not found').toBeDefined() const result = testLegacyBloomForAddress( relevantBeat.bloom, @@ -37,7 +35,7 @@ describe('WS /subscriptions/beat', () => { wallet.address, ) - expect(result).toEqual(true) + expect(result).toBeTrue() }) it.e2eTest( @@ -58,12 +56,12 @@ describe('WS /subscriptions/beat', () => { attempts++ } - assert(beats.length > 0, 'Best block not found') + expect(beats.length, 'Best block not found').toBeGreaterThan(0) const nextBestBlock = beats.find( (beat) => beat.number === (bestBlock.body?.number ?? 0) + 1, ) - assert(nextBestBlock, 'Block not found') + expect(nextBestBlock, 'Block not found').toBeDefined() ws.unsubscribe() }, ) @@ -123,7 +121,7 @@ describe('WS /subscriptions/beat', () => { (beat) => beat.number === bestBlock.body?.number, ) - assert(firstBeat, 'Block not found') + expect(firstBeat, 'Block not found').toBeDefined() expect(firstBeat?.id).toEqual(bestBlock.body?.id) expect(firstBeat?.number).toEqual(bestBlock.body?.number) expect(firstBeat?.timestamp).toEqual(bestBlock.body?.timestamp) diff --git a/test/thorest-api/subscriptions/ws-beat2.test.js b/test/thorest-api/subscriptions/ws-beat2.test.js index 91199fe..cd0e2af 100644 --- a/test/thorest-api/subscriptions/ws-beat2.test.js +++ b/test/thorest-api/subscriptions/ws-beat2.test.js @@ -1,12 +1,10 @@ import { Client } from '../../../src/thor-client' import { testBloomForAddress } from '../../../src/utils/bloom' -import assert from 'node:assert' import { ThorWallet } from '../../../src/wallet' /** * @group api * @group websockets - * @group beats2 */ describe('WS /subscriptions/beat2', () => { it.e2eTest('should be able to subscribe', 'all', async () => { @@ -27,9 +25,9 @@ describe('WS /subscriptions/beat2', () => { return beat.id === fundReceipt?.meta?.blockID }) - assert(relevantBeat?.bloom, 'Beat not found') - assert(relevantBeat?.k, 'Beat not found') - assert(wallet.address, 'Sender not found') + expect(relevantBeat?.bloom, 'Beat not found').toBeDefined() + expect(relevantBeat?.k, 'Beat not found').toBeDefined() + expect(wallet.address, 'Sender not found').toBeDefined() const result = testBloomForAddress( relevantBeat.bloom, @@ -37,7 +35,7 @@ describe('WS /subscriptions/beat2', () => { wallet.address, ) - expect(result).toEqual(true) + expect(result).toBeTrue() }) it.e2eTest( @@ -58,12 +56,12 @@ describe('WS /subscriptions/beat2', () => { attempts++ } - assert(beats.length > 0, 'Best block not found') + expect(beats.length, 'Best block not found').toBeGreaterThan(0) const nextBestBlock = beats.find( (beat) => beat.number === (bestBlock.body?.number ?? 0) + 1, ) - assert(nextBestBlock, 'Block not found') + expect(nextBestBlock, 'Block not found').toBeDefined() ws.unsubscribe() }, ) @@ -124,7 +122,7 @@ describe('WS /subscriptions/beat2', () => { (beat) => beat.number === bestBlock.body?.number, ) - assert(firstBeat, 'Block not found') + expect(firstBeat, 'Block not found').toBeDefined() expect(firstBeat?.id).toEqual(bestBlock.body?.id) expect(firstBeat?.number).toEqual(bestBlock.body?.number) expect(firstBeat?.timestamp).toEqual(bestBlock.body?.timestamp) diff --git a/test/thorest-api/subscriptions/ws-events.test.js b/test/thorest-api/subscriptions/ws-events.test.js index c622722..948108a 100644 --- a/test/thorest-api/subscriptions/ws-events.test.js +++ b/test/thorest-api/subscriptions/ws-events.test.js @@ -47,7 +47,6 @@ const subscribeAndTestEvent = async (params, wallet) => { /** * @group api * @group websockets - * @group events */ describe('WS /subscriptions/event', () => { it.e2eTest('should work for empty parameters', 'all', async () => { diff --git a/test/thorest-api/subscriptions/ws-transfers.test.js b/test/thorest-api/subscriptions/ws-transfers.test.js index cc33be1..7173f9f 100644 --- a/test/thorest-api/subscriptions/ws-transfers.test.js +++ b/test/thorest-api/subscriptions/ws-transfers.test.js @@ -50,7 +50,6 @@ const subscribeAndFundAccount = async (params, account, wallet) => { /** * @group api * @group websockets - * @group transfer */ describe('WS /subscriptions/transfer', () => { it.e2eTest('should work for valid recipient', 'all', async () => { @@ -148,7 +147,7 @@ describe('WS /subscriptions/transfer', () => { ) expect(receipt).toBeDefined() - expect(receipt.reverted).toBe(false) + expect(receipt.reverted).toBeFalse() // Sleep for 1 sec to ensure the beat is received await new Promise((resolve) => setTimeout(resolve, 1000)) diff --git a/test/thorest-api/transactions/dependant-transaction.test.js b/test/thorest-api/transactions/dependant-transaction.test.js index aadb2a8..6db7313 100644 --- a/test/thorest-api/transactions/dependant-transaction.test.js +++ b/test/thorest-api/transactions/dependant-transaction.test.js @@ -13,7 +13,6 @@ import { MultipleTransactionDataDrivenFlow } from './setup/multiple-transactions /** * @group api * @group transactions - * @group dependant */ describe('dependant transaction', function () { it.e2eTest( diff --git a/test/thorest-api/transactions/get-transaction-receipt.test.js b/test/thorest-api/transactions/get-transaction-receipt.test.js index be57ef2..2fa20df 100644 --- a/test/thorest-api/transactions/get-transaction-receipt.test.js +++ b/test/thorest-api/transactions/get-transaction-receipt.test.js @@ -1,5 +1,4 @@ import { Client } from '../../../src/thor-client' -import assert from 'node:assert' import { readRandomTransfer } from '../../../src/populated-data' /** @@ -12,10 +11,9 @@ describe('GET /transactions/{id}/receipt', function () { const tx = await Client.raw.getTransactionReceipt(transfer.meta.txID) - assert(tx.success, 'Failed to get transaction receipt') - assert(tx.body != null, 'Failed to get transaction receipt body') - - expect(tx.body.meta?.txID).toEqual(transfer.meta?.txID) expect(tx.httpCode, 'Expected HTTP Code').toEqual(200) + expect(tx.success, 'Failed to get transaction receipt').toBeTrue() + expect(tx.body, 'Failed to get transaction receipt body').toBeDefined() + expect(tx.body.meta?.txID).toEqual(transfer.meta?.txID) }) }) diff --git a/test/thorest-api/transactions/get-transaction.test.js b/test/thorest-api/transactions/get-transaction.test.js index abe302d..2bb0c3f 100644 --- a/test/thorest-api/transactions/get-transaction.test.js +++ b/test/thorest-api/transactions/get-transaction.test.js @@ -1,5 +1,4 @@ import { Client } from '../../../src/thor-client' -import assert from 'node:assert' import { readRandomTransfer } from '../../../src/populated-data' /** @@ -14,10 +13,9 @@ describe('GET /transactions/{id}', function () { pending: true, }) - assert(tx.success, 'Failed to get transaction') - assert(tx.body != null, 'Failed to get transaction body') - - expect(tx.body.id).toEqual(transfer.meta?.txID) expect(tx.httpCode, 'Expected HTTP Code').toEqual(200) + expect(tx.success, 'Failed to get transaction').toBeTrue() + expect(tx.body, 'Failed to get transaction body').toBeDefined() + expect(tx.body.id).toEqual(transfer.meta?.txID) }) }) diff --git a/test/thorest-api/transactions/post-transaction.test.js b/test/thorest-api/transactions/post-transaction.test.js index 4957dc6..d26cd6c 100644 --- a/test/thorest-api/transactions/post-transaction.test.js +++ b/test/thorest-api/transactions/post-transaction.test.js @@ -16,7 +16,7 @@ describe('POST /transactions', function () { expect( fundReceipt?.reverted, 'Transaction should not be reverted', - ).toEqual(false) + ).toBeFalse() }) it.e2eTest( diff --git a/test/thorest-api/transactions/vet-transfer.test.js b/test/thorest-api/transactions/vet-transfer.test.js index 31770a7..86fc38b 100644 --- a/test/thorest-api/transactions/vet-transfer.test.js +++ b/test/thorest-api/transactions/vet-transfer.test.js @@ -194,7 +194,8 @@ describe('VET transfer, negative outcome', function () { getTxReceiptStep: { expectedResult: (receipt) => { unsuccessfulReceipt(receipt, signedTx) - expect(receipt.outputs.length).toEqual(0) + /* eslint-disable jest/prefer-to-have-length */ + expect(receipt.outputs.length).toBe(0) }, }, getLogTransferStep: { @@ -250,7 +251,8 @@ describe('VET transfer, negative outcome', function () { getTxReceiptStep: { expectedResult: (receipt) => { unsuccessfulReceipt(receipt, signedTx) - expect(receipt.outputs.length).toEqual(0) + /* eslint-disable jest/prefer-to-have-length */ + expect(receipt.outputs.length).toBe(0) }, }, getLogTransferStep: { @@ -303,7 +305,8 @@ describe('VET transfer, negative outcome', function () { getTxReceiptStep: { expectedResult: (receipt) => { unsuccessfulReceipt(receipt, signedTx) - expect(receipt.outputs.length).toEqual(0) + /* eslint-disable jest/prefer-to-have-length */ + expect(receipt.outputs.length).toBe(0) }, }, getLogTransferStep: { diff --git a/yarn.lock b/yarn.lock index 35332f4..db22e3e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1347,13 +1347,33 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.5.1, @eslint-community/regexpp@npm:^4.6.1": +"@eslint-community/regexpp@npm:^4.12.1, @eslint-community/regexpp@npm:^4.5.1, @eslint-community/regexpp@npm:^4.6.1": version: 4.12.1 resolution: "@eslint-community/regexpp@npm:4.12.1" checksum: 10c0/a03d98c246bcb9109aec2c08e4d10c8d010256538dcb3f56610191607214523d4fb1b00aa81df830b6dffb74c5fa0be03642513a289c567949d3e550ca11cdf6 languageName: node linkType: hard +"@eslint/config-array@npm:^0.19.0": + version: 0.19.1 + resolution: "@eslint/config-array@npm:0.19.1" + dependencies: + "@eslint/object-schema": "npm:^2.1.5" + debug: "npm:^4.3.1" + minimatch: "npm:^3.1.2" + checksum: 10c0/43b01f596ddad404473beae5cf95c013d29301c72778d0f5bf8a6699939c8a9a5663dbd723b53c5f476b88b0c694f76ea145d1aa9652230d140fe1161e4a4b49 + languageName: node + linkType: hard + +"@eslint/core@npm:^0.9.0": + version: 0.9.1 + resolution: "@eslint/core@npm:0.9.1" + dependencies: + "@types/json-schema": "npm:^7.0.15" + checksum: 10c0/638104b1b5833a9bbf2329f0c0ddf322e4d6c0410b149477e02cd2b78c04722be90c14b91b8ccdef0d63a2404dff72a17b6b412ce489ea429ae6a8fcb8abff28 + languageName: node + linkType: hard + "@eslint/eslintrc@npm:^2.1.4": version: 2.1.4 resolution: "@eslint/eslintrc@npm:2.1.4" @@ -1371,6 +1391,23 @@ __metadata: languageName: node linkType: hard +"@eslint/eslintrc@npm:^3.2.0": + version: 3.2.0 + resolution: "@eslint/eslintrc@npm:3.2.0" + dependencies: + ajv: "npm:^6.12.4" + debug: "npm:^4.3.2" + espree: "npm:^10.0.1" + globals: "npm:^14.0.0" + ignore: "npm:^5.2.0" + import-fresh: "npm:^3.2.1" + js-yaml: "npm:^4.1.0" + minimatch: "npm:^3.1.2" + strip-json-comments: "npm:^3.1.1" + checksum: 10c0/43867a07ff9884d895d9855edba41acf325ef7664a8df41d957135a81a477ff4df4196f5f74dc3382627e5cc8b7ad6b815c2cea1b58f04a75aced7c43414ab8b + languageName: node + linkType: hard + "@eslint/js@npm:8.57.1": version: 8.57.1 resolution: "@eslint/js@npm:8.57.1" @@ -1378,6 +1415,29 @@ __metadata: languageName: node linkType: hard +"@eslint/js@npm:9.16.0, @eslint/js@npm:^9.16.0": + version: 9.16.0 + resolution: "@eslint/js@npm:9.16.0" + checksum: 10c0/a55846a4ddade720662d36682f3eaaf38eac06eeee12c83bb837bba2b7d550dadcb3445b104219f0bc1da2e09b4fe5fb5ba123b8338c8c787bcfbd540878df75 + languageName: node + linkType: hard + +"@eslint/object-schema@npm:^2.1.5": + version: 2.1.5 + resolution: "@eslint/object-schema@npm:2.1.5" + checksum: 10c0/5320691ed41ecd09a55aff40ce8e56596b4eb81f3d4d6fe530c50fdd6552d88102d1c1a29d970ae798ce30849752a708772de38ded07a6f25b3da32ebea081d8 + languageName: node + linkType: hard + +"@eslint/plugin-kit@npm:^0.2.3": + version: 0.2.4 + resolution: "@eslint/plugin-kit@npm:0.2.4" + dependencies: + levn: "npm:^0.4.1" + checksum: 10c0/1bcfc0a30b1df891047c1d8b3707833bded12a057ba01757a2a8591fdc8d8fe0dbb8d51d4b0b61b2af4ca1d363057abd7d2fb4799f1706b105734f4d3fa0dbf1 + languageName: node + linkType: hard + "@ethereumjs/rlp@npm:^4.0.1": version: 4.0.1 resolution: "@ethereumjs/rlp@npm:4.0.1" @@ -1829,6 +1889,23 @@ __metadata: languageName: node linkType: hard +"@humanfs/core@npm:^0.19.1": + version: 0.19.1 + resolution: "@humanfs/core@npm:0.19.1" + checksum: 10c0/aa4e0152171c07879b458d0e8a704b8c3a89a8c0541726c6b65b81e84fd8b7564b5d6c633feadc6598307d34564bd53294b533491424e8e313d7ab6c7bc5dc67 + languageName: node + linkType: hard + +"@humanfs/node@npm:^0.16.6": + version: 0.16.6 + resolution: "@humanfs/node@npm:0.16.6" + dependencies: + "@humanfs/core": "npm:^0.19.1" + "@humanwhocodes/retry": "npm:^0.3.0" + checksum: 10c0/8356359c9f60108ec204cbd249ecd0356667359b2524886b357617c4a7c3b6aace0fd5a369f63747b926a762a88f8a25bc066fa1778508d110195ce7686243e1 + languageName: node + linkType: hard + "@humanwhocodes/config-array@npm:^0.13.0": version: 0.13.0 resolution: "@humanwhocodes/config-array@npm:0.13.0" @@ -1854,6 +1931,20 @@ __metadata: languageName: node linkType: hard +"@humanwhocodes/retry@npm:^0.3.0": + version: 0.3.1 + resolution: "@humanwhocodes/retry@npm:0.3.1" + checksum: 10c0/f0da1282dfb45e8120480b9e2e275e2ac9bbe1cf016d046fdad8e27cc1285c45bb9e711681237944445157b430093412b4446c1ab3fc4bb037861b5904101d3b + languageName: node + linkType: hard + +"@humanwhocodes/retry@npm:^0.4.1": + version: 0.4.1 + resolution: "@humanwhocodes/retry@npm:0.4.1" + checksum: 10c0/be7bb6841c4c01d0b767d9bb1ec1c9359ee61421ce8ba66c249d035c5acdfd080f32d55a5c9e859cdd7868788b8935774f65b2caf24ec0b7bd7bf333791f063b + languageName: node + linkType: hard + "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 resolution: "@isaacs/cliui@npm:8.0.2" @@ -3051,6 +3142,13 @@ __metadata: languageName: node linkType: hard +"@types/estree@npm:^1.0.6": + version: 1.0.6 + resolution: "@types/estree@npm:1.0.6" + checksum: 10c0/cdfd751f6f9065442cd40957c07fd80361c962869aa853c1c2fd03e101af8b9389d8ff4955a43a6fcfa223dd387a089937f95be0f3eec21ca527039fd2d9859a + languageName: node + linkType: hard + "@types/form-data@npm:0.0.33": version: 0.0.33 resolution: "@types/form-data@npm:0.0.33" @@ -3114,7 +3212,7 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:^7.0.12": +"@types/json-schema@npm:^7.0.12, @types/json-schema@npm:^7.0.15, @types/json-schema@npm:^7.0.9": version: 7.0.15 resolution: "@types/json-schema@npm:7.0.15" checksum: 10c0/a996a745e6c5d60292f36731dd41341339d4eeed8180bb09226e5c8d23759067692b1d88e5d91d72ee83dfc00d3aca8e7bd43ea120516c17922cbcb7c3e252db @@ -3215,7 +3313,7 @@ __metadata: languageName: node linkType: hard -"@types/semver@npm:^7.5.0": +"@types/semver@npm:^7.3.12, @types/semver@npm:^7.5.0": version: 7.5.8 resolution: "@types/semver@npm:7.5.8" checksum: 10c0/8663ff927234d1c5fcc04b33062cb2b9fcfbe0f5f351ed26c4d1e1581657deebd506b41ff7fdf89e787e3d33ce05854bc01686379b89e9c49b564c4cfa988efa @@ -3306,6 +3404,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/scope-manager@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/scope-manager@npm:5.62.0" + dependencies: + "@typescript-eslint/types": "npm:5.62.0" + "@typescript-eslint/visitor-keys": "npm:5.62.0" + checksum: 10c0/861253235576c1c5c1772d23cdce1418c2da2618a479a7de4f6114a12a7ca853011a1e530525d0931c355a8fd237b9cd828fac560f85f9623e24054fd024726f + languageName: node + linkType: hard + "@typescript-eslint/scope-manager@npm:6.21.0": version: 6.21.0 resolution: "@typescript-eslint/scope-manager@npm:6.21.0" @@ -3316,6 +3424,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/scope-manager@npm:8.18.0": + version: 8.18.0 + resolution: "@typescript-eslint/scope-manager@npm:8.18.0" + dependencies: + "@typescript-eslint/types": "npm:8.18.0" + "@typescript-eslint/visitor-keys": "npm:8.18.0" + checksum: 10c0/6bf6532fd43f2b55b9b47fa8b0217c5b5a03f022e869a6a21228fc3ae04c0ac6c5ae5d6026866d189ba424d2f98cc6fbd2a34f909d241c9b86c031afd808f90c + languageName: node + linkType: hard + "@typescript-eslint/type-utils@npm:6.21.0": version: 6.21.0 resolution: "@typescript-eslint/type-utils@npm:6.21.0" @@ -3333,6 +3451,13 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/types@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/types@npm:5.62.0" + checksum: 10c0/7febd3a7f0701c0b927e094f02e82d8ee2cada2b186fcb938bc2b94ff6fbad88237afc304cbaf33e82797078bbbb1baf91475f6400912f8b64c89be79bfa4ddf + languageName: node + linkType: hard + "@typescript-eslint/types@npm:6.21.0": version: 6.21.0 resolution: "@typescript-eslint/types@npm:6.21.0" @@ -3340,6 +3465,31 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/types@npm:8.18.0": + version: 8.18.0 + resolution: "@typescript-eslint/types@npm:8.18.0" + checksum: 10c0/2dd7468c3f1c305545268b72c3a333488e6ab1b628c5f65081d895866422b9376c21634a7aac437805f84b22e352b6a8fc4dcf925ef4a8fd7d1898b8359f71be + languageName: node + linkType: hard + +"@typescript-eslint/typescript-estree@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/typescript-estree@npm:5.62.0" + dependencies: + "@typescript-eslint/types": "npm:5.62.0" + "@typescript-eslint/visitor-keys": "npm:5.62.0" + debug: "npm:^4.3.4" + globby: "npm:^11.1.0" + is-glob: "npm:^4.0.3" + semver: "npm:^7.3.7" + tsutils: "npm:^3.21.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/d7984a3e9d56897b2481940ec803cb8e7ead03df8d9cfd9797350be82ff765dfcf3cfec04e7355e1779e948da8f02bc5e11719d07a596eb1cb995c48a95e38cf + languageName: node + linkType: hard + "@typescript-eslint/typescript-estree@npm:6.21.0": version: 6.21.0 resolution: "@typescript-eslint/typescript-estree@npm:6.21.0" @@ -3359,6 +3509,24 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/typescript-estree@npm:8.18.0": + version: 8.18.0 + resolution: "@typescript-eslint/typescript-estree@npm:8.18.0" + dependencies: + "@typescript-eslint/types": "npm:8.18.0" + "@typescript-eslint/visitor-keys": "npm:8.18.0" + debug: "npm:^4.3.4" + fast-glob: "npm:^3.3.2" + is-glob: "npm:^4.0.3" + minimatch: "npm:^9.0.4" + semver: "npm:^7.6.0" + ts-api-utils: "npm:^1.3.0" + peerDependencies: + typescript: ">=4.8.4 <5.8.0" + checksum: 10c0/87b432b190b627314f007b17b2371898db78baaa3df67a0d9a94d080d88a7a307906b54a735084cacef37f6421e2b9c3320040617e73fe54eac2bf22c610f1ec + languageName: node + linkType: hard + "@typescript-eslint/utils@npm:6.21.0": version: 6.21.0 resolution: "@typescript-eslint/utils@npm:6.21.0" @@ -3376,6 +3544,49 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/utils@npm:^5.10.0": + version: 5.62.0 + resolution: "@typescript-eslint/utils@npm:5.62.0" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.2.0" + "@types/json-schema": "npm:^7.0.9" + "@types/semver": "npm:^7.3.12" + "@typescript-eslint/scope-manager": "npm:5.62.0" + "@typescript-eslint/types": "npm:5.62.0" + "@typescript-eslint/typescript-estree": "npm:5.62.0" + eslint-scope: "npm:^5.1.1" + semver: "npm:^7.3.7" + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + checksum: 10c0/f09b7d9952e4a205eb1ced31d7684dd55cee40bf8c2d78e923aa8a255318d97279825733902742c09d8690f37a50243f4c4d383ab16bd7aefaf9c4b438f785e1 + languageName: node + linkType: hard + +"@typescript-eslint/utils@npm:^6.0.0 || ^7.0.0 || ^8.0.0": + version: 8.18.0 + resolution: "@typescript-eslint/utils@npm:8.18.0" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.4.0" + "@typescript-eslint/scope-manager": "npm:8.18.0" + "@typescript-eslint/types": "npm:8.18.0" + "@typescript-eslint/typescript-estree": "npm:8.18.0" + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: ">=4.8.4 <5.8.0" + checksum: 10c0/58a2fc1e404d1f905c2a958d995824eb4abc6e73836b186717550677f8b1d17954acc369feddb83277350915388bc3d8b721423c37777b8b8017fc29c89ec6ee + languageName: node + linkType: hard + +"@typescript-eslint/visitor-keys@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/visitor-keys@npm:5.62.0" + dependencies: + "@typescript-eslint/types": "npm:5.62.0" + eslint-visitor-keys: "npm:^3.3.0" + checksum: 10c0/7c3b8e4148e9b94d9b7162a596a1260d7a3efc4e65199693b8025c71c4652b8042501c0bc9f57654c1e2943c26da98c0f77884a746c6ae81389fcb0b513d995d + languageName: node + linkType: hard + "@typescript-eslint/visitor-keys@npm:6.21.0": version: 6.21.0 resolution: "@typescript-eslint/visitor-keys@npm:6.21.0" @@ -3386,6 +3597,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/visitor-keys@npm:8.18.0": + version: 8.18.0 + resolution: "@typescript-eslint/visitor-keys@npm:8.18.0" + dependencies: + "@typescript-eslint/types": "npm:8.18.0" + eslint-visitor-keys: "npm:^4.2.0" + checksum: 10c0/d4cdc2adab553098b5be7117fb7df76fb66cfd380528881a0a8c2a9eee03bf8baddda07d15ca0bd3ed8b35c379b3f449292183df18e3e81898dbcadafcb708b8 + languageName: node + linkType: hard + "@ungap/structured-clone@npm:^1.2.0": version: 1.2.1 resolution: "@ungap/structured-clone@npm:1.2.1" @@ -3393,9 +3614,9 @@ __metadata: languageName: node linkType: hard -"@vechain/sdk-core@npm:1.0.0-rc.4": - version: 1.0.0-rc.4 - resolution: "@vechain/sdk-core@npm:1.0.0-rc.4" +"@vechain/sdk-core@npm:1.0.0-rc.5": + version: 1.0.0-rc.5 + resolution: "@vechain/sdk-core@npm:1.0.0-rc.5" dependencies: "@ethereumjs/rlp": "npm:^5.0.2" "@noble/ciphers": "npm:^1.1.1" @@ -3404,47 +3625,47 @@ __metadata: "@scure/base": "npm:^1.1.9" "@scure/bip32": "npm:^1.4.0" "@scure/bip39": "npm:^1.4.0" - "@vechain/sdk-errors": "npm:1.0.0-rc.4" - "@vechain/sdk-logging": "npm:1.0.0-rc.4" + "@vechain/sdk-errors": "npm:1.0.0-rc.5" + "@vechain/sdk-logging": "npm:1.0.0-rc.5" abitype: "npm:^1.0.6" ethers: "npm:6.13.4" fast-json-stable-stringify: "npm:^2.1.0" viem: "npm:^2.21.45" - checksum: 10c0/6a6ace51560138fe5c0a5de2d5e2e0380ee7600a3d706c9367521d76d0819b6a0877088fa48f7189c3ead791fd17af2f5e1911dd0e4b424864de5ad1f204e430 + checksum: 10c0/1325bc81d0ea28499c0593262b2a1eb9348d6144dc42c656d039e62f11c7a47c01a887ad3186bcee69a84697ca84a691994310c171773b18e51cbea5c79f76c8 languageName: node linkType: hard -"@vechain/sdk-errors@npm:1.0.0-rc.4": - version: 1.0.0-rc.4 - resolution: "@vechain/sdk-errors@npm:1.0.0-rc.4" - checksum: 10c0/1e19db54cc53fd3f7665adc1267fde0e0d081b06db052deabc923c9ef6e866b87be64ac98cc4aa12a726314ae11fdf03d13afe0d21966382271f608dc6464d56 +"@vechain/sdk-errors@npm:1.0.0-rc.5": + version: 1.0.0-rc.5 + resolution: "@vechain/sdk-errors@npm:1.0.0-rc.5" + checksum: 10c0/5446c270b41d97441d0b20e3a6bd57ed3d9a7177ea83434f75d09d1a1cf9882fcf642f382e8b5cba3328e82bf5ca67d77efff687734caff85bd9f6aaf16d8183 languageName: node linkType: hard -"@vechain/sdk-logging@npm:1.0.0-rc.4": - version: 1.0.0-rc.4 - resolution: "@vechain/sdk-logging@npm:1.0.0-rc.4" +"@vechain/sdk-logging@npm:1.0.0-rc.5": + version: 1.0.0-rc.5 + resolution: "@vechain/sdk-logging@npm:1.0.0-rc.5" dependencies: - "@vechain/sdk-errors": "npm:1.0.0-rc.4" - checksum: 10c0/873c4e3f96b051673bc67659f8378e1dee91b8492a9e6f5930916cb26d98c64225566db685b2db6ee756d7f2eb6206a20f13579ee1a86587013fda1228d15b97 + "@vechain/sdk-errors": "npm:1.0.0-rc.5" + checksum: 10c0/cae3af1fe5cc0b803ed19c2ed2dfdf3a9cab6706bf5353fe02c9081ba5bbf3328eb2caff7e0c237e364a8bdc3d42ed7fde063cca15d372776f9313e261652575 languageName: node linkType: hard -"@vechain/sdk-network@npm:1.0.0-rc.4": - version: 1.0.0-rc.4 - resolution: "@vechain/sdk-network@npm:1.0.0-rc.4" +"@vechain/sdk-network@npm:1.0.0-rc.5": + version: 1.0.0-rc.5 + resolution: "@vechain/sdk-network@npm:1.0.0-rc.5" dependencies: "@noble/curves": "npm:^1.6.0" - "@vechain/sdk-core": "npm:1.0.0-rc.4" - "@vechain/sdk-errors": "npm:1.0.0-rc.4" - "@vechain/sdk-logging": "npm:1.0.0-rc.4" + "@vechain/sdk-core": "npm:1.0.0-rc.5" + "@vechain/sdk-errors": "npm:1.0.0-rc.5" + "@vechain/sdk-logging": "npm:1.0.0-rc.5" "@vechain/vebetterdao-contracts": "npm:^4.0.0" abitype: "npm:^1.0.6" ethers: "npm:6.13.4" isomorphic-ws: "npm:^5.0.0" viem: "npm:^2.21.45" ws: "npm:^8.18.0" - checksum: 10c0/c81965a347d03530d2a0750e50d4a220b55107666dbf84ceb9e163b0e9b59d48cc50eae479ade7ae0e028c0e27fb0dd64a0a71b16338cb0765e98a618f20db54 + checksum: 10c0/6a6a29739293a910bf4eedee40eecd461cab0d16502496384db0d993753eb04ec4192acfd9ce62be5ddb72f5261e436a5cb11c217fe77d9199e886b6f1167ecc languageName: node linkType: hard @@ -3526,7 +3747,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.11.0, acorn@npm:^8.4.1, acorn@npm:^8.9.0": +"acorn@npm:^8.11.0, acorn@npm:^8.14.0, acorn@npm:^8.4.1, acorn@npm:^8.9.0": version: 8.14.0 resolution: "acorn@npm:8.14.0" bin: @@ -3706,9 +3927,11 @@ __metadata: linkType: hard "antlr4ts@npm:^0.5.0-alpha.4": - version: 0.5.0-alpha.4 - resolution: "antlr4ts@npm:0.5.0-alpha.4" - checksum: 10c0/26a43d6769178fdf1b79ed2001f123fd49843e335f9a3687b63c090ab2024632fbac60a73b3f8289044c206edeb5d19c36b02603b018d8eaf3be3ce30136102f + version: 0.5.0-dev + resolution: "antlr4ts@npm:0.5.0-dev" + dependencies: + source-map-support: "npm:^0.5.16" + checksum: 10c0/948d95d02497a5751105cc61e9931d03a9bf0566b33a28ea8f2c72484a47ec4c5148670e1a525bfbc0069b1b86ab820417ec3fad120081211ff55f542fb4a835 languageName: node linkType: hard @@ -4678,7 +4901,7 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": +"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.5": version: 7.0.6 resolution: "cross-spawn@npm:7.0.6" dependencies: @@ -5064,6 +5287,35 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-jest-extended@npm:^2.4.0": + version: 2.4.0 + resolution: "eslint-plugin-jest-extended@npm:2.4.0" + dependencies: + "@typescript-eslint/utils": "npm:^5.10.0" + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 + checksum: 10c0/ee9e5dde622448393c422481edc5d0423ac6d6b9fc1a25744b49fb01b2aea83c3d0cb4531601da15cf20071ccec6b00c048fad633f75fa80e00573d02df41e10 + languageName: node + linkType: hard + +"eslint-plugin-jest@npm:^28.9.0": + version: 28.9.0 + resolution: "eslint-plugin-jest@npm:28.9.0" + dependencies: + "@typescript-eslint/utils": "npm:^6.0.0 || ^7.0.0 || ^8.0.0" + peerDependencies: + "@typescript-eslint/eslint-plugin": ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 + jest: "*" + peerDependenciesMeta: + "@typescript-eslint/eslint-plugin": + optional: true + jest: + optional: true + checksum: 10c0/56b0d2fb18a32bf56b0eb8c7790c355513535a239451d9d00184829cbd0ba35b6c68eec64e850a6299453f9c37338b6797d3184594c0326c8fdcc029024065b8 + languageName: node + linkType: hard + "eslint-plugin-prettier@npm:^5.1.3": version: 5.2.1 resolution: "eslint-plugin-prettier@npm:5.2.1" @@ -5084,6 +5336,16 @@ __metadata: languageName: node linkType: hard +"eslint-scope@npm:^5.1.1": + version: 5.1.1 + resolution: "eslint-scope@npm:5.1.1" + dependencies: + esrecurse: "npm:^4.3.0" + estraverse: "npm:^4.1.1" + checksum: 10c0/d30ef9dc1c1cbdece34db1539a4933fe3f9b14e1ffb27ecc85987902ee663ad7c9473bbd49a9a03195a373741e62e2f807c4938992e019b511993d163450e70a + languageName: node + linkType: hard + "eslint-scope@npm:^7.1.1, eslint-scope@npm:^7.2.2": version: 7.2.2 resolution: "eslint-scope@npm:7.2.2" @@ -5094,6 +5356,16 @@ __metadata: languageName: node linkType: hard +"eslint-scope@npm:^8.2.0": + version: 8.2.0 + resolution: "eslint-scope@npm:8.2.0" + dependencies: + esrecurse: "npm:^4.3.0" + estraverse: "npm:^5.2.0" + checksum: 10c0/8d2d58e2136d548ac7e0099b1a90d9fab56f990d86eb518de1247a7066d38c908be2f3df477a79cf60d70b30ba18735d6c6e70e9914dca2ee515a729975d70d6 + languageName: node + linkType: hard + "eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": version: 3.4.3 resolution: "eslint-visitor-keys@npm:3.4.3" @@ -5101,7 +5373,14 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.56.0, eslint@npm:^8.7.0": +"eslint-visitor-keys@npm:^4.2.0": + version: 4.2.0 + resolution: "eslint-visitor-keys@npm:4.2.0" + checksum: 10c0/2ed81c663b147ca6f578312919483eb040295bbab759e5a371953456c636c5b49a559883e2677112453728d66293c0a4c90ab11cab3428cf02a0236d2e738269 + languageName: node + linkType: hard + +"eslint@npm:^8.7.0": version: 8.57.1 resolution: "eslint@npm:8.57.1" dependencies: @@ -5149,6 +5428,66 @@ __metadata: languageName: node linkType: hard +"eslint@npm:^9.16.0": + version: 9.16.0 + resolution: "eslint@npm:9.16.0" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.2.0" + "@eslint-community/regexpp": "npm:^4.12.1" + "@eslint/config-array": "npm:^0.19.0" + "@eslint/core": "npm:^0.9.0" + "@eslint/eslintrc": "npm:^3.2.0" + "@eslint/js": "npm:9.16.0" + "@eslint/plugin-kit": "npm:^0.2.3" + "@humanfs/node": "npm:^0.16.6" + "@humanwhocodes/module-importer": "npm:^1.0.1" + "@humanwhocodes/retry": "npm:^0.4.1" + "@types/estree": "npm:^1.0.6" + "@types/json-schema": "npm:^7.0.15" + ajv: "npm:^6.12.4" + chalk: "npm:^4.0.0" + cross-spawn: "npm:^7.0.5" + debug: "npm:^4.3.2" + escape-string-regexp: "npm:^4.0.0" + eslint-scope: "npm:^8.2.0" + eslint-visitor-keys: "npm:^4.2.0" + espree: "npm:^10.3.0" + esquery: "npm:^1.5.0" + esutils: "npm:^2.0.2" + fast-deep-equal: "npm:^3.1.3" + file-entry-cache: "npm:^8.0.0" + find-up: "npm:^5.0.0" + glob-parent: "npm:^6.0.2" + ignore: "npm:^5.2.0" + imurmurhash: "npm:^0.1.4" + is-glob: "npm:^4.0.0" + json-stable-stringify-without-jsonify: "npm:^1.0.1" + lodash.merge: "npm:^4.6.2" + minimatch: "npm:^3.1.2" + natural-compare: "npm:^1.4.0" + optionator: "npm:^0.9.3" + peerDependencies: + jiti: "*" + peerDependenciesMeta: + jiti: + optional: true + bin: + eslint: bin/eslint.js + checksum: 10c0/f36d12652c6f20bab8a77375b8ad29a6af030c3840deb0a5f9dd4cee49d68a2d68d7dc73b0c25918df59d83cd686dd5712e11387e696e1f3842e8dde15cd3255 + languageName: node + linkType: hard + +"espree@npm:^10.0.1, espree@npm:^10.3.0": + version: 10.3.0 + resolution: "espree@npm:10.3.0" + dependencies: + acorn: "npm:^8.14.0" + acorn-jsx: "npm:^5.3.2" + eslint-visitor-keys: "npm:^4.2.0" + checksum: 10c0/272beeaca70d0a1a047d61baff64db04664a33d7cfb5d144f84bc8a5c6194c6c8ebe9cc594093ca53add88baa23e59b01e69e8a0160ab32eac570482e165c462 + languageName: node + linkType: hard + "espree@npm:^9.3.1, espree@npm:^9.6.0, espree@npm:^9.6.1": version: 9.6.1 resolution: "espree@npm:9.6.1" @@ -5180,7 +5519,7 @@ __metadata: languageName: node linkType: hard -"esquery@npm:^1.4.0, esquery@npm:^1.4.2": +"esquery@npm:^1.4.0, esquery@npm:^1.4.2, esquery@npm:^1.5.0": version: 1.6.0 resolution: "esquery@npm:1.6.0" dependencies: @@ -5205,6 +5544,13 @@ __metadata: languageName: node linkType: hard +"estraverse@npm:^4.1.1": + version: 4.3.0 + resolution: "estraverse@npm:4.3.0" + checksum: 10c0/9cb46463ef8a8a4905d3708a652d60122a0c20bb58dec7e0e12ab0e7235123d74214fc0141d743c381813e1b992767e2708194f6f6e0f9fd00c1b4e0887b8b6d + languageName: node + linkType: hard + "estraverse@npm:^5.1.0, estraverse@npm:^5.2.0": version: 5.3.0 resolution: "estraverse@npm:5.3.0" @@ -5561,6 +5907,15 @@ __metadata: languageName: node linkType: hard +"file-entry-cache@npm:^8.0.0": + version: 8.0.0 + resolution: "file-entry-cache@npm:8.0.0" + dependencies: + flat-cache: "npm:^4.0.0" + checksum: 10c0/9e2b5938b1cd9b6d7e3612bdc533afd4ac17b2fc646569e9a8abbf2eb48e5eb8e316bc38815a3ef6a1b456f4107f0d0f055a614ca613e75db6bf9ff4d72c1638 + languageName: node + linkType: hard + "fill-range@npm:^7.1.1": version: 7.1.1 resolution: "fill-range@npm:7.1.1" @@ -5610,6 +5965,16 @@ __metadata: languageName: node linkType: hard +"flat-cache@npm:^4.0.0": + version: 4.0.1 + resolution: "flat-cache@npm:4.0.1" + dependencies: + flatted: "npm:^3.2.9" + keyv: "npm:^4.5.4" + checksum: 10c0/2c59d93e9faa2523e4fda6b4ada749bed432cfa28c8e251f33b25795e426a1c6dbada777afb1f74fcfff33934fdbdea921ee738fcc33e71adc9d6eca984a1cfc + languageName: node + linkType: hard + "flat@npm:^5.0.2": version: 5.0.2 resolution: "flat@npm:5.0.2" @@ -5980,6 +6345,13 @@ __metadata: languageName: node linkType: hard +"globals@npm:^14.0.0": + version: 14.0.0 + resolution: "globals@npm:14.0.0" + checksum: 10c0/b96ff42620c9231ad468d4c58ff42afee7777ee1c963013ff8aabe095a451d0ceeb8dcd8ef4cbd64d2538cef45f787a78ba3a9574f4a634438963e334471302d + languageName: node + linkType: hard + "globby@npm:^10.0.1": version: 10.0.2 resolution: "globby@npm:10.0.2" @@ -7400,7 +7772,7 @@ __metadata: languageName: node linkType: hard -"keyv@npm:^4.5.3": +"keyv@npm:^4.5.3, keyv@npm:^4.5.4": version: 4.5.4 resolution: "keyv@npm:4.5.4" dependencies: @@ -9115,7 +9487,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.6, semver@npm:^7.5.3, semver@npm:^7.5.4": +"semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.6, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0": version: 7.6.3 resolution: "semver@npm:7.6.3" bin: @@ -9349,7 +9721,7 @@ __metadata: languageName: node linkType: hard -"source-map-support@npm:^0.5.13": +"source-map-support@npm:^0.5.13, source-map-support@npm:^0.5.16": version: 0.5.21 resolution: "source-map-support@npm:0.5.21" dependencies: @@ -9776,6 +10148,7 @@ __metadata: "@babel/core": "npm:^7.24.5" "@babel/preset-env": "npm:^7.23.8" "@babel/preset-typescript": "npm:^7.23.3" + "@eslint/js": "npm:^9.16.0" "@nomicfoundation/hardhat-chai-matchers": "npm:^2.0.6" "@nomicfoundation/hardhat-ethers": "npm:^3.0.6" "@nomicfoundation/hardhat-ignition": "npm:^0.15.4" @@ -9795,16 +10168,18 @@ __metadata: "@types/ws": "npm:^8.5.10" "@typescript-eslint/eslint-plugin": "npm:^6.19.0" "@typescript-eslint/parser": "npm:^6.19.0" - "@vechain/sdk-core": "npm:1.0.0-rc.4" - "@vechain/sdk-logging": "npm:1.0.0-rc.4" - "@vechain/sdk-network": "npm:1.0.0-rc.4" + "@vechain/sdk-core": "npm:1.0.0-rc.5" + "@vechain/sdk-logging": "npm:1.0.0-rc.5" + "@vechain/sdk-network": "npm:1.0.0-rc.5" async-mutex: "npm:^0.4.0" axios: "npm:^1.6.5" bignumber.js: "npm:^9.1.2" chai: "npm:4.2.0" dotenv: "npm:^16.4.5" - eslint: "npm:^8.56.0" + eslint: "npm:^9.16.0" eslint-config-prettier: "npm:^9.1.0" + eslint-plugin-jest: "npm:^28.9.0" + eslint-plugin-jest-extended: "npm:^2.4.0" eslint-plugin-prettier: "npm:^5.1.3" ethers: "npm:^6.4.0" hardhat: "npm:^2.14.0" @@ -9894,7 +10269,7 @@ __metadata: languageName: node linkType: hard -"ts-api-utils@npm:^1.0.1": +"ts-api-utils@npm:^1.0.1, ts-api-utils@npm:^1.3.0": version: 1.4.3 resolution: "ts-api-utils@npm:1.4.3" peerDependencies: @@ -9971,7 +10346,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^1.9.3": +"tslib@npm:^1.8.1, tslib@npm:^1.9.3": version: 1.14.1 resolution: "tslib@npm:1.14.1" checksum: 10c0/69ae09c49eea644bc5ebe1bca4fa4cc2c82b7b3e02f43b84bd891504edf66dbc6b2ec0eef31a957042de2269139e4acff911e6d186a258fb14069cd7f6febce2 @@ -9992,6 +10367,17 @@ __metadata: languageName: node linkType: hard +"tsutils@npm:^3.21.0": + version: 3.21.0 + resolution: "tsutils@npm:3.21.0" + dependencies: + tslib: "npm:^1.8.1" + peerDependencies: + typescript: ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + checksum: 10c0/02f19e458ec78ead8fffbf711f834ad8ecd2cc6ade4ec0320790713dccc0a412b99e7fd907c4cda2a1dc602c75db6f12e0108e87a5afad4b2f9e90a24cabd5a2 + languageName: node + linkType: hard + "tweetnacl-util@npm:^0.15.1": version: 0.15.1 resolution: "tweetnacl-util@npm:0.15.1"