aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract-wrappers
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-07-31 15:10:58 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-07-31 15:11:29 +0800
commit5d44a67e62eb47ba4a8664e83ed46568df5eb78f (patch)
treee0f1e44a3a4cbb314bc2ad07ab786b3e27f4b754 /packages/contract-wrappers
parent8ed3d59f969c2f07e34739c5a08c69de583cef88 (diff)
downloaddexon-0x-contracts-5d44a67e62eb47ba4a8664e83ed46568df5eb78f.tar.gz
dexon-0x-contracts-5d44a67e62eb47ba4a8664e83ed46568df5eb78f.tar.zst
dexon-0x-contracts-5d44a67e62eb47ba4a8664e83ed46568df5eb78f.zip
Update forwarder_wrapper_test
Diffstat (limited to 'packages/contract-wrappers')
-rw-r--r--packages/contract-wrappers/test/forwarder_wrapper_test.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/contract-wrappers/test/forwarder_wrapper_test.ts b/packages/contract-wrappers/test/forwarder_wrapper_test.ts
index 0fb695b9e..3f3b40e0b 100644
--- a/packages/contract-wrappers/test/forwarder_wrapper_test.ts
+++ b/packages/contract-wrappers/test/forwarder_wrapper_test.ts
@@ -111,4 +111,20 @@ describe('ForwarderWrapper', () => {
expect(ordersInfo[1].orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
});
});
+ describe('#marketSellOrdersWithEthAsync', () => {
+ it('should market sell orders with eth', async () => {
+ const signedOrders = [signedOrder, anotherSignedOrder];
+ const makerAssetFillAmount = signedOrder.makerAssetAmount.plus(anotherSignedOrder.makerAssetAmount);
+ const txHash = await contractWrappers.forwarder.marketSellOrdersWithEthAsync(
+ signedOrders,
+ takerAddress,
+ makerAssetFillAmount,
+ );
+ await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
+ const ordersInfo = await contractWrappers.exchange.getOrdersInfoAsync([signedOrder, anotherSignedOrder]);
+ expect(ordersInfo[0].orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
+ expect(ordersInfo[1].orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ expect(ordersInfo[1].orderTakerAssetFilledAmount).to.be.bignumber.equal(new BigNumber(4)); // only 95% of ETH is sold
+ });
+ });
});