diff options
Diffstat (limited to 'src/ts')
-rw-r--r-- | src/ts/0x.js.ts | 8 | ||||
-rw-r--r-- | src/ts/globals.d.ts | 5 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/ts/0x.js.ts b/src/ts/0x.js.ts index 1f9ea5f9b..89d049bec 100644 --- a/src/ts/0x.js.ts +++ b/src/ts/0x.js.ts @@ -19,12 +19,12 @@ export class ZeroEx { * Verifies that the elliptic curve signature `signature` was generated * by signing `data` with the private key corresponding to the `signer` address. */ - public static isValidSignature(data: HexString, signature: ECSignature, signer: ETHAddressHex): boolean { - assert.isString('data', data); + public static isValidSignature(dataHex: string, signature: ECSignature, signer: ETHAddressHex): boolean { + assert.isHexString('dataHex', dataHex); assert.isObject('signature', signature); assert.isETHAddressHex('signer', signer); - const dataBuff = ethUtil.toBuffer(data); + const dataBuff = ethUtil.toBuffer(dataHex); const msgHashBuff = ethUtil.hashPersonalMessage(dataBuff); try { const pubKey = ethUtil.ecrecover(msgHashBuff, @@ -51,7 +51,7 @@ export class ZeroEx { return salt; } /** Checks if order hash is valid */ - public static isValidOrderHash(orderHash: HexString): boolean { + public static isValidOrderHash(orderHash: string): boolean { assert.isHexString('orderHash', orderHash); return orderHash.length === ORDER_HASH_LENGTH; } diff --git a/src/ts/globals.d.ts b/src/ts/globals.d.ts index 9b81e15bd..c9cc0d481 100644 --- a/src/ts/globals.d.ts +++ b/src/ts/globals.d.ts @@ -1,12 +1,11 @@ declare type ETHPublicKey = string; declare type ETHAddressHex = string; -declare type HexString = string; declare type ETHAddressBuff = Buffer; declare module 'ethereumjs-util' { - const toBuffer: (data: HexString) => Buffer; + const toBuffer: (dataHex: string) => Buffer; const hashPersonalMessage: (msg: Buffer) => Buffer; - const bufferToHex: (buff: Buffer) => HexString; + const bufferToHex: (buff: Buffer) => string; const ecrecover: (msgHashBuff: Buffer, v: number, r: Buffer, s: Buffer) => ETHPublicKey; const pubToAddress: (pubKey: ETHPublicKey) => ETHAddressBuff; } |