From c7fbf55143b0ec12db4812eed6adaa46af0313ea Mon Sep 17 00:00:00 2001 From: josemarinas <36479864+josemarinas@users.noreply.github.com> Date: Mon, 23 Oct 2023 12:22:16 +0200 Subject: [PATCH] Fix: ENS name regex (#291) * fix ens name regex * update tests * fix regex * fix regex * update changelog * update version --- modules/client-common/CHANGELOG.md | 3 +++ modules/client-common/package.json | 2 +- modules/client-common/src/constants.ts | 2 +- modules/client-common/test/constants.ts | 2 +- modules/client/CHANGELOG.md | 6 +++++- modules/client/package.json | 4 ++-- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/modules/client-common/CHANGELOG.md b/modules/client-common/CHANGELOG.md index 7e806c6a3..6734f40c6 100644 --- a/modules/client-common/CHANGELOG.md +++ b/modules/client-common/CHANGELOG.md @@ -18,6 +18,9 @@ TEMPLATE: --> ## [UPCOMING] +### Fixed + +- ENS name Regex ## [1.7.0] ### Added diff --git a/modules/client-common/package.json b/modules/client-common/package.json index 9d453dede..77da65a5d 100644 --- a/modules/client-common/package.json +++ b/modules/client-common/package.json @@ -1,7 +1,7 @@ { "name": "@aragon/sdk-client-common", "author": "Aragon Association", - "version": "1.7.0", + "version": "1.7.1", "license": "MIT", "main": "dist/index.js", "module": "dist/sdk-client-common.esm.js", diff --git a/modules/client-common/src/constants.ts b/modules/client-common/src/constants.ts index 4e635b2ef..053a44fa2 100644 --- a/modules/client-common/src/constants.ts +++ b/modules/client-common/src/constants.ts @@ -416,5 +416,5 @@ export const IPFS_URI_REGEX = export const OSX_PROPOSAL_ID_REGEX = /^(0x[A-Fa-f0-9]{40})_(0x[A-Fa-f0-9]{1,64})$/; export const HEX_STRING_REGEX = /^(0x)?[0-9a-fA-F]*$/; -export const ENS_REGEX = /^[a-z0-9-]+\.eth$/; +export const ENS_REGEX = /^(?:[a-z0-9-]+\.)*[a-z0-9-]+\.eth$/; export const SUBDOMAIN_REGEX = /^[a-z0-9-]+$/; diff --git a/modules/client-common/test/constants.ts b/modules/client-common/test/constants.ts index a3fe52d5a..c0cfe2acb 100644 --- a/modules/client-common/test/constants.ts +++ b/modules/client-common/test/constants.ts @@ -114,7 +114,7 @@ export const TEST_ADDRESS = "0x0000000000000000000000000000000000000001"; export const TEST_INVALID_ADDRESS = "0x000000000000000000000000000000000000000P"; -export const TEST_ENS_NAME = "test.eth"; +export const TEST_ENS_NAME = "subdomain.test.eth"; export const TEST_INVALID_ENS_NAME = "test.invalid"; export const TEST_IPFS_CID_V0 = diff --git a/modules/client/CHANGELOG.md b/modules/client/CHANGELOG.md index 578daf5bd..edf8f95ba 100644 --- a/modules/client/CHANGELOG.md +++ b/modules/client/CHANGELOG.md @@ -18,14 +18,18 @@ TEMPLATE: --> ## [UPCOMING] +### Fixed + +- Ens name regex +## [1.16.1] ### Fixed - Estimations using `getProvider` instead of `getConnectedSigner` in functions where the identity of the wallet is needed ## [1.16.0] -### Added +### Added - Helper for `daoUpdateAction` in `Client` ### Changed diff --git a/modules/client/package.json b/modules/client/package.json index dc00a491b..217221347 100644 --- a/modules/client/package.json +++ b/modules/client/package.json @@ -1,7 +1,7 @@ { "name": "@aragon/sdk-client", "author": "Aragon Association", - "version": "1.16.1", + "version": "1.16.2", "license": "MIT", "main": "dist/index.js", "module": "dist/sdk-client.esm.js", @@ -62,7 +62,7 @@ }, "dependencies": { "@aragon/osx-ethers": "1.3.0-rc0.3", - "@aragon/sdk-client-common": "^1.7.0", + "@aragon/sdk-client-common": "^1.7.1", "@aragon/sdk-ipfs": "^1.1.0", "@ethersproject/abstract-signer": "^5.5.0", "@ethersproject/bignumber": "^5.6.0",