Remove default value for gasPrice

This commit is contained in:
Leonid Logvinov
2017-08-25 12:10:56 +02:00
parent dcfc0ecac6
commit 5b60d9f0f4
6 changed files with 6 additions and 9 deletions

View File

@@ -164,9 +164,6 @@ export class ZeroEx {
*/
constructor(provider: Web3Provider, gasPrice?: BigNumber.BigNumber) {
this._web3Wrapper = new Web3Wrapper(provider);
if (_.isUndefined(gasPrice)) {
gasPrice = this._web3Wrapper.toWei(new BigNumber(21), 'gwei');
}
this.token = new TokenWrapper(this._web3Wrapper, gasPrice);
this.proxy = new TokenTransferProxyWrapper(this._web3Wrapper, gasPrice);
this.exchange = new ExchangeWrapper(this._web3Wrapper, this.token, gasPrice);

View File

@@ -6,8 +6,8 @@ import {utils} from '../utils/utils';
export class ContractWrapper {
protected _web3Wrapper: Web3Wrapper;
private _gasPrice: BigNumber.BigNumber;
constructor(web3Wrapper: Web3Wrapper, gasPrice: BigNumber.BigNumber) {
private _gasPrice?: BigNumber.BigNumber;
constructor(web3Wrapper: Web3Wrapper, gasPrice?: BigNumber.BigNumber) {
this._web3Wrapper = web3Wrapper;
this._gasPrice = gasPrice;
}

View File

@@ -13,7 +13,7 @@ import * as EtherTokenArtifacts from '../artifacts/EtherToken.json';
export class EtherTokenWrapper extends ContractWrapper {
private _etherTokenContractIfExists?: EtherTokenContract;
private _tokenWrapper: TokenWrapper;
constructor(web3Wrapper: Web3Wrapper, tokenWrapper: TokenWrapper, gasPrice: BigNumber.BigNumber) {
constructor(web3Wrapper: Web3Wrapper, tokenWrapper: TokenWrapper, gasPrice?: BigNumber.BigNumber) {
super(web3Wrapper, gasPrice);
this._tokenWrapper = tokenWrapper;
}

View File

@@ -73,7 +73,7 @@ export class ExchangeWrapper extends ContractWrapper {
];
return [orderAddresses, orderValues];
}
constructor(web3Wrapper: Web3Wrapper, tokenWrapper: TokenWrapper, gasPrice: BigNumber.BigNumber) {
constructor(web3Wrapper: Web3Wrapper, tokenWrapper: TokenWrapper, gasPrice?: BigNumber.BigNumber) {
super(web3Wrapper, gasPrice);
this._tokenWrapper = tokenWrapper;
this._orderValidationUtils = new OrderValidationUtils(tokenWrapper, this);

View File

@@ -11,7 +11,7 @@ import * as TokenRegistryArtifacts from '../artifacts/TokenRegistry.json';
*/
export class TokenRegistryWrapper extends ContractWrapper {
private _tokenRegistryContractIfExists?: TokenRegistryContract;
constructor(web3Wrapper: Web3Wrapper, gasPrice: BigNumber.BigNumber) {
constructor(web3Wrapper: Web3Wrapper, gasPrice?: BigNumber.BigNumber) {
super(web3Wrapper, gasPrice);
}
/**

View File

@@ -31,7 +31,7 @@ export class TokenWrapper extends ContractWrapper {
public UNLIMITED_ALLOWANCE_IN_BASE_UNITS = constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS;
private _tokenContractsByAddress: {[address: string]: TokenContract};
private _tokenLogEventEmitters: ContractEventEmitter[];
constructor(web3Wrapper: Web3Wrapper, gasPrice: BigNumber.BigNumber) {
constructor(web3Wrapper: Web3Wrapper, gasPrice?: BigNumber.BigNumber) {
super(web3Wrapper, gasPrice);
this._tokenContractsByAddress = {};
this._tokenLogEventEmitters = [];