From 961f274c6a896c768d9cc4583c0d0569b455c668 Mon Sep 17 00:00:00 2001 From: nicolas Date: Wed, 12 May 2021 07:00:44 -0300 Subject: [PATCH] Fix: remove auto checksum address from InputAddress (#2242) * Fix: remove auto chacksum address from InputAddress * Mikhail feedback Co-authored-by: katspaugh --- src/components/forms/AddressInput/index.tsx | 3 --- src/components/forms/validator.test.ts | 2 +- src/components/forms/validator.ts | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/forms/AddressInput/index.tsx b/src/components/forms/AddressInput/index.tsx index 46168ba9..77224645 100644 --- a/src/components/forms/AddressInput/index.tsx +++ b/src/components/forms/AddressInput/index.tsx @@ -62,9 +62,6 @@ const AddressInput = ({ } catch (err) { console.error('Failed to resolve address for ENS name: ', err) } - } else { - const formattedAddress = checksumAddress(address) - fieldMutator(formattedAddress) } }} diff --git a/src/components/forms/validator.test.ts b/src/components/forms/validator.test.ts index cd1918ba..cc8352fe 100644 --- a/src/components/forms/validator.test.ts +++ b/src/components/forms/validator.test.ts @@ -130,7 +130,7 @@ describe('Forms > Validators', () => { }) describe('mustBeEthereumAddress validator', () => { - const MUST_BE_ETH_ADDRESS_ERR_MSG = 'Input must be a valid Ethereum address, ENS or Unstoppable domain' + const MUST_BE_ETH_ADDRESS_ERR_MSG = 'Must be a valid address, ENS or Unstoppable domain' it('Returns undefined for a valid ethereum address', async () => { expect(await mustBeEthereumAddress('0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe')).toBeUndefined() diff --git a/src/components/forms/validator.ts b/src/components/forms/validator.ts index b1bbd2bf..28211b89 100644 --- a/src/components/forms/validator.ts +++ b/src/components/forms/validator.ts @@ -68,7 +68,7 @@ export const mustBeEthereumAddress = memoize( const startsWith0x = address?.startsWith('0x') const isAddress = getWeb3().utils.isAddress(address) - const errorMessage = `Input must be a valid Ethereum address${ + const errorMessage = `Must be a valid address${ isFeatureEnabled(FEATURES.DOMAIN_LOOKUP) ? ', ENS or Unstoppable domain' : '' }`