From 13d5a5e2ec4df72026b181773a318cd8aa7fbdc0 Mon Sep 17 00:00:00 2001 From: Alex Towle Date: Wed, 28 Aug 2019 16:24:36 -0700 Subject: [PATCH] `@0x:contracts-exchange` Added a test to ensure that `registerAssetProxy` will fail for non-contract proxies --- contracts/exchange/test/dispatcher.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/contracts/exchange/test/dispatcher.ts b/contracts/exchange/test/dispatcher.ts index 175a606d9a..e087f008f8 100644 --- a/contracts/exchange/test/dispatcher.ts +++ b/contracts/exchange/test/dispatcher.ts @@ -146,6 +146,14 @@ describe('AssetProxyDispatcher', () => { return expect(tx).to.revertWith(expectedError); }); + it('should revert if the proxy is not a contract address', async () => { + const errMessage = 'VM Exception while processing transaction: revert'; + const tx = assetProxyDispatcher.registerAssetProxy.sendTransactionAsync(notOwner, { + from: owner, + }); + return expect(tx).to.be.rejectedWith(errMessage); + }); + it('should log an event with correct arguments when an asset proxy is registered', async () => { const logDecoder = new LogDecoder(web3Wrapper, artifacts); const txReceipt = await logDecoder.getTxWithDecodedLogsAsync(