Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Commit 7e0f9a5

Browse files
authored
fix: fix nonce issue (#351)
* chore: hack in log lines Signed-off-by: Andres Olave <[email protected]> * chore: no-console Signed-off-by: Andres Olave <[email protected]> * test: add wait between each test for nonce to settle Signed-off-by: Andres Olave <[email protected]> * test: create a default timeout value of 7s instead of 5s Signed-off-by: Andres Olave <[email protected]> * chore: remove console Signed-off-by: Andres Olave <[email protected]> * fix: add wait(1000) where needed Signed-off-by: Andres Olave <[email protected]> --------- Signed-off-by: Andres Olave <[email protected]>
1 parent b27b0fd commit 7e0f9a5

File tree

8 files changed

+32
-1
lines changed

8 files changed

+32
-1
lines changed

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ module.exports = {
1818
'!**/migrations/**',
1919
],
2020
verbose: true,
21+
testTimeout: 7000,
2122
};

packages/base-contract-io/test/contract.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const {
2626
toEthereumAddress,
2727
} = require('@velocitycareerlabs/blockchain-functions');
2828

29+
const { wait } = require('@velocitycareerlabs/common-functions');
2930
const testEventsAbi = require('./data/test-events-abi.json');
3031
const { initContractClient, initProvider } = require('../index');
3132
const { deployContract } = require('./helpers/deployContract');
@@ -52,6 +53,10 @@ describe('Contract Client Test Suite', () => {
5253
await mongoFactoryWrapper('test-contract', context);
5354
});
5455

56+
afterEach(async () => {
57+
await wait(1000);
58+
});
59+
5560
afterAll(async () => {
5661
await mongoCloseWrapper();
5762
});

packages/base-contract-io/test/mock-contract.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const { generateKeyPair } = require('@velocitycareerlabs/crypto');
2323
const { env: config } = require('@spencejs/spence-config');
2424
const console = require('console');
2525

26+
const { wait } = require('@velocitycareerlabs/common-functions');
2627
const testEventsAbi = require('./data/test-events-abi.json');
2728

2829
const { initContractClient, initProvider } = require('../index');
@@ -45,6 +46,10 @@ describe('Mocked Contract Client Test Suite', () => {
4546

4647
beforeAll(async () => {});
4748

49+
afterEach(async () => {
50+
await wait(1000);
51+
});
52+
4853
afterAll(async () => {});
4954

5055
beforeEach(() => {

packages/contract-permissions/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"lint:fix": "eslint --fix --ext .js ."
1616
},
1717
"devDependencies": {
18+
"@velocitycareerlabs/common-functions": "0.5.0-build",
1819
"@velocitycareerlabs/tests-helpers": "0.5.0-build",
1920
"@spencejs/spence-config": "0.10.2",
2021
"@velocitycareerlabs/blockchain-functions": "0.5.0-build",

packages/contract-permissions/test/permissions.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const {
2424
mongoCloseWrapper,
2525
} = require('@velocitycareerlabs/tests-helpers');
2626
const { env } = require('@spencejs/spence-config');
27+
const { wait } = require('@velocitycareerlabs/common-functions');
2728
const {
2829
deployTestPermissionsContract,
2930
} = require('./helpers/deploy-test-permissions-contract');
@@ -87,6 +88,10 @@ describe('Permissions Contract Test Suite', () => {
8788
);
8889
});
8990

91+
afterEach(async () => {
92+
await wait(1000);
93+
});
94+
9095
afterAll(async () => {
9196
await mongoCloseWrapper();
9297
});

packages/metadata-registration/test/metadata-registry.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const {
3232
const { env } = require('@spencejs/spence-config');
3333
const console = require('console');
3434

35-
const { mapWithIndex } = require('@velocitycareerlabs/common-functions');
35+
const { mapWithIndex, wait } = require('@velocitycareerlabs/common-functions');
3636
const {
3737
deployPermissionContract,
3838
deployVerificationCouponContract,
@@ -204,6 +204,10 @@ describe('Metadata Registry', () => {
204204
);
205205
});
206206

207+
afterEach(async () => {
208+
await wait(1000);
209+
});
210+
207211
afterAll(async () => {
208212
await mongoCloseWrapper();
209213
});

packages/metadata-registration/test/revocation-registry.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const {
2727
toEthereumAddress,
2828
} = require('@velocitycareerlabs/blockchain-functions');
2929
const { initPermissions } = require('@velocitycareerlabs/contract-permissions');
30+
const { wait } = require('@velocitycareerlabs/common-functions');
3031
const initRevocationRegistry = require('../src/revocation-registry');
3132
const {
3233
deployPermissionContract,
@@ -62,6 +63,10 @@ describe('Revocation Registry', () => {
6263
revocationRegistry = await createRevocationRegistryWallet(operatorKeyPair);
6364
});
6465

66+
afterEach(async () => {
67+
await wait(1000);
68+
});
69+
6570
afterAll(async () => {
6671
await mongoCloseWrapper();
6772
});

packages/metadata-registration/test/verification-coupon.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const {
2929
const { env } = require('@spencejs/spence-config');
3030
const console = require('console');
3131

32+
const { wait } = require('@velocitycareerlabs/common-functions');
3233
const { initVerificationCoupon } = require('../index');
3334
const {
3435
deployPermissionContract,
@@ -91,6 +92,10 @@ describe('Verification Coupon', () => {
9192
verificationCoupon = await initVerificationCouponClient();
9293
});
9394

95+
afterEach(async () => {
96+
await wait(1000);
97+
});
98+
9499
afterAll(async () => {
95100
await mongoCloseWrapper();
96101
});

0 commit comments

Comments
 (0)