diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-06-03 10:06:46 +0800 |
---|---|---|
committer | kumavis <kumavis@users.noreply.github.com> | 2016-06-03 10:06:46 +0800 |
commit | 6dec937c2a3b72cd5863edef1ced818fe32e43f0 (patch) | |
tree | 51f723c313c493b64ba3fcff7352a9683386bf3c | |
parent | 574b7424097583fb8e588d95c7596f30d2024065 (diff) | |
parent | 272bea31b5983a64c26fdc28c827ccd456bc778f (diff) | |
download | tangerine-wallet-browser-6dec937c2a3b72cd5863edef1ced818fe32e43f0.tar tangerine-wallet-browser-6dec937c2a3b72cd5863edef1ced818fe32e43f0.tar.gz tangerine-wallet-browser-6dec937c2a3b72cd5863edef1ced818fe32e43f0.tar.bz2 tangerine-wallet-browser-6dec937c2a3b72cd5863edef1ced818fe32e43f0.tar.lz tangerine-wallet-browser-6dec937c2a3b72cd5863edef1ced818fe32e43f0.tar.xz tangerine-wallet-browser-6dec937c2a3b72cd5863edef1ced818fe32e43f0.tar.zst tangerine-wallet-browser-6dec937c2a3b72cd5863edef1ced818fe32e43f0.zip |
Merge pull request #242 from MetaMask/HashFix
provider-engine hooked wallet - checkSum addresses not recognized
-rw-r--r-- | test/unit/util_test.js | 7 | ||||
-rw-r--r-- | ui/app/util.js | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/test/unit/util_test.js b/test/unit/util_test.js index f003395b3..12a16999e 100644 --- a/test/unit/util_test.js +++ b/test/unit/util_test.js @@ -77,6 +77,13 @@ describe('util', function() { assert.ok(!result) }) + it('should recognize this sample hashed address', function() { + const address = '0x5Fda30Bb72B8Dfe20e48A00dFc108d0915BE9Bb0' + const result = util.isValidAddress(address) + const hashed = ethUtil.toChecksumAddress(address.toLowerCase()) + assert.equal(hashed, address, 'example is hashed correctly') + assert.ok(result, 'is valid by our check') + }) }) describe('numericBalance', function() { diff --git a/ui/app/util.js b/ui/app/util.js index 91f85e43f..6ece28a9e 100644 --- a/ui/app/util.js +++ b/ui/app/util.js @@ -52,7 +52,7 @@ function addressSummary(address) { function isValidAddress(address) { var prefixed = ethUtil.addHexPrefix(address) - return isAllOneCase(prefixed) && ethUtil.isValidAddress(prefixed) || ethUtil.isValidChecksumAddress(prefixed) + return (isAllOneCase(prefixed) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed) } function isAllOneCase(address) { |