aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-07-04 03:04:07 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-07-04 03:04:07 +0800
commit4bcad260244f5399c07530db7ac18a8335246e34 (patch)
tree31ee128f35ed162847bd6892e2fb175487c033dd /src/contract_wrappers
parent15bd31e629b0a5d2bf8e611b356123dd68a4f6e7 (diff)
downloaddexon-sol-tools-4bcad260244f5399c07530db7ac18a8335246e34.tar
dexon-sol-tools-4bcad260244f5399c07530db7ac18a8335246e34.tar.gz
dexon-sol-tools-4bcad260244f5399c07530db7ac18a8335246e34.tar.bz2
dexon-sol-tools-4bcad260244f5399c07530db7ac18a8335246e34.tar.lz
dexon-sol-tools-4bcad260244f5399c07530db7ac18a8335246e34.tar.xz
dexon-sol-tools-4bcad260244f5399c07530db7ac18a8335246e34.tar.zst
dexon-sol-tools-4bcad260244f5399c07530db7ac18a8335246e34.zip
Stop passing exchangeContractAddress to utils.getOrderHashHex
Diffstat (limited to 'src/contract_wrappers')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index fa946d6ad..f596cb429 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -679,11 +679,6 @@ export class ExchangeWrapper extends ContractWrapper {
);
return isValidSignature;
}
- private async _getOrderHashHexAsync(order: Order|SignedOrder): Promise<string> {
- const exchangeInstance = await this._getExchangeContractAsync(order.exchangeContractAddress);
- const orderHashHex = utils.getOrderHashHex(order, exchangeInstance.address);
- return orderHashHex;
- }
private async _getOrderHashHexUsingContractCallAsync(order: Order|SignedOrder): Promise<string> {
const exchangeInstance = await this._getExchangeContractAsync(order.exchangeContractAddress);
const [orderAddresses, orderValues] = ExchangeWrapper._getOrderAddressesAndValues(order);
@@ -720,7 +715,7 @@ export class ExchangeWrapper extends ContractWrapper {
if (takerTokenCancelAmount.eq(0)) {
throw new Error(ExchangeContractErrs.ORDER_CANCEL_AMOUNT_ZERO);
}
- const orderHash = await this._getOrderHashHexAsync(order);
+ const orderHash = utils.getOrderHashHex(order);
const unavailableAmount = await this.getUnavailableTakerAmountAsync(orderHash, order.exchangeContractAddress);
if (order.takerTokenAmount.minus(unavailableAmount).eq(0)) {
throw new Error(ExchangeContractErrs.ORDER_ALREADY_CANCELLED_OR_FILLED);
@@ -734,7 +729,7 @@ export class ExchangeWrapper extends ContractWrapper {
exchangeContractAddress: string,
fillTakerAmount: BigNumber.BigNumber) {
// Check that fillValue available >= fillTakerAmount
- const orderHashHex = utils.getOrderHashHex(signedOrder, exchangeContractAddress);
+ const orderHashHex = utils.getOrderHashHex(signedOrder);
const unavailableTakerAmount = await this.getUnavailableTakerAmountAsync(orderHashHex, exchangeContractAddress);
const remainingTakerAmount = signedOrder.takerTokenAmount.minus(unavailableTakerAmount);
if (remainingTakerAmount < fillTakerAmount) {