aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-07 22:56:54 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-07 22:56:54 +0800
commit4efd5984d5982af796f3b3b3d4fd9e6bc929a289 (patch)
treebd38356113f242f3f6a668698edd5a409b84f640 /src/contract_wrappers
parent31b10973509ac1925a4cc6f5731a6c4db65b444c (diff)
parent3126279de715d74a73af270a730cf5b0c069634f (diff)
downloaddexon-sol-tools-4efd5984d5982af796f3b3b3d4fd9e6bc929a289.tar
dexon-sol-tools-4efd5984d5982af796f3b3b3d4fd9e6bc929a289.tar.gz
dexon-sol-tools-4efd5984d5982af796f3b3b3d4fd9e6bc929a289.tar.bz2
dexon-sol-tools-4efd5984d5982af796f3b3b3d4fd9e6bc929a289.tar.lz
dexon-sol-tools-4efd5984d5982af796f3b3b3d4fd9e6bc929a289.tar.xz
dexon-sol-tools-4efd5984d5982af796f3b3b3d4fd9e6bc929a289.tar.zst
dexon-sol-tools-4efd5984d5982af796f3b3b3d4fd9e6bc929a289.zip
Merge branch 'batchCancelAsync' into batchFillAsync
Diffstat (limited to 'src/contract_wrappers')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts30
1 files changed, 3 insertions, 27 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index 326f0e812..e824108de 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -200,34 +200,10 @@ export class ExchangeWrapper extends ContractWrapper {
*/
public async cancelOrderAsync(
order: Order|SignedOrder, takerTokenCancelAmount: BigNumber.BigNumber): Promise<void> {
- assert.doesConformToSchema('order',
- SchemaValidator.convertToJSONSchemaCompatibleObject(order as object),
- orderSchema);
- assert.isBigNumber('takerTokenCancelAmount', takerTokenCancelAmount);
- await assert.isSenderAddressAvailableAsync(this.web3Wrapper, 'order.maker', order.maker);
-
- const exchangeInstance = await this.getExchangeContractAsync();
- await this.validateCancelOrderAndThrowIfInvalidAsync(order, takerTokenCancelAmount);
-
- const [orderAddresses, orderValues] = ExchangeWrapper.getOrderAddressesAndValues(order);
- const gas = await exchangeInstance.cancel.estimateGas(
- orderAddresses,
- orderValues,
+ await this.batchCancelOrderAsync([{
+ order,
takerTokenCancelAmount,
- {
- from: order.maker,
- },
- );
- const response: ContractResponse = await exchangeInstance.cancel(
- orderAddresses,
- orderValues,
- takerTokenCancelAmount,
- {
- from: order.maker,
- gas,
- },
- );
- this.throwErrorLogsAsErrors(response.logs);
+ }]);
}
/**
* Batch version of cancelOrderAsync. Atomically cancels multiple orders in a single transaction.