aboutsummaryrefslogtreecommitdiffstats
path: root/test/utils
diff options
context:
space:
mode:
Diffstat (limited to 'test/utils')
-rw-r--r--test/utils/fill_scenarios.ts7
-rw-r--r--test/utils/order_factory.ts4
2 files changed, 8 insertions, 3 deletions
diff --git a/test/utils/fill_scenarios.ts b/test/utils/fill_scenarios.ts
index b8ad7eb12..65a912955 100644
--- a/test/utils/fill_scenarios.ts
+++ b/test/utils/fill_scenarios.ts
@@ -9,12 +9,15 @@ export class FillScenarios {
private tokens: Token[];
private coinbase: string;
private zrxTokenAddress: string;
- constructor(zeroEx: ZeroEx, userAddresses: string[], tokens: Token[], zrxTokenAddress: string) {
+ private exchangeContractAddress: string;
+ constructor(zeroEx: ZeroEx, userAddresses: string[],
+ tokens: Token[], zrxTokenAddress: string, exchangeContractAddress: string) {
this.zeroEx = zeroEx;
this.userAddresses = userAddresses;
this.tokens = tokens;
this.coinbase = userAddresses[0];
this.zrxTokenAddress = zrxTokenAddress;
+ this.exchangeContractAddress = exchangeContractAddress;
}
public async createFillableSignedOrderAsync(makerTokenAddress: string, takerTokenAddress: string,
makerAddress: string, takerAddress: string,
@@ -103,7 +106,7 @@ export class FillScenarios {
const signedOrder = await orderFactory.createSignedOrderAsync(this.zeroEx,
makerAddress, takerAddress, makerFee, takerFee,
makerFillableAmount, makerTokenAddress, takerFillableAmount, takerTokenAddress,
- feeRecepient, expirationUnixTimestampSec);
+ this.exchangeContractAddress, feeRecepient, expirationUnixTimestampSec);
return signedOrder;
}
}
diff --git a/test/utils/order_factory.ts b/test/utils/order_factory.ts
index ef19f2c4c..22bf44c0f 100644
--- a/test/utils/order_factory.ts
+++ b/test/utils/order_factory.ts
@@ -13,6 +13,7 @@ export const orderFactory = {
makerTokenAddress: string,
takerTokenAmount: BigNumber.BigNumber,
takerTokenAddress: string,
+ exchangeContractAddress: string,
feeRecipient: string,
expirationUnixTimestampSec?: BigNumber.BigNumber): Promise<SignedOrder> {
const defaultExpirationUnixTimestampSec = new BigNumber(2524604400); // Close to infinite
@@ -29,10 +30,11 @@ export const orderFactory = {
makerTokenAddress,
takerTokenAddress,
salt: ZeroEx.generatePseudoRandomSalt(),
+ exchangeContractAddress,
feeRecipient,
expirationUnixTimestampSec,
};
- const orderHash = await zeroEx.getOrderHashHexAsync(order);
+ const orderHash = zeroEx.getOrderHashHex(order);
const ecSignature = await zeroEx.signOrderHashAsync(orderHash, maker);
const signedOrder: SignedOrder = _.assign(order, {ecSignature});
return signedOrder;