aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-02 23:41:23 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-02 23:41:23 +0800
commit54e8bf773091eb2c8587c72e50892afec42abb9d (patch)
treedfeb3de3131991bfbf25886b1d66d6897a807764 /src
parent7fd84e29ab8c27cb872cf8cd0f631d4b78abba0e (diff)
downloaddexon-sol-tools-54e8bf773091eb2c8587c72e50892afec42abb9d.tar
dexon-sol-tools-54e8bf773091eb2c8587c72e50892afec42abb9d.tar.gz
dexon-sol-tools-54e8bf773091eb2c8587c72e50892afec42abb9d.tar.bz2
dexon-sol-tools-54e8bf773091eb2c8587c72e50892afec42abb9d.tar.lz
dexon-sol-tools-54e8bf773091eb2c8587c72e50892afec42abb9d.tar.xz
dexon-sol-tools-54e8bf773091eb2c8587c72e50892afec42abb9d.tar.zst
dexon-sol-tools-54e8bf773091eb2c8587c72e50892afec42abb9d.zip
Assign wouldRoundingErrorOccur to a variable
Diffstat (limited to 'src')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index e957530ae..828994829 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -139,8 +139,10 @@ export class ExchangeWrapper extends ContractWrapper {
await this.validateFillOrderBalancesAndAllowancesAndThrowIfInvalidAsync(signedOrder, fillTakerAmount,
senderAddress, zrxTokenAddress);
- if (await this.isRoundingErrorAsync(signedOrder.takerTokenAmount, fillTakerAmount,
- signedOrder.makerTokenAmount)) {
+ const wouldRoundingErrorOccur = await this.isRoundingErrorAsync(
+ signedOrder.takerTokenAmount, fillTakerAmount, signedOrder.makerTokenAmount,
+ );
+ if (wouldRoundingErrorOccur) {
throw new Error(FillOrderValidationErrs.ROUNDING_ERROR);
}
}