diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-05 19:13:04 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-05 19:13:04 +0800 |
commit | 38cf621327443dab988721881b27ed10f6efe331 (patch) | |
tree | d112bfd93e53ec5a346ba2e980d7a3e6a9dcbe25 /test | |
parent | eb5c9ae70886cb1a14ae154f363f052a76b24479 (diff) | |
download | dexon-sol-tools-38cf621327443dab988721881b27ed10f6efe331.tar dexon-sol-tools-38cf621327443dab988721881b27ed10f6efe331.tar.gz dexon-sol-tools-38cf621327443dab988721881b27ed10f6efe331.tar.bz2 dexon-sol-tools-38cf621327443dab988721881b27ed10f6efe331.tar.lz dexon-sol-tools-38cf621327443dab988721881b27ed10f6efe331.tar.xz dexon-sol-tools-38cf621327443dab988721881b27ed10f6efe331.tar.zst dexon-sol-tools-38cf621327443dab988721881b27ed10f6efe331.zip |
Add regression test for transferFrom bug
Diffstat (limited to 'test')
-rw-r--r-- | test/token_wrapper_test.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/token_wrapper_test.ts b/test/token_wrapper_test.ts index 698ad5b6a..3cfc6d197 100644 --- a/test/token_wrapper_test.ts +++ b/test/token_wrapper_test.ts @@ -89,6 +89,16 @@ describe('TokenWrapper', () => { token.address, fromAddress, toAddress, senderAddress, transferAmount, )).to.be.rejectedWith(ZeroExError.INSUFFICIENT_ALLOWANCE_FOR_TRANSFER); }); + it('should fail to transfer tokens if set allowance for toAddress instead of senderAddress', async () => { + const fromAddress = coinbase; + const transferAmount = new BigNumber(42); + + await zeroEx.token.setAllowanceAsync(token.address, fromAddress, toAddress, transferAmount); + + return expect(zeroEx.token.transferFromAsync( + token.address, fromAddress, toAddress, senderAddress, transferAmount, + )).to.be.rejectedWith(ZeroExError.INSUFFICIENT_ALLOWANCE_FOR_TRANSFER); + }); it('should fail to transfer tokens if fromAddress has insufficient balance', async () => { const fromAddress = addressWithoutFunds; const transferAmount = new BigNumber(42); |