From b1c7291d3cfffb11a13c50a518f2b895bcdc9fc5 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 4 Jul 2017 10:27:31 -0700 Subject: Use orderHashSchema to validate order hash --- src/utils/assert.ts | 5 +---- src/utils/utils.ts | 4 ---- 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'src/utils') diff --git a/src/utils/assert.ts b/src/utils/assert.ts index 38c1d4aae..ec3790870 100644 --- a/src/utils/assert.ts +++ b/src/utils/assert.ts @@ -45,13 +45,10 @@ export const assert = { isNumber(variableName: string, value: number): void { this.assert(_.isFinite(value), this.typeAssertionMessage(variableName, 'number', value)); }, - isValidOrderHash(variableName: string, value: string): void { - this.assert(utils.isValidOrderHash(value), this.typeAssertionMessage(variableName, 'orderHash', value)); - }, isBoolean(variableName: string, value: boolean): void { this.assert(_.isBoolean(value), this.typeAssertionMessage(variableName, 'boolean', value)); }, - doesConformToSchema(variableName: string, value: object, schema: Schema): void { + doesConformToSchema(variableName: string, value: any, schema: Schema): void { const schemaValidator = new SchemaValidator(); const validationResult = schemaValidator.validate(value, schema); const hasValidationErrors = validationResult.errors.length > 0; diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 061e9f99a..ecc171bfe 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -25,10 +25,6 @@ export const utils = { isTestRpc(nodeVersion: string): boolean { return _.includes(nodeVersion, 'TestRPC'); }, - isValidOrderHash(orderHashHex: string): boolean { - const isValid = /^0x[0-9A-F]{64}$/i.test(orderHashHex); - return isValid; - }, spawnSwitchErr(name: string, value: any): Error { return new Error(`Unexpected switch value: ${value} encountered for ${name}`); }, -- cgit