@0x:contracts-exchange Added a test to ensure that registerAssetProxy will fail for non-contract proxies

This commit is contained in:
Alex Towle
2019-08-28 16:24:36 -07:00
parent 3432083343
commit 13d5a5e2ec

View File

@@ -146,6 +146,14 @@ describe('AssetProxyDispatcher', () => {
return expect(tx).to.revertWith(expectedError); 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 () => { it('should log an event with correct arguments when an asset proxy is registered', async () => {
const logDecoder = new LogDecoder(web3Wrapper, artifacts); const logDecoder = new LogDecoder(web3Wrapper, artifacts);
const txReceipt = await logDecoder.getTxWithDecodedLogsAsync( const txReceipt = await logDecoder.getTxWithDecodedLogsAsync(