aboutsummaryrefslogtreecommitdiffstats
path: root/test/utils/fill_scenarios.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-08 01:11:21 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-08 01:11:21 +0800
commitedbbf5a215209bcb67052ca6cb83bb40e149d9a7 (patch)
treea67217f7f1c60eb7a745308c97fda2edc69b7733 /test/utils/fill_scenarios.ts
parentf3d9f554d9916af48038ae810d75aaf3f78676c9 (diff)
downloaddexon-sol-tools-edbbf5a215209bcb67052ca6cb83bb40e149d9a7.tar
dexon-sol-tools-edbbf5a215209bcb67052ca6cb83bb40e149d9a7.tar.gz
dexon-sol-tools-edbbf5a215209bcb67052ca6cb83bb40e149d9a7.tar.bz2
dexon-sol-tools-edbbf5a215209bcb67052ca6cb83bb40e149d9a7.tar.lz
dexon-sol-tools-edbbf5a215209bcb67052ca6cb83bb40e149d9a7.tar.xz
dexon-sol-tools-edbbf5a215209bcb67052ca6cb83bb40e149d9a7.tar.zst
dexon-sol-tools-edbbf5a215209bcb67052ca6cb83bb40e149d9a7.zip
Add success test
Diffstat (limited to 'test/utils/fill_scenarios.ts')
-rw-r--r--test/utils/fill_scenarios.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/utils/fill_scenarios.ts b/test/utils/fill_scenarios.ts
index d8d6cd0b9..8ff27ceb1 100644
--- a/test/utils/fill_scenarios.ts
+++ b/test/utils/fill_scenarios.ts
@@ -70,9 +70,13 @@ export class FillScenarios {
makerFillableAmount: BigNumber.BigNumber, takerFillableAmount: BigNumber.BigNumber,
feeRecepient: string, expirationUnixTimestampSec?: BigNumber.BigNumber): Promise<SignedOrder> {
await this.zeroEx.token.transferAsync(makerTokenAddress, this.coinbase, makerAddress, makerFillableAmount);
- await this.zeroEx.token.setProxyAllowanceAsync(makerTokenAddress, makerAddress, makerFillableAmount);
+ const oldMakerAllowance = await this.zeroEx.token.getProxyAllowanceAsync(makerTokenAddress, makerAddress);
+ await this.zeroEx.token.setProxyAllowanceAsync(
+ makerTokenAddress, makerAddress, oldMakerAllowance.plus(makerFillableAmount));
await this.zeroEx.token.transferAsync(takerTokenAddress, this.coinbase, takerAddress, takerFillableAmount);
- await this.zeroEx.token.setProxyAllowanceAsync(takerTokenAddress, takerAddress, takerFillableAmount);
+ const oldTakerAllowance = await this.zeroEx.token.getProxyAllowanceAsync(takerTokenAddress, takerAddress);
+ await this.zeroEx.token.setProxyAllowanceAsync(
+ takerTokenAddress, takerAddress, oldTakerAllowance.plus(takerFillableAmount));
if (!makerFee.isZero()) {
await this.zeroEx.token.transferAsync(this.zrxTokenAddress, this.coinbase, makerAddress, makerFee);