Add default gasPrice to web3Wrapper instance and TransactionFactory

This commit is contained in:
Amir Bandeali 2019-08-20 16:48:13 -07:00
parent 23dd711396
commit 2b1e0be4fc
3 changed files with 5 additions and 0 deletions

View File

@ -68,4 +68,5 @@ export const constants = {
ONE_ETHER: new BigNumber(1e18),
EIP712_DOMAIN_NAME: '0x Protocol',
EIP712_DOMAIN_VERSION: '3.0.0',
DEFAULT_GAS_PRICE: 1,
};

View File

@ -4,6 +4,7 @@ import { BigNumber } from '@0x/utils';
import * as ethUtil from 'ethereumjs-util';
import { getLatestBlockTimestampAsync } from './block_timestamp';
import { constants } from './constants';
import { signingUtils } from './signing_utils';
export class TransactionFactory {
@ -34,6 +35,7 @@ export class TransactionFactory {
signerAddress,
data: customTransactionParams.data,
expirationTimeSeconds: new BigNumber(currentBlockTimestamp).plus(tenMinutesInSeconds),
gasPrice: new BigNumber(constants.DEFAULT_GAS_PRICE),
domain: {
verifyingContractAddress: this._exchangeAddress,
chainId: this._chainId,

View File

@ -4,6 +4,7 @@ import { logUtils } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import { constants } from './constants';
import { coverage } from './coverage';
import { profiler } from './profiler';
import { revertTrace } from './revert_trace';
@ -31,6 +32,7 @@ switch (process.env.TEST_PROVIDER) {
const ganacheTxDefaults = {
from: devConstants.TESTRPC_FIRST_ADDRESS,
gas: devConstants.GAS_LIMIT,
gasPrice: constants.DEFAULT_GAS_PRICE,
};
const gethTxDefaults = {
from: devConstants.TESTRPC_FIRST_ADDRESS,