Closed raucao closed 4 years ago
ethers has that getchcksumaddress function that does some check: https://github.com/ethers-io/ethers.js/blob/061b0eae1d4c570aedd9bee1971afa43fcdae1a6/src.ts/utils/address.ts#L22
I guess that duplication of isValidAccount
can not be prevented as we need that method in both files?
ethers has that getchcksumaddress function that does some check: https://github.com/ethers-io/ethers.js/blob/061b0eae1d4c570aedd9bee1971afa43fcdae1a6/src.ts/utils/address.ts#L22
That's not a check, that's actually creating a checksum address from a non-checksum one.
I guess that duplication of
isValidAccount
can not be prevented as we need that method in both files?
It can, but that would be way more complex and require more code than the de-duplication is worth. In essence, isAddress
is what's already de-duplicated here, and using it on this or that property is just a declarative action.
Good to merge.
Adds address validation to the address inputs.
Importing the function from
web3-utils
, becauseethers.js
doesn't have any such utility function. :slightly_frowning_face: