aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers/exchange_wrapper.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-01 17:08:14 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-01 17:08:14 +0800
commitb05e96699f781398c2aac97082c565a531b6e4eb (patch)
treee5c3e447594be5170004c04520ac67cd0f581e8a /src/contract_wrappers/exchange_wrapper.ts
parentcc7592e9315f9cd9eba0a4049c4382545e8154e1 (diff)
downloaddexon-sol-tools-b05e96699f781398c2aac97082c565a531b6e4eb.tar
dexon-sol-tools-b05e96699f781398c2aac97082c565a531b6e4eb.tar.gz
dexon-sol-tools-b05e96699f781398c2aac97082c565a531b6e4eb.tar.bz2
dexon-sol-tools-b05e96699f781398c2aac97082c565a531b6e4eb.tar.lz
dexon-sol-tools-b05e96699f781398c2aac97082c565a531b6e4eb.tar.xz
dexon-sol-tools-b05e96699f781398c2aac97082c565a531b6e4eb.tar.zst
dexon-sol-tools-b05e96699f781398c2aac97082c565a531b6e4eb.zip
Temporarily fix gas extimation
Diffstat (limited to 'src/contract_wrappers/exchange_wrapper.ts')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index 3f6210894..754210778 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -80,6 +80,18 @@ export class ExchangeWrapper extends ContractWrapper {
signedOrder.expirationUnixTimestampSec,
signedOrder.salt,
];
+ const gas = await exchangeInstance.fill.estimateGas(
+ orderAddresses,
+ orderValues,
+ fillAmount,
+ shouldCheckTransfer,
+ signedOrder.ecSignature.v,
+ signedOrder.ecSignature.r,
+ signedOrder.ecSignature.s,
+ {
+ from: senderAddress,
+ },
+ );
const response: ContractResponse = await exchangeInstance.fill(
orderAddresses,
orderValues,
@@ -90,6 +102,7 @@ export class ExchangeWrapper extends ContractWrapper {
signedOrder.ecSignature.s,
{
from: senderAddress,
+ gas,
},
);
this.throwErrorLogsAsErrors(response.logs);