diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-08-25 05:38:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-25 05:38:54 +0800 |
commit | 7351bf0b14e24af78cd67e1c91c18ae0ca078bf1 (patch) | |
tree | 4054f02bf577ea213122cf5ad3694fc6586db85f /packages/contracts/test/asset_proxy/proxies.ts | |
parent | 7f36574a57ced8ead0059b90673fe01f97f04827 (diff) | |
parent | 6a9669a409a61c4645af43f39a4e4a0761354e32 (diff) | |
download | dexon-0x-contracts-7351bf0b14e24af78cd67e1c91c18ae0ca078bf1.tar dexon-0x-contracts-7351bf0b14e24af78cd67e1c91c18ae0ca078bf1.tar.gz dexon-0x-contracts-7351bf0b14e24af78cd67e1c91c18ae0ca078bf1.tar.bz2 dexon-0x-contracts-7351bf0b14e24af78cd67e1c91c18ae0ca078bf1.tar.lz dexon-0x-contracts-7351bf0b14e24af78cd67e1c91c18ae0ca078bf1.tar.xz dexon-0x-contracts-7351bf0b14e24af78cd67e1c91c18ae0ca078bf1.tar.zst dexon-0x-contracts-7351bf0b14e24af78cd67e1c91c18ae0ca078bf1.zip |
Merge pull request #1012 from 0xProject/feature/contracts/staticcall
Use staticcall for external function calls in MixinSignatureValidator
Diffstat (limited to 'packages/contracts/test/asset_proxy/proxies.ts')
-rw-r--r-- | packages/contracts/test/asset_proxy/proxies.ts | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/packages/contracts/test/asset_proxy/proxies.ts b/packages/contracts/test/asset_proxy/proxies.ts index 76a020222..6031e554d 100644 --- a/packages/contracts/test/asset_proxy/proxies.ts +++ b/packages/contracts/test/asset_proxy/proxies.ts @@ -12,7 +12,7 @@ import { ERC20ProxyContract } from '../../generated_contract_wrappers/erc20_prox import { ERC721ProxyContract } from '../../generated_contract_wrappers/erc721_proxy'; import { IAssetProxyContract } from '../../generated_contract_wrappers/i_asset_proxy'; import { artifacts } from '../utils/artifacts'; -import { expectTransactionFailedAsync } from '../utils/assertions'; +import { expectTransactionFailedAsync, expectTransactionFailedWithoutReasonAsync } from '../utils/assertions'; import { chaiSetup } from '../utils/chai_setup'; import { constants } from '../utils/constants'; import { ERC20Wrapper } from '../utils/erc20_wrapper'; @@ -99,6 +99,17 @@ describe('Asset Transfer Proxies', () => { await blockchainLifecycle.revertAsync(); }); describe('Transfer Proxy - ERC20', () => { + it('should revert if undefined function is called', async () => { + const undefinedSelector = '0x01020304'; + await expectTransactionFailedWithoutReasonAsync( + web3Wrapper.sendTransactionAsync({ + from: owner, + to: erc20Proxy.address, + value: constants.ZERO_AMOUNT, + data: undefinedSelector, + }), + ); + }); describe('transferFrom', () => { it('should successfully transfer tokens', async () => { // Construct ERC20 asset data @@ -219,6 +230,17 @@ describe('Asset Transfer Proxies', () => { }); describe('Transfer Proxy - ERC721', () => { + it('should revert if undefined function is called', async () => { + const undefinedSelector = '0x01020304'; + await expectTransactionFailedWithoutReasonAsync( + web3Wrapper.sendTransactionAsync({ + from: owner, + to: erc721Proxy.address, + value: constants.ZERO_AMOUNT, + data: undefinedSelector, + }), + ); + }); describe('transferFrom', () => { it('should successfully transfer tokens', async () => { // Construct ERC721 asset data |