Move isValidOrderHash to the order_hash_test file
This commit is contained in:
parent
4eb58a70bb
commit
aa997f1be5
@ -46,4 +46,19 @@ describe('Order hashing', () => {
|
|||||||
expect(() => orderHashUtils.getOrderHashHex(orderWithInvalidtakerFormat)).to.throw(expectedErrorMessage);
|
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();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -111,21 +111,6 @@ describe('Signature utils', () => {
|
|||||||
expect(salt.lessThan(twoPow256)).to.be.true();
|
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', () => {
|
describe('#ecSignOrderHashAsync', () => {
|
||||||
let stubs: Sinon.SinonStub[] = [];
|
let stubs: Sinon.SinonStub[] = [];
|
||||||
let makerAddress: string;
|
let makerAddress: string;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user