aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/util
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-03-02 05:04:55 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-03-02 05:04:55 +0800
commit0c16f0ea221d65e66942c27a69dda1c54f49e775 (patch)
tree5530d18fcd6e6c5e15272de3cb915fc2025c01bf /packages/contracts/util
parent003d43b03ae373ca24d6d728ffa6b0f2dfcda79a (diff)
parent451a0dacbe85d7a0d16ef007c1eb945a4c1977cb (diff)
downloaddexon-sol-tools-0c16f0ea221d65e66942c27a69dda1c54f49e775.tar
dexon-sol-tools-0c16f0ea221d65e66942c27a69dda1c54f49e775.tar.gz
dexon-sol-tools-0c16f0ea221d65e66942c27a69dda1c54f49e775.tar.bz2
dexon-sol-tools-0c16f0ea221d65e66942c27a69dda1c54f49e775.tar.lz
dexon-sol-tools-0c16f0ea221d65e66942c27a69dda1c54f49e775.tar.xz
dexon-sol-tools-0c16f0ea221d65e66942c27a69dda1c54f49e775.tar.zst
dexon-sol-tools-0c16f0ea221d65e66942c27a69dda1c54f49e775.zip
Merge branch 'development' into feature/sra-reporter
* development: (71 commits) Set max to 2 ETH/2 ZRX Add missing types from website Add dependencies Update the README Move BaseContract to its own package Upgrate prettier remove unused import Move more configs into docsInfo and remove logic that does not belong there elsewhere Fix a bug with displaying solidity functions returning multiple return values Add ethers-contracts as a dependency Include types for ethers-contracts Fix the version Include types for ethers-contracts Rename idx to i Remove tslint disable Move BaseContract to web3Wrapper Merge ifs Fix an option description Add link to the docs Improve CHANGELOG entry ...
Diffstat (limited to 'packages/contracts/util')
-rw-r--r--packages/contracts/util/balances.ts2
-rw-r--r--packages/contracts/util/exchange_wrapper.ts10
-rw-r--r--packages/contracts/util/token_registry_wrapper.ts12
-rw-r--r--packages/contracts/util/types.ts4
4 files changed, 15 insertions, 13 deletions
diff --git a/packages/contracts/util/balances.ts b/packages/contracts/util/balances.ts
index 0abc305d8..d03d4b3c5 100644
--- a/packages/contracts/util/balances.ts
+++ b/packages/contracts/util/balances.ts
@@ -17,7 +17,7 @@ export class Balances {
const balancesByOwner: BalancesByOwner = {};
for (const tokenContractInstance of this._tokenContractInstances) {
for (const ownerAddress of this._ownerAddresses) {
- let balance = await tokenContractInstance.balanceOf(ownerAddress);
+ let balance = await tokenContractInstance.balanceOf.callAsync(ownerAddress);
balance = new BigNumber(balance);
if (_.isUndefined(balancesByOwner[ownerAddress])) {
balancesByOwner[ownerAddress] = {};
diff --git a/packages/contracts/util/exchange_wrapper.ts b/packages/contracts/util/exchange_wrapper.ts
index 03d04629d..f016067fe 100644
--- a/packages/contracts/util/exchange_wrapper.ts
+++ b/packages/contracts/util/exchange_wrapper.ts
@@ -186,11 +186,11 @@ export class ExchangeWrapper {
public async getOrderHashAsync(signedOrder: SignedOrder): Promise<string> {
const shouldThrowOnInsufficientBalanceOrAllowance = false;
const params = signedOrderUtils.getOrderAddressesAndValues(signedOrder);
- const orderHash = await this._exchange.getOrderHash(params.orderAddresses, params.orderValues);
+ const orderHash = await this._exchange.getOrderHash.callAsync(params.orderAddresses, params.orderValues);
return orderHash;
}
public async isValidSignatureAsync(signedOrder: SignedOrder): Promise<boolean> {
- const isValidSignature = await this._exchange.isValidSignature(
+ const isValidSignature = await this._exchange.isValidSignature.callAsync(
signedOrder.maker,
ZeroEx.getOrderHashHex(signedOrder),
signedOrder.ecSignature.v,
@@ -204,7 +204,7 @@ export class ExchangeWrapper {
denominator: BigNumber,
target: BigNumber,
): Promise<boolean> {
- const isRoundingError = await this._exchange.isRoundingError(numerator, denominator, target);
+ const isRoundingError = await this._exchange.isRoundingError.callAsync(numerator, denominator, target);
return isRoundingError;
}
public async getPartialAmountAsync(
@@ -212,7 +212,9 @@ export class ExchangeWrapper {
denominator: BigNumber,
target: BigNumber,
): Promise<BigNumber> {
- const partialAmount = new BigNumber(await this._exchange.getPartialAmount(numerator, denominator, target));
+ const partialAmount = new BigNumber(
+ await this._exchange.getPartialAmount.callAsync(numerator, denominator, target),
+ );
return partialAmount;
}
}
diff --git a/packages/contracts/util/token_registry_wrapper.ts b/packages/contracts/util/token_registry_wrapper.ts
index d0af17103..d78c8a64e 100644
--- a/packages/contracts/util/token_registry_wrapper.ts
+++ b/packages/contracts/util/token_registry_wrapper.ts
@@ -22,36 +22,36 @@ export class TokenRegWrapper {
return tx;
}
public async getTokenMetaDataAsync(tokenAddress: string) {
- const data = await this._tokenReg.getTokenMetaData(tokenAddress);
+ const data = await this._tokenReg.getTokenMetaData.callAsync(tokenAddress);
const token: Token = {
address: data[0],
name: data[1],
symbol: data[2],
- decimals: data[3].toNumber(),
+ decimals: data[3],
ipfsHash: data[4],
swarmHash: data[5],
};
return token;
}
public async getTokenByNameAsync(tokenName: string) {
- const data = await this._tokenReg.getTokenByName(tokenName);
+ const data = await this._tokenReg.getTokenByName.callAsync(tokenName);
const token: Token = {
address: data[0],
name: data[1],
symbol: data[2],
- decimals: data[3].toNumber(),
+ decimals: data[3],
ipfsHash: data[4],
swarmHash: data[5],
};
return token;
}
public async getTokenBySymbolAsync(tokenSymbol: string) {
- const data = await this._tokenReg.getTokenBySymbol(tokenSymbol);
+ const data = await this._tokenReg.getTokenBySymbol.callAsync(tokenSymbol);
const token: Token = {
address: data[0],
name: data[1],
symbol: data[2],
- decimals: data[3].toNumber(),
+ decimals: data[3],
ipfsHash: data[4],
swarmHash: data[5],
};
diff --git a/packages/contracts/util/types.ts b/packages/contracts/util/types.ts
index 65bc26f79..d6e4c587d 100644
--- a/packages/contracts/util/types.ts
+++ b/packages/contracts/util/types.ts
@@ -41,8 +41,8 @@ export interface DefaultOrderParams {
exchangeContractAddress: string;
maker: string;
feeRecipient: string;
- makerToken: string;
- takerToken: string;
+ makerTokenAddress: string;
+ takerTokenAddress: string;
makerTokenAmount: BigNumber;
takerTokenAmount: BigNumber;
makerFee: BigNumber;