Created tests for batchMatchOrders

This commit is contained in:
James Towle
2019-06-24 17:21:48 -05:00
committed by Amir Bandeali
parent f289b3112b
commit 6cf11554de
6 changed files with 594 additions and 32 deletions

View File

@@ -266,6 +266,22 @@ export class ExchangeWrapper {
const ordersInfo = (await this._exchange.getOrdersInfo.callAsync(signedOrders)) as OrderInfo[];
return ordersInfo;
}
public async batchMatchOrdersAsync(
signedOrdersLeft: SignedOrder[],
signedOrdersRight: SignedOrder[],
from: string,
): Promise<TransactionReceiptWithDecodedLogs> {
const params = orderUtils.createBatchMatchOrders(signedOrdersLeft, signedOrdersRight);
const txHash = await this._exchange.batchMatchOrders.sendTransactionAsync(
params.leftOrders,
params.rightOrders,
params.leftSignatures,
params.rightSignatures,
{ from },
);
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
return tx;
}
public async matchOrdersAsync(
signedOrderLeft: SignedOrder,
signedOrderRight: SignedOrder,