aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dev-utils/src/web3_factory.ts
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-06-07 07:36:11 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-06-07 07:36:11 +0800
commite0d5b9daf84cba31bbbcd2cfbe1f64623eace61a (patch)
tree84929c7ae4e95896dacfb69517aaaba97ec8ad85 /packages/dev-utils/src/web3_factory.ts
parenta97d77064aacda3de74b04894f110b05298c5ca8 (diff)
parent785b9811f30869f01242ce9ff81c282bf7f5352f (diff)
downloaddexon-0x-contracts-e0d5b9daf84cba31bbbcd2cfbe1f64623eace61a.tar
dexon-0x-contracts-e0d5b9daf84cba31bbbcd2cfbe1f64623eace61a.tar.gz
dexon-0x-contracts-e0d5b9daf84cba31bbbcd2cfbe1f64623eace61a.tar.bz2
dexon-0x-contracts-e0d5b9daf84cba31bbbcd2cfbe1f64623eace61a.tar.lz
dexon-0x-contracts-e0d5b9daf84cba31bbbcd2cfbe1f64623eace61a.tar.xz
dexon-0x-contracts-e0d5b9daf84cba31bbbcd2cfbe1f64623eace61a.tar.zst
dexon-0x-contracts-e0d5b9daf84cba31bbbcd2cfbe1f64623eace61a.zip
Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/improve-linting
Diffstat (limited to 'packages/dev-utils/src/web3_factory.ts')
-rw-r--r--packages/dev-utils/src/web3_factory.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/dev-utils/src/web3_factory.ts b/packages/dev-utils/src/web3_factory.ts
index 4e30007a7..47eef4cbd 100644
--- a/packages/dev-utils/src/web3_factory.ts
+++ b/packages/dev-utils/src/web3_factory.ts
@@ -17,16 +17,22 @@ export interface Web3Config {
hasAddresses?: boolean; // default: true
shouldUseInProcessGanache?: boolean; // default: false
rpcUrl?: string; // default: localhost:8545
+ shouldUseFakeGasEstimate?: boolean; // default: true
}
export const web3Factory = {
getRpcProvider(config: Web3Config = {}): ProviderEngine {
const provider = new ProviderEngine();
const hasAddresses = _.isUndefined(config.hasAddresses) || config.hasAddresses;
+ config.shouldUseFakeGasEstimate =
+ _.isUndefined(config.shouldUseFakeGasEstimate) || config.shouldUseFakeGasEstimate;
if (!hasAddresses) {
provider.addProvider(new EmptyWalletSubprovider());
}
- provider.addProvider(new FakeGasEstimateSubprovider(constants.GAS_LIMIT));
+
+ if (config.shouldUseFakeGasEstimate) {
+ provider.addProvider(new FakeGasEstimateSubprovider(constants.GAS_LIMIT));
+ }
const logger = {
log: (arg: any) => {
fs.appendFileSync('ganache.log', `${arg}\n`);