diff options
author | Fabio Berger <me@fabioberger.com> | 2017-05-25 18:27:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-25 18:27:49 +0800 |
commit | b1a6c895cc095b39c263ff508d98395b1b901dc6 (patch) | |
tree | 355fd7e1f9a34a88a6f190d0942f4348c553ecd6 /src/ts/0x.js.ts | |
parent | 334d2f175fd9dcb3f9e336250d21c7916a2671ae (diff) | |
parent | 2117b4e0c87df277f5e8df54e8df922bdf19c298 (diff) | |
download | dexon-sol-tools-b1a6c895cc095b39c263ff508d98395b1b901dc6.tar dexon-sol-tools-b1a6c895cc095b39c263ff508d98395b1b901dc6.tar.gz dexon-sol-tools-b1a6c895cc095b39c263ff508d98395b1b901dc6.tar.bz2 dexon-sol-tools-b1a6c895cc095b39c263ff508d98395b1b901dc6.tar.lz dexon-sol-tools-b1a6c895cc095b39c263ff508d98395b1b901dc6.tar.xz dexon-sol-tools-b1a6c895cc095b39c263ff508d98395b1b901dc6.tar.zst dexon-sol-tools-b1a6c895cc095b39c263ff508d98395b1b901dc6.zip |
Merge pull request #10 from 0xProject/addSchemas
Add schema validation
Diffstat (limited to 'src/ts/0x.js.ts')
-rw-r--r-- | src/ts/0x.js.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ts/0x.js.ts b/src/ts/0x.js.ts index 4b9680a18..1cc2d8b44 100644 --- a/src/ts/0x.js.ts +++ b/src/ts/0x.js.ts @@ -1,6 +1,7 @@ import * as BigNumber from 'bignumber.js'; import * as ethUtil from 'ethereumjs-util'; import {assert} from './utils/assert'; +import {ECSignatureSchema} from './schemas/ec_signature_schema'; /** * Elliptic Curve signature @@ -20,7 +21,7 @@ export class ZeroEx { */ public static isValidSignature(data: string, signature: ECSignature, signer: ETHAddressHex): boolean { assert.isString('data', data); - assert.isObject('signature', signature); + assert.doesConformToSchema('signature', signature, ECSignatureSchema); assert.isETHAddressHex('signer', signer); const dataBuff = ethUtil.toBuffer(data); |