aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/schemas/basic_type_schemas.ts2
-rw-r--r--src/utils/assert.ts4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/schemas/basic_type_schemas.ts b/src/schemas/basic_type_schemas.ts
index c3b81185d..5d66cf79b 100644
--- a/src/schemas/basic_type_schemas.ts
+++ b/src/schemas/basic_type_schemas.ts
@@ -1,7 +1,7 @@
export const addressSchema = {
id: '/addressSchema',
type: 'string',
- pattern: '^0[xX][0-9A-Fa-f]{40}$',
+ pattern: '^0x[0-9a-f]{40}$',
};
export const numberSchema = {
diff --git a/src/utils/assert.ts b/src/utils/assert.ts
index 969209208..d835d85c5 100644
--- a/src/utils/assert.ts
+++ b/src/utils/assert.ts
@@ -24,6 +24,10 @@ export const assert = {
isETHAddressHex(variableName: string, value: string): void {
const web3 = new Web3();
this.assert(web3.isAddress(value), this.typeAssertionMessage(variableName, 'ETHAddressHex', value));
+ this.assert(
+ web3.isAddress(value) && !web3.isChecksumAddress(value),
+ 'Checksummed addresses are not supported. Convert to lower case before passing',
+ );
},
doesBelongToStringEnum(variableName: string, value: string,
stringEnum: any /* There is no base type for every string enum */): void {