diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-02 23:41:23 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-02 23:41:23 +0800 |
commit | 54e8bf773091eb2c8587c72e50892afec42abb9d (patch) | |
tree | dfeb3de3131991bfbf25886b1d66d6897a807764 /src/contract_wrappers | |
parent | 7fd84e29ab8c27cb872cf8cd0f631d4b78abba0e (diff) | |
download | dexon-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/contract_wrappers')
-rw-r--r-- | src/contract_wrappers/exchange_wrapper.ts | 6 |
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); } } |