aboutsummaryrefslogtreecommitdiffstats
path: root/test/utils/fill_scenarios.ts
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-06-06 21:14:53 +0800
committerGitHub <noreply@github.com>2017-06-06 21:14:53 +0800
commit692a0fd965f7c0cfc0eef79112d2abffdf9e90db (patch)
treea3a97eb6522bc887966da6575e4b2ac73560fdcf /test/utils/fill_scenarios.ts
parent2eb99f46f53984c1a54315f87059ef18b9d06349 (diff)
parentf54b513935dbba0dd1922566ed2fd4b4acbf6459 (diff)
downloaddexon-sol-tools-692a0fd965f7c0cfc0eef79112d2abffdf9e90db.tar
dexon-sol-tools-692a0fd965f7c0cfc0eef79112d2abffdf9e90db.tar.gz
dexon-sol-tools-692a0fd965f7c0cfc0eef79112d2abffdf9e90db.tar.bz2
dexon-sol-tools-692a0fd965f7c0cfc0eef79112d2abffdf9e90db.tar.lz
dexon-sol-tools-692a0fd965f7c0cfc0eef79112d2abffdf9e90db.tar.xz
dexon-sol-tools-692a0fd965f7c0cfc0eef79112d2abffdf9e90db.tar.zst
dexon-sol-tools-692a0fd965f7c0cfc0eef79112d2abffdf9e90db.zip
Merge pull request #39 from 0xProject/senderAccount
Make methods accept senderAccount
Diffstat (limited to 'test/utils/fill_scenarios.ts')
-rw-r--r--test/utils/fill_scenarios.ts12
1 files changed, 1 insertions, 11 deletions
diff --git a/test/utils/fill_scenarios.ts b/test/utils/fill_scenarios.ts
index d186593b9..d8d6cd0b9 100644
--- a/test/utils/fill_scenarios.ts
+++ b/test/utils/fill_scenarios.ts
@@ -54,19 +54,13 @@ export class FillScenarios {
public async createPartiallyFilledSignedOrderAsync(makerTokenAddress: string, takerTokenAddress: string,
takerAddress: string, fillableAmount: BigNumber.BigNumber,
partialFillAmount: BigNumber.BigNumber) {
- const prevSenderAccount = await this.zeroEx.getTransactionSenderAccountIfExistsAsync();
const [makerAddress] = this.userAddresses;
const signedOrder = await this.createAsymmetricFillableSignedOrderAsync(
makerTokenAddress, takerTokenAddress, makerAddress, takerAddress,
fillableAmount, fillableAmount,
);
-
- this.zeroEx.setTransactionSenderAccount(takerAddress);
const shouldCheckTransfer = false;
- await this.zeroEx.exchange.fillOrderAsync(signedOrder, partialFillAmount, shouldCheckTransfer);
-
- // Re-set sender account so as to avoid introducing side-effects
- this.zeroEx.setTransactionSenderAccount(prevSenderAccount as string);
+ await this.zeroEx.exchange.fillOrderAsync(signedOrder, partialFillAmount, shouldCheckTransfer, takerAddress);
return signedOrder;
}
private async createAsymmetricFillableSignedOrderWithFeesAsync(
@@ -89,14 +83,10 @@ export class FillScenarios {
await this.zeroEx.token.setProxyAllowanceAsync(this.zrxTokenAddress, takerAddress, takerFee);
}
- const prevTransactionSenderAccount = await this.zeroEx.getTransactionSenderAccountIfExistsAsync();
- this.zeroEx.setTransactionSenderAccount(makerAddress);
const signedOrder = await orderFactory.createSignedOrderAsync(this.zeroEx,
makerAddress, takerAddress, makerFee, takerFee,
makerFillableAmount, makerTokenAddress, takerFillableAmount, takerTokenAddress,
feeRecepient, expirationUnixTimestampSec);
- // We re-set the transactionSender to avoid introducing side-effects
- this.zeroEx.setTransactionSenderAccount(prevTransactionSenderAccount as string);
return signedOrder;
}
}