aboutsummaryrefslogtreecommitdiffstats
path: root/test/0x.js.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/0x.js.ts')
-rw-r--r--test/0x.js.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/0x.js.ts b/test/0x.js.ts
index 09266018b..2ac6a2bea 100644
--- a/test/0x.js.ts
+++ b/test/0x.js.ts
@@ -52,7 +52,7 @@ describe('ZeroEx library', () => {
});
});
it('should return false if the data doesn\'t pertain to the signature & address', () => {
- const isValid = ZeroEx.isValidSignature('wrong data', signature, address);
+ const isValid = ZeroEx.isValidSignature('0x00', signature, address);
expect(isValid).to.be.false;
});
it('should return false if the address doesn\'t pertain to the signature & data', () => {
@@ -82,4 +82,14 @@ describe('ZeroEx library', () => {
expect(salt.lessThan(twoPow256)).to.be.true;
});
});
+ describe('#isValidOrderHash', () => {
+ it('returns false if the length is wrong', () => {
+ const isValid = ZeroEx.isValidOrderHash('0xdeadbeef');
+ expect(isValid).to.be.false;
+ });
+ it('returns true if order hash is correct', () => {
+ const isValid = ZeroEx.isValidOrderHash('0x' + Array(65).join('0'));
+ expect(isValid).to.be.true;
+ });
+ });
});