diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-07-08 05:39:04 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-07-08 08:45:39 +0800 |
commit | 1e54dec2809a5c7b97c47f3232ab14f3ef68d94e (patch) | |
tree | 1c9a68fa0e8a6442efd259edee9b982a887c463a | |
parent | 1d8ca6c4f35ba44181b01543885b2820059e8c27 (diff) | |
download | dexon-sol-tools-1e54dec2809a5c7b97c47f3232ab14f3ef68d94e.tar dexon-sol-tools-1e54dec2809a5c7b97c47f3232ab14f3ef68d94e.tar.gz dexon-sol-tools-1e54dec2809a5c7b97c47f3232ab14f3ef68d94e.tar.bz2 dexon-sol-tools-1e54dec2809a5c7b97c47f3232ab14f3ef68d94e.tar.lz dexon-sol-tools-1e54dec2809a5c7b97c47f3232ab14f3ef68d94e.tar.xz dexon-sol-tools-1e54dec2809a5c7b97c47f3232ab14f3ef68d94e.tar.zst dexon-sol-tools-1e54dec2809a5c7b97c47f3232ab14f3ef68d94e.zip |
Migrate isRoundingError parameter changes
-rw-r--r-- | src/artifacts/exchange/Exchange_v1.json | 4 | ||||
-rw-r--r-- | src/contract_wrappers/exchange_wrapper.ts | 10 | ||||
-rw-r--r-- | src/types.ts | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/artifacts/exchange/Exchange_v1.json b/src/artifacts/exchange/Exchange_v1.json index ed5f08b72..e6ed335ca 100644 --- a/src/artifacts/exchange/Exchange_v1.json +++ b/src/artifacts/exchange/Exchange_v1.json @@ -31,11 +31,11 @@ "constant": true, "inputs": [ { - "name": "denominator", + "name": "numerator", "type": "uint256" }, { - "name": "numerator", + "name": "denominator", "type": "uint256" }, { diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index a06471bba..9bedb1b3c 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -662,7 +662,7 @@ export class ExchangeWrapper extends ContractWrapper { senderAddress, zrxTokenAddress); const wouldRoundingErrorOccur = await this._isRoundingErrorAsync( - signedOrder.takerTokenAmount, fillTakerAmount, signedOrder.makerTokenAmount, + fillTakerAmount, signedOrder.takerTokenAmount, signedOrder.makerTokenAmount, signedOrder.exchangeContractAddress, ); if (wouldRoundingErrorOccur) { @@ -764,14 +764,14 @@ export class ExchangeWrapper extends ContractWrapper { throw new Error(errMessage); } } - private async _isRoundingErrorAsync(takerTokenAmount: BigNumber.BigNumber, - fillTakerAmount: BigNumber.BigNumber, - makerTokenAmount: BigNumber.BigNumber, + private async _isRoundingErrorAsync(numerator: BigNumber.BigNumber, + denominator: BigNumber.BigNumber, + target: BigNumber.BigNumber, exchangeContractAddress: string): Promise<boolean> { await assert.isUserAddressAvailableAsync(this._web3Wrapper); const exchangeInstance = await this._getExchangeContractAsync(exchangeContractAddress); const isRoundingError = await exchangeInstance.isRoundingError.call( - takerTokenAmount, fillTakerAmount, makerTokenAmount, + numerator, denominator, target, ); return isRoundingError; } diff --git a/src/types.ts b/src/types.ts index dfb4d12c5..2887e83ff 100644 --- a/src/types.ts +++ b/src/types.ts @@ -68,8 +68,8 @@ export interface ExchangeContract extends ContractInstance { call: (orderHash: string) => BigNumber.BigNumber; }; isRoundingError: { - call: (takerTokenAmount: BigNumber.BigNumber, fillTakerAmount: BigNumber.BigNumber, - makerTokenAmount: BigNumber.BigNumber, txOpts?: TxOpts) => Promise<boolean>; + call: (numerator: BigNumber.BigNumber, denominator: BigNumber.BigNumber, + target: BigNumber.BigNumber, txOpts?: TxOpts) => Promise<boolean>; }; fill: { (orderAddresses: OrderAddresses, orderValues: OrderValues, fillAmount: BigNumber.BigNumber, |