Importing the function from web3-utils, because ethers.js doesn't have any such utility function. 🙁
Adds address validation to the address inputs.
Importing the function from `web3-utils`, because `ethers.js` doesn't have any such utility function. :slightly_frowning_face:
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
I guess that duplication of `isValidAccount` can not be prevented as we need that method in both files?
bumi
(Migrated from github.com)
reviewed 2019-07-24 09:44:31 +00:00
That's not a check, that's actually creating a checksum address from a non-checksum one.
> 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.
raucao
(Migrated from github.com)
reviewed 2019-07-24 09:55:47 +00:00
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.
> 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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Adds address validation to the address inputs.
Importing the function from
web3-utils, becauseethers.jsdoesn't have any such utility function. 🙁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
isValidAccountcan not be prevented as we need that method in both files?@@ -1,7 +1,9 @@import Component from '@ember/component';why is this now
ethAddressand wasaccountbefore?That's not a check, that's actually creating a checksum address from a non-checksum one.
@@ -1,7 +1,9 @@import Component from '@ember/component';Typo. Thanks.
It can, but that would be way more complex and require more code than the de-duplication is worth. In essence,
isAddressis what's already de-duplicated here, and using it on this or that property is just a declarative action.Good to merge.