aboutsummaryrefslogtreecommitdiffstats
path: root/packages/assert/src
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/assert/src
parentf689d335c0c4042e7ecf3e4636db3434d0dcd7a8 (diff)
downloaddexon-sol-tools-eabe96fd194f21b1c670381506b115589a37eff5.tar
dexon-sol-tools-eabe96fd194f21b1c670381506b115589a37eff5.tar.gz
dexon-sol-tools-eabe96fd194f21b1c670381506b115589a37eff5.tar.bz2
dexon-sol-tools-eabe96fd194f21b1c670381506b115589a37eff5.tar.lz
dexon-sol-tools-eabe96fd194f21b1c670381506b115589a37eff5.tar.xz
dexon-sol-tools-eabe96fd194f21b1c670381506b115589a37eff5.tar.zst
dexon-sol-tools-eabe96fd194f21b1c670381506b115589a37eff5.zip
Check isETHAddressHex before lowercase
Flip the check so assertion happens before lowercase
Diffstat (limited to 'packages/assert/src')
-rw-r--r--packages/assert/src/index.ts5
1 files changed, 1 insertions, 4 deletions
diff --git a/packages/assert/src/index.ts b/packages/assert/src/index.ts
index 7ad574ec7..a9d553487 100644
--- a/packages/assert/src/index.ts
+++ b/packages/assert/src/index.ts
@@ -33,11 +33,8 @@ export const assert = {
);
},
isETHAddressHex(variableName: string, value: string): void {
+ this.assert(_.isString(value), this.typeAssertionMessage(variableName, 'string', value));
this.assert(addressUtils.isAddress(value), this.typeAssertionMessage(variableName, 'ETHAddressHex', value));
- this.assert(
- addressUtils.isAddress(value) && value.toLowerCase() === value,
- `Checksummed addresses are not supported. Convert ${variableName} to lower case before passing`,
- );
},
doesBelongToStringEnum(
variableName: string,