diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-08-30 00:41:14 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-08-30 00:41:14 +0800 |
commit | e5bb3bc75eb2fe0e2a4adbd99d64362c305bdd3e (patch) | |
tree | 5c358d025c3e9a8b66bbed5ccf9451fdbfb5df60 /test/utils | |
parent | 3f99281309a1a63b52228dd3c787d82971e8ce45 (diff) | |
download | dexon-0x-contracts-e5bb3bc75eb2fe0e2a4adbd99d64362c305bdd3e.tar.gz dexon-0x-contracts-e5bb3bc75eb2fe0e2a4adbd99d64362c305bdd3e.tar.zst dexon-0x-contracts-e5bb3bc75eb2fe0e2a4adbd99d64362c305bdd3e.zip |
Add web3@1.0 to web3Factory
Diffstat (limited to 'test/utils')
-rw-r--r-- | test/utils/web3_factory.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/utils/web3_factory.ts b/test/utils/web3_factory.ts index b20070c74..863fa1d07 100644 --- a/test/utils/web3_factory.ts +++ b/test/utils/web3_factory.ts @@ -6,6 +6,7 @@ import ProviderEngine = require('web3-provider-engine'); import RpcSubprovider = require('web3-provider-engine/subproviders/rpc'); import * as Web3 from 'web3'; +import * as Web3_beta from 'web3_beta'; import {constants} from './constants'; import {EmptyWalletSubProvider} from '../../src/subproviders/empty_wallet_subprovider'; @@ -16,6 +17,12 @@ export const web3Factory = { web3.setProvider(provider); return web3; }, + createBeta(): any { + const provider_beta = this.getProviderBeta(); + const web3_beta = new Web3_beta(); + web3_beta.setProvider(provider_beta); + return web3_beta; + }, getRpcProvider(hasAddresses: boolean = true): Web3.Provider { const provider = new ProviderEngine(); const rpcUrl = `http://${constants.RPC_HOST}:${constants.RPC_PORT}`; @@ -28,4 +35,9 @@ export const web3Factory = { provider.start(); return provider; }, + getProviderBeta(): any { + const rpcUrl = `http://${constants.RPC_HOST}:${constants.RPC_PORT}`; + const providerBeta = new Web3_beta.providers.HttpProvider(rpcUrl); + return providerBeta; + }, }; |