aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/src/0x.ts
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2018-02-24 02:36:16 +0800
committerJacob Evans <jacob@dekz.net>2018-02-27 01:39:46 +0800
commiteabe96fd194f21b1c670381506b115589a37eff5 (patch)
tree3998559ffc4f2dea03871068f73a25d90ffc66f8 /packages/0x.js/src/0x.ts
parentf689d335c0c4042e7ecf3e4636db3434d0dcd7a8 (diff)
downloaddexon-0x-contracts-eabe96fd194f21b1c670381506b115589a37eff5.tar.gz
dexon-0x-contracts-eabe96fd194f21b1c670381506b115589a37eff5.tar.zst
dexon-0x-contracts-eabe96fd194f21b1c670381506b115589a37eff5.zip
Check isETHAddressHex before lowercase
Flip the check so assertion happens before lowercase
Diffstat (limited to 'packages/0x.js/src/0x.ts')
-rw-r--r--packages/0x.js/src/0x.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts
index c37b3e1ef..fa00bcd1a 100644
--- a/packages/0x.js/src/0x.ts
+++ b/packages/0x.js/src/0x.ts
@@ -71,10 +71,10 @@ export class ZeroEx {
* @return Whether the signature is valid for the supplied signerAddress and data.
*/
public static isValidSignature(data: string, signature: ECSignature, signerAddress: string): boolean {
- const normalizedSignerAddress = signerAddress.toLowerCase();
assert.isHexString('data', data);
assert.doesConformToSchema('signature', signature, schemas.ecSignatureSchema);
- assert.isETHAddressHex('signerAddress', normalizedSignerAddress);
+ assert.isETHAddressHex('signerAddress', signerAddress);
+ const normalizedSignerAddress = signerAddress.toLowerCase();
const isValidSignature = signatureUtils.isValidSignature(data, signature, normalizedSignerAddress);
return isValidSignature;
@@ -245,9 +245,8 @@ export class ZeroEx {
shouldAddPersonalMessagePrefix: boolean,
): Promise<ECSignature> {
assert.isHexString('orderHash', orderHash);
+ await assert.isSenderAddressAsync('signerAddress', signerAddress, this._web3Wrapper);
const normalizedSignerAddress = signerAddress.toLowerCase();
- assert.isETHAddressHex('signerAddress', normalizedSignerAddress);
- await assert.isSenderAddressAsync('signerAddress', normalizedSignerAddress, this._web3Wrapper);
let msgHashHex = orderHash;
if (shouldAddPersonalMessagePrefix) {