diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-05-01 07:44:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-01 07:44:38 +0800 |
commit | b5c4b81aacaca83d8629718ff0357ccc3bba4698 (patch) | |
tree | 200a715d34d98ae7ead191e20f57d41827ecd411 /packages/contracts/test | |
parent | 63ad2ebf0bb9b78bbfc2190390fab83e7c0639b6 (diff) | |
parent | c849c8ef086195c3f24314587772550ee309eb5d (diff) | |
download | dexon-sol-tools-b5c4b81aacaca83d8629718ff0357ccc3bba4698.tar dexon-sol-tools-b5c4b81aacaca83d8629718ff0357ccc3bba4698.tar.gz dexon-sol-tools-b5c4b81aacaca83d8629718ff0357ccc3bba4698.tar.bz2 dexon-sol-tools-b5c4b81aacaca83d8629718ff0357ccc3bba4698.tar.lz dexon-sol-tools-b5c4b81aacaca83d8629718ff0357ccc3bba4698.tar.xz dexon-sol-tools-b5c4b81aacaca83d8629718ff0357ccc3bba4698.tar.zst dexon-sol-tools-b5c4b81aacaca83d8629718ff0357ccc3bba4698.zip |
Merge pull request #563 from 0xProject/feature/contracts/proxyIds
Add hard coded proxyId into each AssetProxy
Diffstat (limited to 'packages/contracts/test')
-rw-r--r-- | packages/contracts/test/asset_proxy/proxies.ts | 10 | ||||
-rw-r--r-- | packages/contracts/test/exchange/dispatcher.ts | 12 |
2 files changed, 22 insertions, 0 deletions
diff --git a/packages/contracts/test/asset_proxy/proxies.ts b/packages/contracts/test/asset_proxy/proxies.ts index 6aefadee7..bdd0a8696 100644 --- a/packages/contracts/test/asset_proxy/proxies.ts +++ b/packages/contracts/test/asset_proxy/proxies.ts @@ -145,6 +145,11 @@ describe('Asset Transfer Proxies', () => { }), ).to.be.rejectedWith(constants.REVERT); }); + + it('should have an id of 1', async () => { + const proxyId = await erc20Proxy.getProxyId.callAsync(); + expect(proxyId).to.equal(1); + }); }); describe('Transfer Proxy - ERC721', () => { @@ -240,5 +245,10 @@ describe('Asset Transfer Proxies', () => { ), ).to.be.rejectedWith(constants.REVERT); }); + + it('should have an id of 2', async () => { + const proxyId = await erc721Proxy.getProxyId.callAsync(); + expect(proxyId).to.equal(2); + }); }); }); diff --git a/packages/contracts/test/exchange/dispatcher.ts b/packages/contracts/test/exchange/dispatcher.ts index 1c346c93f..31f5f5dbb 100644 --- a/packages/contracts/test/exchange/dispatcher.ts +++ b/packages/contracts/test/exchange/dispatcher.ts @@ -194,6 +194,18 @@ describe('AssetProxyDispatcher', () => { ), ).to.be.rejectedWith(constants.REVERT); }); + + it('should throw if attempting to register a proxy to the incorrect id', async () => { + const prevProxyAddress = ZeroEx.NULL_ADDRESS; + return expect( + assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( + AssetProxyId.ERC721, + erc20Proxy.address, + prevProxyAddress, + { from: owner }, + ), + ).to.be.rejectedWith(constants.REVERT); + }); }); describe('getAssetProxy', () => { |