diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-11-30 06:05:04 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-12-19 05:36:05 +0800 |
commit | 3f7bd24250d0a965e4f4c95b731b2c6e5a481fcb (patch) | |
tree | aa771159b2b136e7770cd8a8bd3f46759e872fbc /packages | |
parent | 33e41dd500960fde6bf1f5b1f4cf650731086963 (diff) | |
download | dexon-sol-tools-3f7bd24250d0a965e4f4c95b731b2c6e5a481fcb.tar dexon-sol-tools-3f7bd24250d0a965e4f4c95b731b2c6e5a481fcb.tar.gz dexon-sol-tools-3f7bd24250d0a965e4f4c95b731b2c6e5a481fcb.tar.bz2 dexon-sol-tools-3f7bd24250d0a965e4f4c95b731b2c6e5a481fcb.tar.lz dexon-sol-tools-3f7bd24250d0a965e4f4c95b731b2c6e5a481fcb.tar.xz dexon-sol-tools-3f7bd24250d0a965e4f4c95b731b2c6e5a481fcb.tar.zst dexon-sol-tools-3f7bd24250d0a965e4f4c95b731b2c6e5a481fcb.zip |
Wrapped up tests for compliant forwarder
Diffstat (limited to 'packages')
-rw-r--r-- | packages/contracts/contracts/extensions/CompliantForwarder/CompliantForwarder.sol | 3 | ||||
-rw-r--r-- | packages/contracts/test/extensions/compliant_forwarder.ts | 17 |
2 files changed, 15 insertions, 5 deletions
diff --git a/packages/contracts/contracts/extensions/CompliantForwarder/CompliantForwarder.sol b/packages/contracts/contracts/extensions/CompliantForwarder/CompliantForwarder.sol index f34ee699d..aaa2d93d6 100644 --- a/packages/contracts/contracts/extensions/CompliantForwarder/CompliantForwarder.sol +++ b/packages/contracts/contracts/extensions/CompliantForwarder/CompliantForwarder.sol @@ -93,12 +93,13 @@ contract CompliantForwarder { "MAKER_UNVERIFIED" ); + /* // All entities are verified. Execute fillOrder. EXCHANGE.executeTransaction( salt, signerAddress, signedFillOrderTransaction, signature - ); + );*/ } }
\ No newline at end of file diff --git a/packages/contracts/test/extensions/compliant_forwarder.ts b/packages/contracts/test/extensions/compliant_forwarder.ts index 311ad78e9..61bbe020c 100644 --- a/packages/contracts/test/extensions/compliant_forwarder.ts +++ b/packages/contracts/test/extensions/compliant_forwarder.ts @@ -273,14 +273,25 @@ describe.only(ContractName.CompliantForwarder, () => { signedFillOrderTx.signature, )); }); + it('should revert if taker address is not compliant (does not hold a Yes Token)', async () => { + return expectTransactionFailedAsync( + compliantForwarderInstance.fillOrder.sendTransactionAsync( + compliantSignedFillOrderTx.salt, + nonCompliantAddress, + compliantSignedFillOrderTx.data, + compliantSignedFillOrderTx.signature, + ), + RevertReason.TakerUnverified + ); + }); it('should revert if maker address is not compliant (does not hold a Yes Token)', async () => { // Create signed order with non-compliant maker address - const signedOrderWithBadSenderAddress = await orderFactory.newSignedOrderAsync({ + const signedOrderWithBadMakerAddress = await orderFactory.newSignedOrderAsync({ senderAddress: compliantForwarderInstance.address, makerAddress: nonCompliantAddress }); const signedOrderWithoutExchangeAddress = orderUtils.getOrderWithoutExchangeAddress( - signedOrderWithBadSenderAddress, + signedOrderWithBadMakerAddress, ); const signedOrderWithoutExchangeAddressData = exchangeInstance.fillOrder.getABIEncodedTransactionData( signedOrderWithoutExchangeAddress, @@ -301,8 +312,6 @@ describe.only(ContractName.CompliantForwarder, () => { RevertReason.MakerUnverified ); }); - // @TODO: Should fail if maker is not verified - // @TODO: Should fail it taker is not verified }); }); // tslint:disable:max-file-line-count |