From 1b5cfc330ae4cc0e200f870e8d32d88b4ff2ad87 Mon Sep 17 00:00:00 2001 From: vanjatomic Date: Tue, 18 Jul 2023 15:18:44 +0200 Subject: [PATCH 1/8] Add clauses builder implementation --- packages/ethers/src/index.ts | 5 ++- packages/vechain/src/ConnexProviderWrapper.ts | 18 +++++++- packages/vechain/src/clausesBuilder.ts | 42 +++++++++++++++++++ packages/vechain/src/index.ts | 2 +- 4 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 packages/vechain/src/clausesBuilder.ts diff --git a/packages/ethers/src/index.ts b/packages/ethers/src/index.ts index a4b14f6..7ae4c23 100644 --- a/packages/ethers/src/index.ts +++ b/packages/ethers/src/index.ts @@ -39,8 +39,11 @@ const modified = (provider: ConnexProviderWrapper) => { } return defaultSigner; } + modifiedProvider.getNetwork = () => { + return provider.getVechainNetwork(); + } - return modifiedProvider + return modifiedProvider; } extendEnvironment(hre => { diff --git a/packages/vechain/src/ConnexProviderWrapper.ts b/packages/vechain/src/ConnexProviderWrapper.ts index c22adb3..d812ffb 100644 --- a/packages/vechain/src/ConnexProviderWrapper.ts +++ b/packages/vechain/src/ConnexProviderWrapper.ts @@ -17,6 +17,7 @@ import { randomBytes } from "crypto"; import { TransactionRequest } from "@ethersproject/abstract-provider" import { VechainHardhatPluginError } from "./error"; import { Transaction } from "thor-devkit"; +import { Network } from "@ethersproject/networks"; export class ConnexProviderWrapper extends EventEmitter implements EthereumProvider { private _provider: Promise; @@ -24,8 +25,13 @@ export class ConnexProviderWrapper extends EventEmitter implements EthereumProvi private _verbose: boolean; private _log: debug.Debugger; - constructor(networkConfig: NetworkConfig, verbose: boolean) { + private readonly _networkConfig: NetworkConfig; + private readonly _networkName: string; + + constructor(networkConfig: NetworkConfig, verbose: boolean, networkName: string) { super(); + this._networkConfig = networkConfig; + this._networkName = networkName; this._log = debug("hardhat:vechain:provider"); this._verbose = verbose; this._wallet = createWallet(networkConfig); @@ -40,8 +46,18 @@ export class ConnexProviderWrapper extends EventEmitter implements EthereumProvi }); } + public async getVechainNetwork(): Promise { + const provider = await this._provider; + return { + name: this._networkName, + chainId: this._networkConfig.chainId!!, + _defaultProvider: (providers: any, options?: any) => provider + } + } + public async sign(transaction: Deferrable) { let key: Wallet.Key | undefined = undefined; + console.log(`This is the tx ${JSON.stringify(transaction)}`); const from = await transaction.from; if (this._wallet && from) { const keys = this._wallet.list; diff --git a/packages/vechain/src/clausesBuilder.ts b/packages/vechain/src/clausesBuilder.ts new file mode 100644 index 0000000..65fdb5f --- /dev/null +++ b/packages/vechain/src/clausesBuilder.ts @@ -0,0 +1,42 @@ +import {BaseContract} from "ethers"; +import {VechainHardhatPluginError} from "./error"; + +export interface Clause { + args: any[], + abi: string, + method: string +} + +export class ClausesBuilder { + private readonly clauses: Clause[] = []; + private readonly contract: BaseContract; + + constructor(contract: BaseContract) { + this.contract = contract; + } + + public withClause(clause: Clause): ClausesBuilder { + this.clauses.push(clause); + return this; + } + + + public async send(): Promise { + const net = await this.contract.provider.getNetwork(); + if (!net || !net['_defaultProvider']) { + throw new VechainHardhatPluginError('vechain hardhat plugin requires vechain network for clauses operation') + } + const provider = net._defaultProvider(null, null); + if (!provider) { + throw new VechainHardhatPluginError('vechain hardhat plugin requires vechain provider for clauses operation') + } + const processedClauses = this.clauses.map(clause => { + const abi = JSON.parse(clause.abi); + const functionAbi = abi.find((func: any) => func.type === 'function' && func.name === clause.method); + const method = provider.connex.thor.account(this.contract.address).method(functionAbi); + return method.asClause(clause.args); + }); + const signedTx = provider.connex.vendor.sign('tx', processedClauses); + return signedTx.request(); + } +} \ No newline at end of file diff --git a/packages/vechain/src/index.ts b/packages/vechain/src/index.ts index 3781208..ba312a5 100644 --- a/packages/vechain/src/index.ts +++ b/packages/vechain/src/index.ts @@ -6,7 +6,7 @@ extendEnvironment(hre => { if (!hre.network.name.includes("vechain")) { return; } - hre.vechain = lazyObject(() => new ConnexProviderWrapper(hre.network.config, hre.hardhatArguments.verbose)); + hre.vechain = lazyObject(() => new ConnexProviderWrapper(hre.network.config, hre.hardhatArguments.verbose, hre.network.name)); hre.network.provider = hre.vechain; }); From a399c961f6a694e65d55adb53af466871bab0f5e Mon Sep 17 00:00:00 2001 From: vanjatomic Date: Tue, 18 Jul 2023 16:01:24 +0200 Subject: [PATCH 2/8] Update tests --- .../test/ConnexProviderWrapper.test.ts | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/vechain/test/ConnexProviderWrapper.test.ts b/packages/vechain/test/ConnexProviderWrapper.test.ts index 28826ef..3025865 100644 --- a/packages/vechain/test/ConnexProviderWrapper.test.ts +++ b/packages/vechain/test/ConnexProviderWrapper.test.ts @@ -33,7 +33,7 @@ describe('index tests', () => { id: '' } }); - const connexProviderWrapper = new ConnexProviderWrapper(config, true); + const connexProviderWrapper = new ConnexProviderWrapper(config, true, 'vechain'); expect(connexProviderWrapper).toBeDefined(); }); @@ -44,13 +44,13 @@ describe('index tests', () => { id: '' } }); - const connexProviderWrapper = new ConnexProviderWrapper(config, true); + const connexProviderWrapper = new ConnexProviderWrapper(config, true, 'vechain'); expect(await connexProviderWrapper.disableDelegate()).toBeNull() }); it('create ConnexProviderWrapper and expect connection error', async () => { - const connexProviderWrapper = new ConnexProviderWrapper(config, true); + const connexProviderWrapper = new ConnexProviderWrapper(config, true, 'vechain'); try { await connexProviderWrapper.disableDelegate(); } catch (e: any) { @@ -65,7 +65,7 @@ describe('index tests', () => { id: '' } }); - const connexProviderWrapper = new ConnexProviderWrapper(config, true); + const connexProviderWrapper = new ConnexProviderWrapper(config, true, 'vechain'); const wallet = createWallet(config); const provider = createProvider(config, wallet); expect(connexProviderWrapper.setProvider(provider)).toBe(void 0); @@ -73,7 +73,7 @@ describe('index tests', () => { it('create ConnexProviderWrapper and set provider error', async () => { - const connexProviderWrapper = new ConnexProviderWrapper(config, true); + const connexProviderWrapper = new ConnexProviderWrapper(config, true, 'vechain'); const wallet = createWallet(config); const provider = createProvider(config, wallet); try { @@ -90,7 +90,7 @@ describe('index tests', () => { id: '' } }); - const connexProviderWrapper = new ConnexProviderWrapper(config, true); + const connexProviderWrapper = new ConnexProviderWrapper(config, true, 'vechain'); const wallet = createWallet(config); const provider = createProvider(config, wallet); connexProviderWrapper.setProvider(provider); @@ -108,7 +108,7 @@ describe('index tests', () => { id: '' } }); - const connexProviderWrapper = new ConnexProviderWrapper(config, true); + const connexProviderWrapper = new ConnexProviderWrapper(config, true, 'vechain'); const wallet = createWallet(config); const provider = createProvider(config, wallet); connexProviderWrapper.setProvider(provider); @@ -127,7 +127,7 @@ describe('index tests', () => { id: '' } }); - const connexProviderWrapper = new ConnexProviderWrapper(config, true); + const connexProviderWrapper = new ConnexProviderWrapper(config, true, 'vechain'); try { await connexProviderWrapper.send('testMethod', ['1']); } catch (e: any) { @@ -142,7 +142,7 @@ describe('index tests', () => { id: '' } }); - const connexProviderWrapper = new ConnexProviderWrapper(config, true); + const connexProviderWrapper = new ConnexProviderWrapper(config, true, 'vechain'); const wallet = createWallet(config); const provider = createProvider(config, wallet); connexProviderWrapper.setProvider(provider); @@ -174,7 +174,7 @@ describe('index tests', () => { id: '' } }); - const connexProviderWrapper = new ConnexProviderWrapper(config, true); + const connexProviderWrapper = new ConnexProviderWrapper(config, true, 'vechain'); const wallet = createWallet(config); const provider = createProvider(config, wallet); connexProviderWrapper.setProvider(provider); @@ -207,7 +207,7 @@ describe('index tests', () => { id: '' } }); - const connexProviderWrapper = new ConnexProviderWrapper(config, true); + const connexProviderWrapper = new ConnexProviderWrapper(config, true, 'vechain'); const wallet = createWallet(config); const provider = createProvider(config, wallet); connexProviderWrapper.setProvider(provider); @@ -243,7 +243,7 @@ describe('index tests', () => { it("fails with key not included in provider", async () => { const tx = { from: "" } - const connexProviderWrapper = new ConnexProviderWrapper(config, false) + const connexProviderWrapper = new ConnexProviderWrapper(config, false, 'vechain') expect(connexProviderWrapper.sign(tx)).rejects.toThrow('transaction.from: "" is not included in wallet'); }); @@ -254,7 +254,7 @@ describe('index tests', () => { jest.spyOn(resolved, 'request').mockResolvedValue(dummyResponse); }); - const connexProviderWrapper = new ConnexProviderWrapper(config, false); + const connexProviderWrapper = new ConnexProviderWrapper(config, false, 'vechain'); connexProviderWrapper.setProvider(provider); const tx = { From 93657672c6fa12c7411c86613a3dba723fd7c346 Mon Sep 17 00:00:00 2001 From: vanjatomic Date: Tue, 18 Jul 2023 18:34:45 +0200 Subject: [PATCH 3/8] Add tests --- .../test/ConnexProviderWrapper.test.ts | 20 ++- packages/vechain/test/clausesBuilder.test.ts | 147 ++++++++++++++++++ 2 files changed, 165 insertions(+), 2 deletions(-) create mode 100644 packages/vechain/test/clausesBuilder.test.ts diff --git a/packages/vechain/test/ConnexProviderWrapper.test.ts b/packages/vechain/test/ConnexProviderWrapper.test.ts index 3025865..8e1412a 100644 --- a/packages/vechain/test/ConnexProviderWrapper.test.ts +++ b/packages/vechain/test/ConnexProviderWrapper.test.ts @@ -1,9 +1,9 @@ import {HttpNetworkConfig, JsonRpcResponse} from "hardhat/types"; -import { ConnexProviderWrapper } from "../src/ConnexProviderWrapper"; import { Driver } from "@vechain/connex-driver"; import * as assert from "assert"; -import {createProvider} from "../src/helpers/createProvider"; +import { createProvider } from "../src/helpers/createProvider"; import { createWallet } from "../src/helpers/createWallet"; +import {ConnexProviderWrapper} from "../dist/ConnexProviderWrapper"; describe('index tests', () => { const thorSoloUrl = "http://127.0.0.1:8669"; @@ -265,6 +265,22 @@ describe('index tests', () => { }; expect(await connexProviderWrapper.sign(tx)).toMatch(/0x([0-9]|[a-f]|[A-F])+/); }); + + it("get vechain network", async () => { + const wallet = createWallet(config); + const provider = createProvider(config, wallet); + provider.then(resolved => { + jest.spyOn(resolved, 'request').mockResolvedValue(dummyResponse); + }); + + const connexProviderWrapper = new ConnexProviderWrapper(config, false, 'vechain'); + connexProviderWrapper.setProvider(provider); + + const network = await connexProviderWrapper.getVechainNetwork() + + expect(network.name).toEqual('vechain'); + expect(network.chainId).toEqual(1); + }); }) }); \ No newline at end of file diff --git a/packages/vechain/test/clausesBuilder.test.ts b/packages/vechain/test/clausesBuilder.test.ts new file mode 100644 index 0000000..f88715e --- /dev/null +++ b/packages/vechain/test/clausesBuilder.test.ts @@ -0,0 +1,147 @@ +import {HttpNetworkConfig, JsonRpcResponse} from "hardhat/types"; +import { createProvider } from "../src/helpers/createProvider"; +import { createWallet } from "../src/helpers/createWallet"; +import {ClausesBuilder} from "../dist/clausesBuilder"; +import {BaseContract} from "ethers"; + +describe('builder tests', () => { + + const thorSoloUrl = "http://127.0.0.1:8669"; + const dummyResponse = { + response: 'ok', + hash: '0x000015ce4dd3541ea6cd3bf6d328604d8e4d17747196f4c45e40d6b56d9ac5f2' + }; + const config = { + chainId: 1, + from: undefined, + gas: 10000, + gasPrice: 10000, + gasMultiplier: 1, + url: thorSoloUrl, + accounts: 'remote', + timeout: 1000, + httpHeaders: { ['test']: 'test'} as { [name: string]: string }, + } as unknown as HttpNetworkConfig; + + const expectedTxResponse = {"signer": "0xf077b491b355e64048ce21e3a6fc4751eeea77fa", "txid": "0xe85e3d3cc12f35223e8ec9dd2fb1e5d404136e7621b41fc6a6922aca9e12cf26"} + + it('should add clause', async () => { + + const baseContract = jest.fn().mockImplementation(() => { + return null; + }) as unknown as BaseContract; + + const clauseBuilder = new ClausesBuilder(baseContract); + const builderWithClause = clauseBuilder.withClause({ + args: [1], + abi: 'fakeAbi', + method: 'fakeMethod' + }) + expect(builderWithClause['clauses']).toEqual([{ abi: 'fakeAbi', args: [1], method: 'fakeMethod' }]); + }); + + it('should add two clauses', async () => { + + const baseContract = jest.fn().mockImplementation(() => { + return null; + }) as unknown as BaseContract; + + const clauseBuilder = new ClausesBuilder(baseContract); + const builderWithClause = clauseBuilder.withClause({ + args: [1], + abi: 'fakeAbi', + method: 'fakeMethod' + }).withClause({ + args: [2], + abi: 'fakeAbi2', + method: 'fakeMethod2' + }) + expect(builderWithClause['clauses']).toEqual([ + { abi: 'fakeAbi', args: [1], method: 'fakeMethod' }, + { abi: 'fakeAbi2', args: [2], method: 'fakeMethod2' } + ]); + }); + + it('should send transaction', async () => { + const wallet = createWallet(config); + const provider = createProvider(config, wallet); + provider.then(resolved => { + jest.spyOn(resolved, 'request').mockResolvedValue(dummyResponse); + }); + + + const connexProviderWrapper = { + connex: { + thor: { + account: jest.fn().mockImplementation(() => { + return { + method: jest.fn().mockImplementation( () => { + return { + asClause: jest.fn().mockImplementation( () => { + return {}; + }) + }; + }) + }; + }) + }, + vendor: { + sign: jest.fn().mockImplementation(() => { + return { + request: jest.fn().mockImplementation(() => { + return expectedTxResponse; + }) + }; + }) + } + } + } + + const baseContract = { + provider: { + getNetwork: jest.fn().mockImplementation( () => { + return { + _defaultProvider: (providers: any, options?: any) => connexProviderWrapper + } + }), + } + } as unknown as BaseContract; + + const clauseBuilder = new ClausesBuilder(baseContract); + const tx = await clauseBuilder.withClause({ + args: [1], + abi: JSON.stringify([{ type: 'function', name: 'fakeMethod'}] ), + method: 'fakeMethod' + }).send() + expect(tx).toEqual(expectedTxResponse); + }); + + it('should throw error', async () => { + const wallet = createWallet(config); + const provider = createProvider(config, wallet); + provider.then(resolved => { + jest.spyOn(resolved, 'request').mockResolvedValue(dummyResponse); + }); + const baseContract = { + provider: { + getNetwork: jest.fn().mockImplementation( () => { + return { + } + }), + } + } as unknown as BaseContract; + + const clauseBuilder = new ClausesBuilder(baseContract); + try { + await clauseBuilder.withClause({ + args: [1], + abi: JSON.stringify([{ type: 'function', name: 'fakeMethod'}] ), + method: 'fakeMethod' + }).send() + } catch (e) { + const error = e as Error; + expect(error.message).toEqual('vechain hardhat plugin requires vechain network for clauses operation') + } + }); + +}); \ No newline at end of file From 3458358ac1f6b77d442626209890c1734c109db4 Mon Sep 17 00:00:00 2001 From: vanjatomic Date: Tue, 18 Jul 2023 18:54:12 +0200 Subject: [PATCH 4/8] Pr comment fix, add logs, remove console add type --- packages/vechain/package.json | 4 +- packages/vechain/src/ConnexProviderWrapper.ts | 1 - packages/vechain/src/clausesBuilder.ts | 14 +- yarn.lock | 178 +++++++++++++++++- 4 files changed, 193 insertions(+), 4 deletions(-) diff --git a/packages/vechain/package.json b/packages/vechain/package.json index a80f551..624c4cf 100644 --- a/packages/vechain/package.json +++ b/packages/vechain/package.json @@ -33,7 +33,9 @@ "@vechain/web3-providers-connex": "^1.0.0", "debug": "^4.3.4", "ethers": "^5.7.2", - "thor-devkit": "^2.0.6" + "thor-devkit": "^2.0.6", + "pino": "8.14.1", + "pino-pretty": "9.4.0" }, "devDependencies": { "@types/debug": "^4.1.7", diff --git a/packages/vechain/src/ConnexProviderWrapper.ts b/packages/vechain/src/ConnexProviderWrapper.ts index d812ffb..bb7cf6c 100644 --- a/packages/vechain/src/ConnexProviderWrapper.ts +++ b/packages/vechain/src/ConnexProviderWrapper.ts @@ -57,7 +57,6 @@ export class ConnexProviderWrapper extends EventEmitter implements EthereumProvi public async sign(transaction: Deferrable) { let key: Wallet.Key | undefined = undefined; - console.log(`This is the tx ${JSON.stringify(transaction)}`); const from = await transaction.from; if (this._wallet && from) { const keys = this._wallet.list; diff --git a/packages/vechain/src/clausesBuilder.ts b/packages/vechain/src/clausesBuilder.ts index 65fdb5f..015e87a 100644 --- a/packages/vechain/src/clausesBuilder.ts +++ b/packages/vechain/src/clausesBuilder.ts @@ -1,5 +1,6 @@ import {BaseContract} from "ethers"; import {VechainHardhatPluginError} from "./error"; +import logger from 'pino'; export interface Clause { args: any[], @@ -11,6 +12,12 @@ export class ClausesBuilder { private readonly clauses: Clause[] = []; private readonly contract: BaseContract; + private log = logger({ + transport: { + target: 'pino-pretty' + } + }); + constructor(contract: BaseContract) { this.contract = contract; } @@ -21,13 +28,18 @@ export class ClausesBuilder { } - public async send(): Promise { + public async send(): Promise<{ + txid: string + signer: string + }> { const net = await this.contract.provider.getNetwork(); if (!net || !net['_defaultProvider']) { + this.log.error('Error while getting default provider for network'); throw new VechainHardhatPluginError('vechain hardhat plugin requires vechain network for clauses operation') } const provider = net._defaultProvider(null, null); if (!provider) { + this.log.error('Error while getting default provider for network'); throw new VechainHardhatPluginError('vechain hardhat plugin requires vechain provider for clauses operation') } const processedClauses = this.clauses.map(clause => { diff --git a/yarn.lock b/yarn.lock index 23b19f1..1e19166 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1765,6 +1765,11 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== +atomic-sleep@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" + integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ== + available-typed-arrays@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" @@ -2323,6 +2328,11 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +colorette@^2.0.7: + version "2.0.20" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" + integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== + combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -2475,6 +2485,11 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" +dateformat@^4.6.3: + version "4.6.3" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-4.6.3.tgz#556fa6497e5217fedb78821424f8a1c22fa3f4b5" + integrity sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA== + debug@2.6.9, debug@^2.2.0: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -2872,6 +2887,11 @@ eventemitter3@^4.0.4: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== +events@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + evp_bytestokey@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" @@ -2970,6 +2990,11 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== +fast-copy@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/fast-copy/-/fast-copy-3.0.1.tgz#9e89ef498b8c04c1cd76b33b8e14271658a732aa" + integrity sha512-Knr7NOtK3HWRYGtHoJrjkaWepqT8thIVGAwt0p0aUs1zqkAzXZV4vo9fFNwyb5fcqK1GKYFYxldQdIDVKhUAfA== + fast-deep-equal@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -2980,6 +3005,16 @@ fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-sta resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== +fast-redact@^3.1.1: + version "3.2.0" + resolved "https://registry.yarnpkg.com/fast-redact/-/fast-redact-3.2.0.tgz#b1e2d39bc731376d28bde844454fa23e26919987" + integrity sha512-zaTadChr+NekyzallAMXATXLOR8MNx3zqpZ0MUF2aGf4EathnG0f32VLODNlY8IuGY3HoRO2L6/6fSzNsLaHIw== + +fast-safe-stringify@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" + integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== + fb-watchman@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" @@ -3217,6 +3252,17 @@ glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^8.0.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" + integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + global@~4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" @@ -3410,6 +3456,14 @@ he@1.2.0: resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== +help-me@^4.0.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/help-me/-/help-me-4.2.0.tgz#50712bfd799ff1854ae1d312c36eafcea85b0563" + integrity sha512-TAOnTB8Tz5Dw8penUuzHVrKNKlCIbwwbHnXraNJxPwf8LRtE2HlM84RYuezMFcwOJmoYOCWVDyJ8TQGxn9PgxA== + dependencies: + glob "^8.0.0" + readable-stream "^3.6.0" + hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -4080,6 +4134,11 @@ jest@^29.5.0: import-local "^3.0.2" jest-cli "^29.5.0" +joycon@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.1.1.tgz#bce8596d6ae808f8b68168f5fc69280996894f03" + integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw== + js-sdsl@^4.1.4: version "4.4.1" resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.1.tgz#9e3c7b566d8d9a7e1fe8fc26d00b5ab0f8918ab3" @@ -4445,6 +4504,13 @@ minimatch@^3.0.4, minimatch@^3.1.1: dependencies: brace-expansion "^1.1.7" +minimatch@^5.0.1: + version "5.1.6" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" + integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== + dependencies: + brace-expansion "^2.0.1" + minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" @@ -4692,6 +4758,11 @@ oboe@2.1.5: dependencies: http-https "^1.0.0" +on-exit-leak-free@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/on-exit-leak-free/-/on-exit-leak-free-2.1.0.tgz#5c703c968f7e7f851885f6459bf8a8a57edc9cc4" + integrity sha512-VuCaZZAjReZ3vUwgOB8LxAosIurDiAW0s13rI1YwmaP++jvcxP77AWoQvenZebpCA2m8WC1/EosPYPMjnRAp/w== + on-finished@2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" @@ -4863,6 +4934,56 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +pino-abstract-transport@^1.0.0, pino-abstract-transport@v1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pino-abstract-transport/-/pino-abstract-transport-1.0.0.tgz#cc0d6955fffcadb91b7b49ef220a6cc111d48bb3" + integrity sha512-c7vo5OpW4wIS42hUVcT5REsL8ZljsUfBjqV/e2sFxmFEFZiq1XLUp5EYLtuDH6PEHq9W1egWqRbnLUP5FuZmOA== + dependencies: + readable-stream "^4.0.0" + split2 "^4.0.0" + +pino-pretty@9.4.0: + version "9.4.0" + resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-9.4.0.tgz#fc4026e83c87272cbdfb7afed121770e6000940c" + integrity sha512-NIudkNLxnl7MGj1XkvsqVyRgo6meFP82ECXF2PlOI+9ghmbGuBUUqKJ7IZPIxpJw4vhhSva0IuiDSAuGh6TV9g== + dependencies: + colorette "^2.0.7" + dateformat "^4.6.3" + fast-copy "^3.0.0" + fast-safe-stringify "^2.1.1" + help-me "^4.0.1" + joycon "^3.1.1" + minimist "^1.2.6" + on-exit-leak-free "^2.1.0" + pino-abstract-transport "^1.0.0" + pump "^3.0.0" + readable-stream "^4.0.0" + secure-json-parse "^2.4.0" + sonic-boom "^3.0.0" + strip-json-comments "^3.1.1" + +pino-std-serializers@^6.0.0: + version "6.2.2" + resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz#d9a9b5f2b9a402486a5fc4db0a737570a860aab3" + integrity sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA== + +pino@8.14.1: + version "8.14.1" + resolved "https://registry.yarnpkg.com/pino/-/pino-8.14.1.tgz#bb38dcda8b500dd90c1193b6c9171eb777a47ac8" + integrity sha512-8LYNv7BKWXSfS+k6oEc6occy5La+q2sPwU3q2ljTX5AZk7v+5kND2o5W794FyRaqha6DJajmkNRsWtPpFyMUdw== + dependencies: + atomic-sleep "^1.0.0" + fast-redact "^3.1.1" + on-exit-leak-free "^2.1.0" + pino-abstract-transport v1.0.0 + pino-std-serializers "^6.0.0" + process-warning "^2.0.0" + quick-format-unescaped "^4.0.3" + real-require "^0.2.0" + safe-stable-stringify "^2.3.1" + sonic-boom "^3.1.0" + thread-stream "^2.0.0" + pirates@^4.0.4: version "4.0.6" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" @@ -4884,6 +5005,11 @@ pretty-format@^29.0.0, pretty-format@^29.5.0: ansi-styles "^5.0.0" react-is "^18.0.0" +process-warning@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/process-warning/-/process-warning-2.2.0.tgz#008ec76b579820a8e5c35d81960525ca64feb626" + integrity sha512-/1WZ8+VQjR6avWOgHeEPd7SDQmFQ1B5mC1eRXsCm5TarlNmx/wCsa5GEaxGm05BORRtyG/Ex/3xq3TuRvq57qg== + process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" @@ -4959,6 +5085,11 @@ queue-microtask@^1.2.2, queue-microtask@^1.2.3: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== +quick-format-unescaped@^4.0.3: + version "4.0.4" + resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz#93ef6dd8d3453cbc7970dd614fad4c5954d6b5a7" + integrity sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg== + quick-lru@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" @@ -5010,6 +5141,17 @@ readable-stream@^3.6.0: string_decoder "^1.1.1" util-deprecate "^1.0.1" +readable-stream@^4.0.0: + version "4.4.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-4.4.2.tgz#e6aced27ad3b9d726d8308515b9a1b98dc1b9d13" + integrity sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA== + dependencies: + abort-controller "^3.0.0" + buffer "^6.0.3" + events "^3.3.0" + process "^0.11.10" + string_decoder "^1.3.0" + readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -5017,6 +5159,11 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" +real-require@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/real-require/-/real-require-0.2.0.tgz#209632dea1810be2ae063a6ac084fee7e33fba78" + integrity sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg== + request@^2.79.0: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" @@ -5142,6 +5289,11 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== +safe-stable-stringify@^2.3.1: + version "2.4.3" + resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz#138c84b6f6edb3db5f8ef3ef7115b8f55ccbf886" + integrity sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g== + "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -5166,6 +5318,11 @@ secp256k1@^4.0.1: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" +secure-json-parse@^2.4.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/secure-json-parse/-/secure-json-parse-2.7.0.tgz#5a5f9cd6ae47df23dba3151edd06855d47e09862" + integrity sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw== + semver@7.x, semver@^7.3.5: version "7.5.3" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" @@ -5318,6 +5475,13 @@ solc@0.7.3: semver "^5.5.0" tmp "0.0.33" +sonic-boom@^3.0.0, sonic-boom@^3.1.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-3.3.0.tgz#cffab6dafee3b2bcb88d08d589394198bee1838c" + integrity sha512-LYxp34KlZ1a2Jb8ZQgFCK3niIHzibdwtwNUWKg0qQRzsDoJ3Gfgkf8KdBTFU3SkejDEIlWwnSnpVdOZIhFMl/g== + dependencies: + atomic-sleep "^1.0.0" + source-map-support@0.5.13: version "0.5.13" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" @@ -5339,6 +5503,11 @@ source-map@^0.6.0, source-map@^0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +split2@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4" + integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -5405,7 +5574,7 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string_decoder@^1.1.1: +string_decoder@^1.1.1, string_decoder@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== @@ -5524,6 +5693,13 @@ thor-devkit@^2.0.4, thor-devkit@^2.0.5, thor-devkit@^2.0.6: js-sha3 "0.5.7" rlp "^2.0.0" +thread-stream@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/thread-stream/-/thread-stream-2.3.0.tgz#4fc07fb39eff32ae7bad803cb7dd9598349fed33" + integrity sha512-kaDqm1DET9pp3NXwR8382WHbnpXnRkN9xGN9dQt3B2+dmXiW8X1SOwmFOxAErEQ47ObhZ96J6yhZNXuyCOL7KA== + dependencies: + real-require "^0.2.0" + timed-out@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" From b2a057572114f7ee062a4936011d64a3ee95bd32 Mon Sep 17 00:00:00 2001 From: vanjatomic Date: Tue, 18 Jul 2023 19:02:05 +0200 Subject: [PATCH 5/8] Fix tests --- .github/workflows/common-unit-sonar.yml | 4 +++- packages/vechain/test/ConnexProviderWrapper.test.ts | 2 +- packages/vechain/test/clausesBuilder.test.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/common-unit-sonar.yml b/.github/workflows/common-unit-sonar.yml index fc9070f..6c5d559 100644 --- a/.github/workflows/common-unit-sonar.yml +++ b/.github/workflows/common-unit-sonar.yml @@ -32,7 +32,9 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Install dependencies - run: yarn install + run: | + yarn install + yarn build - name: Unit tests and coverage run: yarn workspace @vechain/hardhat-vechain test-coverage diff --git a/packages/vechain/test/ConnexProviderWrapper.test.ts b/packages/vechain/test/ConnexProviderWrapper.test.ts index 8e1412a..fb9f53c 100644 --- a/packages/vechain/test/ConnexProviderWrapper.test.ts +++ b/packages/vechain/test/ConnexProviderWrapper.test.ts @@ -3,7 +3,7 @@ import { Driver } from "@vechain/connex-driver"; import * as assert from "assert"; import { createProvider } from "../src/helpers/createProvider"; import { createWallet } from "../src/helpers/createWallet"; -import {ConnexProviderWrapper} from "../dist/ConnexProviderWrapper"; +import { ConnexProviderWrapper } from "../dist/ConnexProviderWrapper"; describe('index tests', () => { const thorSoloUrl = "http://127.0.0.1:8669"; diff --git a/packages/vechain/test/clausesBuilder.test.ts b/packages/vechain/test/clausesBuilder.test.ts index f88715e..638fb63 100644 --- a/packages/vechain/test/clausesBuilder.test.ts +++ b/packages/vechain/test/clausesBuilder.test.ts @@ -1,7 +1,7 @@ import {HttpNetworkConfig, JsonRpcResponse} from "hardhat/types"; import { createProvider } from "../src/helpers/createProvider"; import { createWallet } from "../src/helpers/createWallet"; -import {ClausesBuilder} from "../dist/clausesBuilder"; +import {ClausesBuilder} from "../src/clausesBuilder"; import {BaseContract} from "ethers"; describe('builder tests', () => { From 162b85a4f060ba35b32b3b2e7c03c641b311cdfa Mon Sep 17 00:00:00 2001 From: vanjatomic Date: Tue, 18 Jul 2023 19:15:59 +0200 Subject: [PATCH 6/8] Add docker compose for testing --- .github/workflows/common-unit-sonar.yml | 4 +++- packages/vechain/test/docker-compose.yaml | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 packages/vechain/test/docker-compose.yaml diff --git a/.github/workflows/common-unit-sonar.yml b/.github/workflows/common-unit-sonar.yml index 6c5d559..221d528 100644 --- a/.github/workflows/common-unit-sonar.yml +++ b/.github/workflows/common-unit-sonar.yml @@ -37,7 +37,9 @@ jobs: yarn build - name: Unit tests and coverage - run: yarn workspace @vechain/hardhat-vechain test-coverage + run: | + docker-compose -f packages/vechain/test/docker-compose.yaml up -d + yarn workspace @vechain/hardhat-vechain test-coverage - name: SonarCloud Scan uses: sonarsource/sonarcloud-github-action@master diff --git a/packages/vechain/test/docker-compose.yaml b/packages/vechain/test/docker-compose.yaml new file mode 100644 index 0000000..b102d83 --- /dev/null +++ b/packages/vechain/test/docker-compose.yaml @@ -0,0 +1,20 @@ +version: "3.7" +services: + thor-solo: + image: vechain/thor:v2.0.0 + hostname: thor-solo + container_name: thor-solo + environment: + - DOCKER=1 + entrypoint: + [ + "/bin/sh", + "-c", + "apk update && apk upgrade && apk add curl && thor solo --on-demand --data-dir /data/thor --api-addr 0.0.0.0:8669 --api-cors '*' --api-backtrace-limit -1 --verbosity 4", + ] + ports: + - "8669:8669" + healthcheck: + test: curl --fail 0.0.0.0:8669/blocks/0 || exit 1 + interval: "2s" + retries: 30 \ No newline at end of file From 37a1408939d2dbf9d472d90d96c70348363398ef Mon Sep 17 00:00:00 2001 From: vanjatomic Date: Tue, 18 Jul 2023 19:26:19 +0200 Subject: [PATCH 7/8] Fix open handles --- packages/vechain/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vechain/package.json b/packages/vechain/package.json index 624c4cf..7ae5f7d 100644 --- a/packages/vechain/package.json +++ b/packages/vechain/package.json @@ -25,7 +25,7 @@ "prepack": "yarn build", "clean": "git clean -dfX", "test": "cross-env TESTING=1 yarn node --experimental-vm-modules --no-warnings $(yarn bin jest) --runInBand --forceExit", - "test-coverage": "cross-env TESTING=1 yarn node --experimental-vm-modules --no-warnings $(yarn bin jest) --runInBand --detectOpenHandles --coverage" + "test-coverage": "cross-env TESTING=1 yarn node --experimental-vm-modules --no-warnings $(yarn bin jest) --runInBand --forceExit --coverage" }, "dependencies": { "@vechain/connex-driver": "^2.0.12", From 520af21b7e080ac49e043666b590974a2bdf7414 Mon Sep 17 00:00:00 2001 From: vanjatomic Date: Mon, 24 Jul 2023 09:58:33 +0200 Subject: [PATCH 8/8] Fix test --- packages/vechain/test/ConnexProviderWrapper.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vechain/test/ConnexProviderWrapper.test.ts b/packages/vechain/test/ConnexProviderWrapper.test.ts index fb9f53c..23692e9 100644 --- a/packages/vechain/test/ConnexProviderWrapper.test.ts +++ b/packages/vechain/test/ConnexProviderWrapper.test.ts @@ -3,7 +3,7 @@ import { Driver } from "@vechain/connex-driver"; import * as assert from "assert"; import { createProvider } from "../src/helpers/createProvider"; import { createWallet } from "../src/helpers/createWallet"; -import { ConnexProviderWrapper } from "../dist/ConnexProviderWrapper"; +import { ConnexProviderWrapper } from "../src/ConnexProviderWrapper"; describe('index tests', () => { const thorSoloUrl = "http://127.0.0.1:8669";