Validate Ethereum addresses in input fields #144

Merged
raucao merged 2 commits from feature/validate_eth_addresses into feature/signup 2019-07-24 15:30:52 +00:00
raucao commented 2019-07-22 15:31:07 +00:00 (Migrated from github.com)

Adds address validation to the address inputs.

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:
bumi commented 2019-07-24 09:42:45 +00:00 (Migrated from github.com)

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 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
@@ -1,7 +1,9 @@
import Component from '@ember/component';
bumi (Migrated from github.com) commented 2019-07-24 09:44:31 +00:00

why is this now ethAddress and was account before?

why is this now `ethAddress` and was `account` before?
raucao commented 2019-07-24 09:50:20 +00:00 (Migrated from github.com)

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.

> 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
@@ -1,7 +1,9 @@
import Component from '@ember/component';
raucao (Migrated from github.com) commented 2019-07-24 09:55:47 +00:00

Typo. Thanks.

Typo. Thanks.
raucao commented 2019-07-24 09:58:13 +00:00 (Migrated from github.com)

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.
raucao commented 2019-07-24 09:59:00 +00:00 (Migrated from github.com)

Good to merge.

Good to merge.
Sign in to join this conversation.