aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-07-08 06:54:25 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-07-08 08:45:40 +0800
commit1aaa0020d099f4343bd7ce2f3374b1af9b6cce21 (patch)
tree65aca6f06bb855697b2b8b8c1aa304ed7f19e8be
parent53b38105dd8bc964418b62013992dbe842589182 (diff)
downloaddexon-sol-tools-1aaa0020d099f4343bd7ce2f3374b1af9b6cce21.tar.gz
dexon-sol-tools-1aaa0020d099f4343bd7ce2f3374b1af9b6cce21.tar.zst
dexon-sol-tools-1aaa0020d099f4343bd7ce2f3374b1af9b6cce21.zip
Migrate batchFillOrKillOrders
-rw-r--r--src/artifacts/exchange/Exchange_v1.json4
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts10
-rw-r--r--src/types.ts7
3 files changed, 11 insertions, 10 deletions
diff --git a/src/artifacts/exchange/Exchange_v1.json b/src/artifacts/exchange/Exchange_v1.json
index 106dc70a1..f705ad688 100644
--- a/src/artifacts/exchange/Exchange_v1.json
+++ b/src/artifacts/exchange/Exchange_v1.json
@@ -313,7 +313,7 @@
"type": "uint256[6][]"
},
{
- "name": "fillValuesT",
+ "name": "fillTakerTokenAmounts",
"type": "uint256[]"
},
{
@@ -329,7 +329,7 @@
"type": "bytes32[]"
}
],
- "name": "batchFillOrKill",
+ "name": "batchFillOrKillOrders",
"outputs": [
{
"name": "success",
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index 686208995..e551cd9d8 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -453,13 +453,13 @@ export class ExchangeWrapper extends ContractWrapper {
});
// We use _.unzip<any> because _.unzip doesn't type check if values have different types :'(
- const [orderAddresses, orderValues, fillTakerAmounts, vParams, rParams, sParams] =
+ const [orderAddresses, orderValues, fillTakerTokenAmounts, vParams, rParams, sParams] =
_.unzip<any>(orderAddressesValuesAndTakerTokenFillAmounts);
- const gas = await exchangeInstance.batchFillOrKill.estimateGas(
+ const gas = await exchangeInstance.batchFillOrKillOrders.estimateGas(
orderAddresses,
orderValues,
- fillTakerAmounts,
+ fillTakerTokenAmounts,
vParams,
rParams,
sParams,
@@ -467,10 +467,10 @@ export class ExchangeWrapper extends ContractWrapper {
from: takerAddress,
},
);
- const response: ContractResponse = await exchangeInstance.batchFillOrKill(
+ const response: ContractResponse = await exchangeInstance.batchFillOrKillOrders(
orderAddresses,
orderValues,
- fillTakerAmounts,
+ fillTakerTokenAmounts,
vParams,
rParams,
sParams,
diff --git a/src/types.ts b/src/types.ts
index b854aac66..a65772878 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -118,10 +118,11 @@ export interface ExchangeContract extends ContractInstance {
estimateGas: (orderAddresses: OrderAddresses, orderValues: OrderValues, fillAmount: BigNumber.BigNumber,
v: number, r: string, s: string, txOpts?: TxOpts) => number;
};
- batchFillOrKill: {
- (orderAddresses: OrderAddresses[], orderValues: OrderValues[], fillValuesT: BigNumber.BigNumber[],
+ batchFillOrKillOrders: {
+ (orderAddresses: OrderAddresses[], orderValues: OrderValues[], fillTakerTokenAmounts: BigNumber.BigNumber[],
v: number[], r: string[], s: string[], txOpts: TxOpts): ContractResponse;
- estimateGas: (orderAddresses: OrderAddresses[], orderValues: OrderValues[], fillValuesT: BigNumber.BigNumber[],
+ estimateGas: (orderAddresses: OrderAddresses[], orderValues: OrderValues[],
+ fillTakerTokenAmounts: BigNumber.BigNumber[],
v: number[], r: string[], s: string[], txOpts?: TxOpts) => number;
};
filled: {