diff options
author | Fabio Berger <me@fabioberger.com> | 2017-05-25 17:27:27 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-05-25 17:27:27 +0800 |
commit | 0b8ddc1ee18c6d52fbc72177e8c5e180f9106708 (patch) | |
tree | a9d6204be88ecdb724742ab1a2fdabe24ffc8e29 /src/ts/0x.js.ts | |
parent | d23dbf53fd3689613f28d576d03ccfdce94b6646 (diff) | |
download | dexon-sol-tools-0b8ddc1ee18c6d52fbc72177e8c5e180f9106708.tar dexon-sol-tools-0b8ddc1ee18c6d52fbc72177e8c5e180f9106708.tar.gz dexon-sol-tools-0b8ddc1ee18c6d52fbc72177e8c5e180f9106708.tar.bz2 dexon-sol-tools-0b8ddc1ee18c6d52fbc72177e8c5e180f9106708.tar.lz dexon-sol-tools-0b8ddc1ee18c6d52fbc72177e8c5e180f9106708.tar.xz dexon-sol-tools-0b8ddc1ee18c6d52fbc72177e8c5e180f9106708.tar.zst dexon-sol-tools-0b8ddc1ee18c6d52fbc72177e8c5e180f9106708.zip |
Add schema validation and assertion, create ECSignature schema
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 acbdd01e2..8de87e96e 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 @@ -18,7 +19,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); |