Add no-op test

This commit is contained in:
Leonid Logvinov 2017-06-07 19:12:43 +02:00
parent edbbf5a215
commit 01c33ef8b7
No known key found for this signature in database
GPG Key ID: 0DD294BFDE8C95D4
2 changed files with 6 additions and 4 deletions

View File

@ -144,7 +144,9 @@ export class ExchangeWrapper extends ContractWrapper {
*/ */
public async batchFillOrderAsync(orderFillRequests: OrderFillRequest[], public async batchFillOrderAsync(orderFillRequests: OrderFillRequest[],
shouldCheckTransfer: boolean, takerAddress: string): Promise<void> { shouldCheckTransfer: boolean, takerAddress: string): Promise<void> {
assert.assert(!_.isEmpty(orderFillRequests), 'Cannot fill an empty batch'); if (_.isEmpty(orderFillRequests)) {
return;
}
assert.isBoolean('shouldCheckTransfer', shouldCheckTransfer); assert.isBoolean('shouldCheckTransfer', shouldCheckTransfer);
await assert.isSenderAddressAsync('takerAddress', takerAddress, this.web3Wrapper); await assert.isSenderAddressAsync('takerAddress', takerAddress, this.web3Wrapper);
_.forEach(orderFillRequests, _.forEach(orderFillRequests,

View File

@ -347,11 +347,11 @@ describe('ExchangeWrapper', () => {
takerTokenFillAmount: fillTakerAmount, takerTokenFillAmount: fillTakerAmount,
}, },
]; ];
});
describe('failed batch fills', () => {
}); });
describe('successful batch fills', () => { describe('successful batch fills', () => {
it('should no-op for an empty batch', async () => {
await zeroEx.exchange.batchFillOrderAsync([], shouldCheckTransfer, takerAddress);
});
it('should successfully fill multiple orders', async () => { it('should successfully fill multiple orders', async () => {
await zeroEx.exchange.batchFillOrderAsync(orderFillBatch, shouldCheckTransfer, takerAddress); await zeroEx.exchange.batchFillOrderAsync(orderFillBatch, shouldCheckTransfer, takerAddress);
const filledAmount = await zeroEx.exchange.getFilledTakerAmountAsync(signedOrderHashHex); const filledAmount = await zeroEx.exchange.getFilledTakerAmountAsync(signedOrderHashHex);