diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-07-08 06:18:19 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-07-11 15:30:14 +0800 |
commit | 4ecfac6cb47477444d25c42e9fa569b4c47e3ee4 (patch) | |
tree | 0364a02c137dcc4bcf91b3ecaab8ca5f968b2676 /src | |
parent | 00c1198b34423ff4f999bc5998d61ab3c07a168e (diff) | |
download | dexon-0x-contracts-4ecfac6cb47477444d25c42e9fa569b4c47e3ee4.tar.gz dexon-0x-contracts-4ecfac6cb47477444d25c42e9fa569b4c47e3ee4.tar.zst dexon-0x-contracts-4ecfac6cb47477444d25c42e9fa569b4c47e3ee4.zip |
Migrate cencelOrder
Diffstat (limited to 'src')
-rw-r--r-- | src/artifacts/exchange/Exchange_v1.json | 6 | ||||
-rw-r--r-- | src/contract_wrappers/exchange_wrapper.ts | 18 | ||||
-rw-r--r-- | src/types.ts | 7 |
3 files changed, 16 insertions, 15 deletions
diff --git a/src/artifacts/exchange/Exchange_v1.json b/src/artifacts/exchange/Exchange_v1.json index df7c3c6d6..46c4cbd2b 100644 --- a/src/artifacts/exchange/Exchange_v1.json +++ b/src/artifacts/exchange/Exchange_v1.json @@ -13,14 +13,14 @@ "type": "uint256[6]" }, { - "name": "cancelValueT", + "name": "canceltakerTokenAmount", "type": "uint256" } ], - "name": "cancel", + "name": "cancelOrder", "outputs": [ { - "name": "cancelledValueT", + "name": "cancelledTakerTokenAmount", "type": "uint256" } ], diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index fa4b5904b..2000ebc16 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -482,27 +482,27 @@ export class ExchangeWrapper extends ContractWrapper { */ @decorators.contractCallErrorHandler public async cancelOrderAsync( - order: Order|SignedOrder, takerTokenCancelAmount: BigNumber.BigNumber): Promise<BigNumber.BigNumber> { + order: Order|SignedOrder, canceltakerTokenAmount: BigNumber.BigNumber): Promise<BigNumber.BigNumber> { assert.doesConformToSchema('order', order, orderSchema); - assert.isBigNumber('takerTokenCancelAmount', takerTokenCancelAmount); + assert.isBigNumber('takerTokenCancelAmount', canceltakerTokenAmount); await assert.isSenderAddressAsync('order.maker', order.maker, this._web3Wrapper); const exchangeInstance = await this._getExchangeContractAsync(order.exchangeContractAddress); - await this._validateCancelOrderAndThrowIfInvalidAsync(order, takerTokenCancelAmount); + await this._validateCancelOrderAndThrowIfInvalidAsync(order, canceltakerTokenAmount); const [orderAddresses, orderValues] = ExchangeWrapper._getOrderAddressesAndValues(order); - const gas = await exchangeInstance.cancel.estimateGas( + const gas = await exchangeInstance.cancelOrder.estimateGas( orderAddresses, orderValues, - takerTokenCancelAmount, + canceltakerTokenAmount, { from: order.maker, }, ); - const response: ContractResponse = await exchangeInstance.cancel( + const response: ContractResponse = await exchangeInstance.cancelOrder( orderAddresses, orderValues, - takerTokenCancelAmount, + canceltakerTokenAmount, { from: order.maker, gas, @@ -510,8 +510,8 @@ export class ExchangeWrapper extends ContractWrapper { ); this._throwErrorLogsAsErrors(response.logs); const logFillArgs = response.logs[0].args as LogCancelContractEventArgs; - const cancelledAmount = new BigNumber(logFillArgs.cancelledValueT); - return cancelledAmount; + const cancelledTakerTokenAmount = new BigNumber(logFillArgs.cancelledValueT); + return cancelledTakerTokenAmount; } /** * Batch version of cancelOrderAsync. Atomically cancels multiple orders in a single transaction. diff --git a/src/types.ts b/src/types.ts index 66881e170..fce42352f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -89,10 +89,11 @@ export interface ExchangeContract extends ContractInstance { estimateGas: (orderAddresses: OrderAddresses[], orderValues: OrderValues[], fillAmount: BigNumber.BigNumber, shouldCheckTransfer: boolean, v: number[], r: string[], s: string[], txOpts?: TxOpts) => number; }; - cancel: { - (orderAddresses: OrderAddresses, orderValues: OrderValues, cancelAmount: BigNumber.BigNumber, + cancelOrder: { + (orderAddresses: OrderAddresses, orderValues: OrderValues, canceltakerTokenAmount: BigNumber.BigNumber, txOpts?: TxOpts): ContractResponse; - estimateGas: (orderAddresses: OrderAddresses, orderValues: OrderValues, cancelAmount: BigNumber.BigNumber, + estimateGas: (orderAddresses: OrderAddresses, orderValues: OrderValues, + canceltakerTokenAmount: BigNumber.BigNumber, txOpts?: TxOpts) => number; }; batchCancel: { |