aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-04-14 09:35:52 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-04-21 04:56:18 +0800
commitdfe6b2844b3c847e940b3f9d13cb981755c6c694 (patch)
treebf8111785387fb161ea2d9e14332bff099544db6 /packages/contracts/test
parent6be5fe928e4820ed674c7a8f74fd24b63871b4c7 (diff)
downloaddexon-0x-contracts-dfe6b2844b3c847e940b3f9d13cb981755c6c694.tar
dexon-0x-contracts-dfe6b2844b3c847e940b3f9d13cb981755c6c694.tar.gz
dexon-0x-contracts-dfe6b2844b3c847e940b3f9d13cb981755c6c694.tar.bz2
dexon-0x-contracts-dfe6b2844b3c847e940b3f9d13cb981755c6c694.tar.lz
dexon-0x-contracts-dfe6b2844b3c847e940b3f9d13cb981755c6c694.tar.xz
dexon-0x-contracts-dfe6b2844b3c847e940b3f9d13cb981755c6c694.tar.zst
dexon-0x-contracts-dfe6b2844b3c847e940b3f9d13cb981755c6c694.zip
Reverted change that allowed ERC721 transfer proxy to be called with amount 0. This now throws.
Diffstat (limited to 'packages/contracts/test')
-rw-r--r--packages/contracts/test/asset_proxy_dispatcher/proxies.ts21
1 files changed, 10 insertions, 11 deletions
diff --git a/packages/contracts/test/asset_proxy_dispatcher/proxies.ts b/packages/contracts/test/asset_proxy_dispatcher/proxies.ts
index 870d468d3..6ffc5c998 100644
--- a/packages/contracts/test/asset_proxy_dispatcher/proxies.ts
+++ b/packages/contracts/test/asset_proxy_dispatcher/proxies.ts
@@ -364,7 +364,7 @@ describe('Asset Transfer Proxies', () => {
expect(newOwnerMakerToken).to.be.bignumber.equal(takerAddress);
});
- it('should do nothing if transferring 0 amount of a token', async () => {
+ it('should throw if transferring 0 amount of a token', async () => {
// Construct metadata for ERC721 proxy
const encodedProxyMetadata = encodeERC721ProxyData(erc721Token.address, makerTokenId);
// Verify pre-condition
@@ -373,16 +373,15 @@ describe('Asset Transfer Proxies', () => {
// Perform a transfer from makerAddress to takerAddress
const balances = await dmyBalances.getAsync();
const amount = new BigNumber(0);
- await erc721TransferProxy.transferFrom.sendTransactionAsync(
- encodedProxyMetadata,
- makerAddress,
- takerAddress,
- amount,
- { from: assetProxyDispatcherAddress },
- );
- // Verify transfer was successful
- const newOwnerMakerToken = await erc721Token.ownerOf.callAsync(makerTokenId);
- expect(newOwnerMakerToken).to.be.bignumber.equal(makerAddress);
+ return expect(
+ erc721TransferProxy.transferFrom.sendTransactionAsync(
+ encodedProxyMetadata,
+ makerAddress,
+ takerAddress,
+ amount,
+ { from: assetProxyDispatcherAddress },
+ ),
+ ).to.be.rejectedWith(constants.REVERT);
});
it('should throw if transferring > 1 amount of a token', async () => {