From de1a366deeeca22b3ed761bf569b63548cedd8cc Mon Sep 17 00:00:00 2001 From: Peter Michael Date: Wed, 23 Mar 2022 16:27:37 -0400 Subject: [PATCH] feat: (WIP) Added hyphens and underscores as valid handle characters. --- contracts/libraries/PublishingLogic.sol | 5 ++++- test/__setup.spec.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/contracts/libraries/PublishingLogic.sol b/contracts/libraries/PublishingLogic.sol index c6170b4..b5cb02e 100644 --- a/contracts/libraries/PublishingLogic.sol +++ b/contracts/libraries/PublishingLogic.sol @@ -404,7 +404,10 @@ library PublishingLogic { if ( (byteHandle[i] < '0' || byteHandle[i] > 'z' || - (byteHandle[i] > '9' && byteHandle[i] < 'a')) && byteHandle[i] != '.' + (byteHandle[i] > '9' && byteHandle[i] < 'a')) && + byteHandle[i] != '.' && + byteHandle[i] != '-' && + byteHandle[i] != '_' ) revert Errors.HandleContainsInvalidCharacters(); } } diff --git a/test/__setup.spec.ts b/test/__setup.spec.ts index d89ca9c..3f20b5f 100644 --- a/test/__setup.spec.ts +++ b/test/__setup.spec.ts @@ -65,7 +65,7 @@ export const REFERRAL_FEE_BPS = 250; export const MAX_PROFILE_IMAGE_URI_LENGTH = 6000; export const LENS_HUB_NFT_NAME = 'Lens Profiles'; export const LENS_HUB_NFT_SYMBOL = 'LENS'; -export const MOCK_PROFILE_HANDLE = 'plant1ghost.eth'; +export const MOCK_PROFILE_HANDLE = 'plant-1_ghost.eth'; export const PERIPHERY_DATA_PROVIDER_NAME = 'LensPeripheryDataProvider'; export const FIRST_PROFILE_ID = 1; export const MOCK_URI = 'https://ipfs.io/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR';