diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-03-05 11:05:26 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-03-12 10:37:27 +0800 |
commit | 13299158d1e22d1af1cd36434fc403a74743ecb1 (patch) | |
tree | 9b35435c6f8641d2dc3d7bfd530c7c4f040a1f51 /packages/subproviders/test/unit | |
parent | a6571b09d2087ffb9a4860c0db3d7344321fe2c3 (diff) | |
download | dexon-sol-tools-13299158d1e22d1af1cd36434fc403a74743ecb1.tar.gz dexon-sol-tools-13299158d1e22d1af1cd36434fc403a74743ecb1.tar.zst dexon-sol-tools-13299158d1e22d1af1cd36434fc403a74743ecb1.zip |
Add sol-cover implementation
Diffstat (limited to 'packages/subproviders/test/unit')
-rw-r--r-- | packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts b/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts index e98d9023c..14176c145 100644 --- a/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts +++ b/packages/subproviders/test/unit/nonce_tracker_subprovider_test.ts @@ -1,9 +1,11 @@ import * as chai from 'chai'; +import * as fs from 'fs'; import * as _ from 'lodash'; +import * as path from 'path'; import Web3ProviderEngine = require('web3-provider-engine'); import FixtureSubprovider = require('web3-provider-engine/subproviders/fixture'); -import promisify = require('es6-promisify'); +import { promisify } from '@0xproject/utils'; import EthereumTx = require('ethereumjs-tx'); import { NonceTrackerSubprovider } from '../../src'; @@ -62,9 +64,9 @@ describe('NonceTrackerSubprovider', () => { const payload = { ...getTransactionCountPayload, params: ['0x0', 'pending'] }; - const response = await promisify(provider.sendAsync, provider)(payload); + const response = await promisify<any>(provider.sendAsync, provider)(payload); expect(response.result).to.be.eq('0x00'); - const secondResponse = await promisify(provider.sendAsync, provider)(payload); + const secondResponse = await promisify<any>(provider.sendAsync, provider)(payload); expect(secondResponse.result).to.be.eq('0x00'); }); it('does not cache the result for latest transaction count', async () => { @@ -76,9 +78,9 @@ describe('NonceTrackerSubprovider', () => { const payload = { ...getTransactionCountPayload, params: ['0x0', 'latest'] }; - const response = await promisify(provider.sendAsync, provider)(payload); + const response = await promisify<any>(provider.sendAsync, provider)(payload); expect(response.result).to.be.eq('0x00'); - const secondResponse = await promisify(provider.sendAsync, provider)(payload); + const secondResponse = await promisify<any>(provider.sendAsync, provider)(payload); expect(secondResponse.result).to.be.eq('0x99'); }); it('clears the cache on a Nonce Too Low Error', async () => { @@ -105,14 +107,14 @@ describe('NonceTrackerSubprovider', () => { params: [transaction.serialize()], }; - const response = await promisify(provider.sendAsync, provider)(noncePayload); + const response = await promisify<any>(provider.sendAsync, provider)(noncePayload); expect(response.result).to.be.eq('0x00'); - const secondResponse = await promisify(provider.sendAsync, provider)(noncePayload); + const secondResponse = await promisify<any>(provider.sendAsync, provider)(noncePayload); expect(secondResponse.result).to.be.eq('0x00'); try { await promisify(provider.sendAsync, provider)(txPayload); } catch (err) { - const thirdResponse = await promisify(provider.sendAsync, provider)(noncePayload); + const thirdResponse = await promisify<any>(provider.sendAsync, provider)(noncePayload); expect(thirdResponse.result).to.be.eq('0x99'); } }); @@ -140,12 +142,12 @@ describe('NonceTrackerSubprovider', () => { params: [transaction.serialize()], }; - const response = await promisify(provider.sendAsync, provider)(noncePayload); + const response = await promisify<any>(provider.sendAsync, provider)(noncePayload); expect(response.result).to.be.eq('0x00'); - const secondResponse = await promisify(provider.sendAsync, provider)(noncePayload); + const secondResponse = await promisify<any>(provider.sendAsync, provider)(noncePayload); expect(secondResponse.result).to.be.eq('0x00'); await promisify(provider.sendAsync, provider)(txPayload); - const thirdResponse = await promisify(provider.sendAsync, provider)(noncePayload); + const thirdResponse = await promisify<any>(provider.sendAsync, provider)(noncePayload); expect(thirdResponse.result).to.be.eq('0x01'); }); }); |