diff options
Diffstat (limited to 'packages/order-utils')
-rw-r--r-- | packages/order-utils/test/order_hash_test.ts | 15 | ||||
-rw-r--r-- | packages/order-utils/test/signature_utils_test.ts | 15 |
2 files changed, 15 insertions, 15 deletions
diff --git a/packages/order-utils/test/order_hash_test.ts b/packages/order-utils/test/order_hash_test.ts index 21ae22589..d571fc62a 100644 --- a/packages/order-utils/test/order_hash_test.ts +++ b/packages/order-utils/test/order_hash_test.ts @@ -46,4 +46,19 @@ describe('Order hashing', () => { expect(() => orderHashUtils.getOrderHashHex(orderWithInvalidtakerFormat)).to.throw(expectedErrorMessage); }); }); + describe('#isValidOrderHash', () => { + it('returns false if the value is not a hex string', () => { + const isValid = orderHashUtils.isValidOrderHash('not a hex'); + expect(isValid).to.be.false(); + }); + it('returns false if the length is wrong', () => { + const isValid = orderHashUtils.isValidOrderHash('0xdeadbeef'); + expect(isValid).to.be.false(); + }); + it('returns true if order hash is correct', () => { + const orderHashLength = 65; + const isValid = orderHashUtils.isValidOrderHash('0x' + Array(orderHashLength).join('0')); + expect(isValid).to.be.true(); + }); + }); }); diff --git a/packages/order-utils/test/signature_utils_test.ts b/packages/order-utils/test/signature_utils_test.ts index 773a32a56..321e7313f 100644 --- a/packages/order-utils/test/signature_utils_test.ts +++ b/packages/order-utils/test/signature_utils_test.ts @@ -111,21 +111,6 @@ describe('Signature utils', () => { expect(salt.lessThan(twoPow256)).to.be.true(); }); }); - describe('#isValidOrderHash', () => { - it('returns false if the value is not a hex string', () => { - const isValid = orderHashUtils.isValidOrderHash('not a hex'); - expect(isValid).to.be.false(); - }); - it('returns false if the length is wrong', () => { - const isValid = orderHashUtils.isValidOrderHash('0xdeadbeef'); - expect(isValid).to.be.false(); - }); - it('returns true if order hash is correct', () => { - const orderHashLength = 65; - const isValid = orderHashUtils.isValidOrderHash('0x' + Array(orderHashLength).join('0')); - expect(isValid).to.be.true(); - }); - }); describe('#ecSignOrderHashAsync', () => { let stubs: Sinon.SinonStub[] = []; let makerAddress: string; |