aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract-wrappers
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-07-03 21:25:13 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-07-05 21:58:41 +0800
commitb68d16820fbc2cab529a95a0dfabc645a9e2de34 (patch)
treef5626efddea97ef8e94f5e1650c425d409e1ec08 /packages/contract-wrappers
parent61d9cdced09752828095cdd1e54c6c14da2cc031 (diff)
downloaddexon-sol-tools-b68d16820fbc2cab529a95a0dfabc645a9e2de34.tar
dexon-sol-tools-b68d16820fbc2cab529a95a0dfabc645a9e2de34.tar.gz
dexon-sol-tools-b68d16820fbc2cab529a95a0dfabc645a9e2de34.tar.bz2
dexon-sol-tools-b68d16820fbc2cab529a95a0dfabc645a9e2de34.tar.lz
dexon-sol-tools-b68d16820fbc2cab529a95a0dfabc645a9e2de34.tar.xz
dexon-sol-tools-b68d16820fbc2cab529a95a0dfabc645a9e2de34.tar.zst
dexon-sol-tools-b68d16820fbc2cab529a95a0dfabc645a9e2de34.zip
Fix match orders test and add a validation TODO
Diffstat (limited to 'packages/contract-wrappers')
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts4
-rw-r--r--packages/contract-wrappers/test/exchange_wrapper_test.ts11
2 files changed, 12 insertions, 3 deletions
diff --git a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
index d381db1a4..0377c4021 100644
--- a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
@@ -625,7 +625,9 @@ export class ExchangeWrapper extends ContractWrapper {
await assert.isSenderAddressAsync('takerAddress', takerAddress, this._web3Wrapper);
assert.doesConformToSchema('orderTransactionOpts', orderTransactionOpts, orderTxOptsSchema, [txOptsSchema]);
const normalizedTakerAddress = takerAddress.toLowerCase();
-
+ // TODO(logvinov): Check that:
+ // rightOrder.makerAssetData === leftOrder.takerAssetData;
+ // rightOrder.takerAssetData === leftOrder.makerAssetData;
const exchangeInstance = await this._getExchangeContractAsync();
const txHash = await exchangeInstance.matchOrders.sendTransactionAsync(
leftSignedOrder,
diff --git a/packages/contract-wrappers/test/exchange_wrapper_test.ts b/packages/contract-wrappers/test/exchange_wrapper_test.ts
index 227985794..615b4ab67 100644
--- a/packages/contract-wrappers/test/exchange_wrapper_test.ts
+++ b/packages/contract-wrappers/test/exchange_wrapper_test.ts
@@ -220,10 +220,17 @@ describe('ExchangeWrapper', () => {
});
});
describe('#matchOrdersAsync', () => {
- it.skip('should match two valid ordersr', async () => {
+ it('should match two valid ordersr', async () => {
+ const matchingSignedOrder = await fillScenarios.createFillableSignedOrderAsync(
+ takerAssetData,
+ makerAssetData,
+ makerAddress,
+ takerAddress,
+ fillableAmount,
+ );
txHash = await contractWrappers.exchange.matchOrdersAsync(
signedOrder,
- anotherSignedOrder,
+ matchingSignedOrder,
takerAddress,
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);