From 970bef717e422ac79901300b56ac8f11d3593685 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Tue, 31 Jul 2018 12:44:16 -0700 Subject: Add return values to combinatorial fillOrder tests --- packages/contracts/test/utils/exchange_wrapper.ts | 29 ++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'packages/contracts/test/utils/exchange_wrapper.ts') diff --git a/packages/contracts/test/utils/exchange_wrapper.ts b/packages/contracts/test/utils/exchange_wrapper.ts index 490ea959b..bff2e9536 100644 --- a/packages/contracts/test/utils/exchange_wrapper.ts +++ b/packages/contracts/test/utils/exchange_wrapper.ts @@ -8,7 +8,7 @@ import { ExchangeContract } from '../../generated_contract_wrappers/exchange'; import { formatters } from './formatters'; import { LogDecoder } from './log_decoder'; import { orderUtils } from './order_utils'; -import { OrderInfo, SignedTransaction } from './types'; +import { FillResults, OrderInfo, SignedTransaction } from './types'; export class ExchangeWrapper { private readonly _exchange: ExchangeContract; @@ -243,4 +243,31 @@ export class ExchangeWrapper { const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash); return tx; } + public async getFillOrderResultsAsync( + signedOrder: SignedOrder, + from: string, + opts: { takerAssetFillAmount?: BigNumber } = {}, + ): Promise { + const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount); + const fillResults = await this._exchange.fillOrder.callAsync( + params.order, + params.takerAssetFillAmount, + params.signature, + { from }, + ); + return fillResults; + } + public abiEncodeFillOrder( + signedOrder: SignedOrder, + from: string, + opts: { takerAssetFillAmount?: BigNumber } = {}, + ): string { + const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount); + const data = this._exchange.fillOrder.getABIEncodedTransactionData( + params.order, + params.takerAssetFillAmount, + params.signature, + ); + return data; + } } -- cgit v1.2.3 From 9a5d7b76352e804d532e7a6d08d83f7b0ea7bd7f Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Tue, 7 Aug 2018 14:06:50 -0700 Subject: Test abiEncodeFillOrder as part of combinatorial follOrder tests --- packages/contracts/test/utils/exchange_wrapper.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'packages/contracts/test/utils/exchange_wrapper.ts') diff --git a/packages/contracts/test/utils/exchange_wrapper.ts b/packages/contracts/test/utils/exchange_wrapper.ts index bff2e9536..d57592d6d 100644 --- a/packages/contracts/test/utils/exchange_wrapper.ts +++ b/packages/contracts/test/utils/exchange_wrapper.ts @@ -257,11 +257,7 @@ export class ExchangeWrapper { ); return fillResults; } - public abiEncodeFillOrder( - signedOrder: SignedOrder, - from: string, - opts: { takerAssetFillAmount?: BigNumber } = {}, - ): string { + public abiEncodeFillOrder(signedOrder: SignedOrder, opts: { takerAssetFillAmount?: BigNumber } = {}): string { const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount); const data = this._exchange.fillOrder.getABIEncodedTransactionData( params.order, -- cgit v1.2.3