diff options
author | Leonid <logvinov.leon@gmail.com> | 2017-06-06 17:38:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-06 17:38:47 +0800 |
commit | 06c6ae0dbd0138d872b2ad0519e3b316b67ad470 (patch) | |
tree | 14b61536fdf51d24b040a8456bd7a7629151707d | |
parent | eb5c9ae70886cb1a14ae154f363f052a76b24479 (diff) | |
parent | 39958be0b81a4de8e09ea1e783231cc0a9417e36 (diff) | |
download | dexon-sol-tools-06c6ae0dbd0138d872b2ad0519e3b316b67ad470.tar dexon-sol-tools-06c6ae0dbd0138d872b2ad0519e3b316b67ad470.tar.gz dexon-sol-tools-06c6ae0dbd0138d872b2ad0519e3b316b67ad470.tar.bz2 dexon-sol-tools-06c6ae0dbd0138d872b2ad0519e3b316b67ad470.tar.lz dexon-sol-tools-06c6ae0dbd0138d872b2ad0519e3b316b67ad470.tar.xz dexon-sol-tools-06c6ae0dbd0138d872b2ad0519e3b316b67ad470.tar.zst dexon-sol-tools-06c6ae0dbd0138d872b2ad0519e3b316b67ad470.zip |
Merge pull request #36 from 0xProject/regression-test-transferFrom
Add regression test for transferFrom bug
-rw-r--r-- | test/token_wrapper_test.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/token_wrapper_test.ts b/test/token_wrapper_test.ts index 698ad5b6a..ffe3db983 100644 --- a/test/token_wrapper_test.ts +++ b/test/token_wrapper_test.ts @@ -89,6 +89,17 @@ describe('TokenWrapper', () => { token.address, fromAddress, toAddress, senderAddress, transferAmount, )).to.be.rejectedWith(ZeroExError.INSUFFICIENT_ALLOWANCE_FOR_TRANSFER); }); + it('[regression] 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); |