aboutsummaryrefslogtreecommitdiffstats
path: root/test/0x.js.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-05-25 01:01:19 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-05-25 01:01:19 +0800
commit762db7961e3592faa277b60f25173a6a7874d5c4 (patch)
tree97478ac553ef0460db5c2635a8b70220f5387e1d /test/0x.js.ts
parent522300c0ab05b6f8f4c2874b2d0a690196715165 (diff)
downloaddexon-sol-tools-762db7961e3592faa277b60f25173a6a7874d5c4.tar
dexon-sol-tools-762db7961e3592faa277b60f25173a6a7874d5c4.tar.gz
dexon-sol-tools-762db7961e3592faa277b60f25173a6a7874d5c4.tar.bz2
dexon-sol-tools-762db7961e3592faa277b60f25173a6a7874d5c4.tar.lz
dexon-sol-tools-762db7961e3592faa277b60f25173a6a7874d5c4.tar.xz
dexon-sol-tools-762db7961e3592faa277b60f25173a6a7874d5c4.tar.zst
dexon-sol-tools-762db7961e3592faa277b60f25173a6a7874d5c4.zip
Add test for malformed s
Diffstat (limited to 'test/0x.js.ts')
-rw-r--r--test/0x.js.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/0x.js.ts b/test/0x.js.ts
index 651407af3..3d9a7a810 100644
--- a/test/0x.js.ts
+++ b/test/0x.js.ts
@@ -42,6 +42,16 @@ describe('ZeroEx library', () => {
const isValid = ZeroEx.isValidSignature(data, malformedSignature, address);
expect(isValid).to.be.false;
});
+ it('s is not hex', () => {
+ const malformedS = signature.s.replace('0', 'z');
+ const malformedSignature = {
+ v: signature.v,
+ r: signature.r,
+ s: malformedS,
+ };
+ const isValid = ZeroEx.isValidSignature(data, malformedSignature, address);
+ expect(isValid).to.be.false;
+ });
});
it('should return false if the data doesn\'t pertain to the signature & address', () => {
const isValid = ZeroEx.isValidSignature('wrong data', signature, address);