aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-08-29 16:03:00 +0800
committerGitHub <noreply@github.com>2017-08-29 16:03:00 +0800
commit07a872f80213a71d17d61a47e7faeee0e87d1822 (patch)
tree8d29f3f7c180400f48b2b0f150ed603729cc061f /src/contract_wrappers
parent05ce9733dadd1f83afa2d96ff55a23cd1477216d (diff)
parent9516a50f645587bcc79ec5e17b8a353221f1d7e2 (diff)
downloaddexon-sol-tools-07a872f80213a71d17d61a47e7faeee0e87d1822.tar
dexon-sol-tools-07a872f80213a71d17d61a47e7faeee0e87d1822.tar.gz
dexon-sol-tools-07a872f80213a71d17d61a47e7faeee0e87d1822.tar.bz2
dexon-sol-tools-07a872f80213a71d17d61a47e7faeee0e87d1822.tar.lz
dexon-sol-tools-07a872f80213a71d17d61a47e7faeee0e87d1822.tar.xz
dexon-sol-tools-07a872f80213a71d17d61a47e7faeee0e87d1822.tar.zst
dexon-sol-tools-07a872f80213a71d17d61a47e7faeee0e87d1822.zip
Merge pull request #139 from 0xProject/feature/gas-price-config
Gas price config
Diffstat (limited to 'src/contract_wrappers')
-rw-r--r--src/contract_wrappers/contract_wrapper.ts7
-rw-r--r--src/contract_wrappers/ether_token_wrapper.ts4
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts4
-rw-r--r--src/contract_wrappers/token_registry_wrapper.ts4
-rw-r--r--src/contract_wrappers/token_wrapper.ts4
5 files changed, 14 insertions, 9 deletions
diff --git a/src/contract_wrappers/contract_wrapper.ts b/src/contract_wrappers/contract_wrapper.ts
index 7efa229a5..28df82cee 100644
--- a/src/contract_wrappers/contract_wrapper.ts
+++ b/src/contract_wrappers/contract_wrapper.ts
@@ -6,11 +6,16 @@ import {utils} from '../utils/utils';
export class ContractWrapper {
protected _web3Wrapper: Web3Wrapper;
- constructor(web3Wrapper: Web3Wrapper) {
+ private _gasPrice?: BigNumber.BigNumber;
+ constructor(web3Wrapper: Web3Wrapper, gasPrice?: BigNumber.BigNumber) {
this._web3Wrapper = web3Wrapper;
+ this._gasPrice = gasPrice;
}
protected async _instantiateContractIfExistsAsync(artifact: Artifact, address?: string): Promise<ContractInstance> {
const c = await contract(artifact);
+ c.defaults({
+ gasPrice: this._gasPrice,
+ });
const providerObj = this._web3Wrapper.getCurrentProvider();
c.setProvider(providerObj);
diff --git a/src/contract_wrappers/ether_token_wrapper.ts b/src/contract_wrappers/ether_token_wrapper.ts
index ee0ac2d8c..3c282510f 100644
--- a/src/contract_wrappers/ether_token_wrapper.ts
+++ b/src/contract_wrappers/ether_token_wrapper.ts
@@ -13,8 +13,8 @@ import * as EtherTokenArtifacts from '../artifacts/EtherToken.json';
export class EtherTokenWrapper extends ContractWrapper {
private _etherTokenContractIfExists?: EtherTokenContract;
private _tokenWrapper: TokenWrapper;
- constructor(web3Wrapper: Web3Wrapper, tokenWrapper: TokenWrapper) {
- super(web3Wrapper);
+ constructor(web3Wrapper: Web3Wrapper, tokenWrapper: TokenWrapper, gasPrice?: BigNumber.BigNumber) {
+ super(web3Wrapper, gasPrice);
this._tokenWrapper = tokenWrapper;
}
/**
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index a01940f4b..d09df236b 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -73,8 +73,8 @@ export class ExchangeWrapper extends ContractWrapper {
];
return [orderAddresses, orderValues];
}
- constructor(web3Wrapper: Web3Wrapper, tokenWrapper: TokenWrapper) {
- super(web3Wrapper);
+ constructor(web3Wrapper: Web3Wrapper, tokenWrapper: TokenWrapper, gasPrice?: BigNumber.BigNumber) {
+ super(web3Wrapper, gasPrice);
this._tokenWrapper = tokenWrapper;
this._orderValidationUtils = new OrderValidationUtils(tokenWrapper, this);
this._exchangeLogEventEmitters = [];
diff --git a/src/contract_wrappers/token_registry_wrapper.ts b/src/contract_wrappers/token_registry_wrapper.ts
index 5fee1304e..822e69460 100644
--- a/src/contract_wrappers/token_registry_wrapper.ts
+++ b/src/contract_wrappers/token_registry_wrapper.ts
@@ -11,8 +11,8 @@ import * as TokenRegistryArtifacts from '../artifacts/TokenRegistry.json';
*/
export class TokenRegistryWrapper extends ContractWrapper {
private _tokenRegistryContractIfExists?: TokenRegistryContract;
- constructor(web3Wrapper: Web3Wrapper) {
- super(web3Wrapper);
+ constructor(web3Wrapper: Web3Wrapper, gasPrice?: BigNumber.BigNumber) {
+ super(web3Wrapper, gasPrice);
}
/**
* Retrieves all the tokens currently listed in the Token Registry smart contract
diff --git a/src/contract_wrappers/token_wrapper.ts b/src/contract_wrappers/token_wrapper.ts
index 51490359e..f7070f1f4 100644
--- a/src/contract_wrappers/token_wrapper.ts
+++ b/src/contract_wrappers/token_wrapper.ts
@@ -31,8 +31,8 @@ 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) {
- super(web3Wrapper);
+ constructor(web3Wrapper: Web3Wrapper, gasPrice?: BigNumber.BigNumber) {
+ super(web3Wrapper, gasPrice);
this._tokenContractsByAddress = {};
this._tokenLogEventEmitters = [];
}