diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-06-03 09:42:09 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-06-03 09:42:09 +0800 |
commit | 272bea31b5983a64c26fdc28c827ccd456bc778f (patch) | |
tree | fd94bb05e80179a4d085114f71eab23dd02ab15f | |
parent | d0f8a14acec274e97d35d9f7a63605581ad21511 (diff) | |
download | tangerine-wallet-browser-272bea31b5983a64c26fdc28c827ccd456bc778f.tar tangerine-wallet-browser-272bea31b5983a64c26fdc28c827ccd456bc778f.tar.gz tangerine-wallet-browser-272bea31b5983a64c26fdc28c827ccd456bc778f.tar.bz2 tangerine-wallet-browser-272bea31b5983a64c26fdc28c827ccd456bc778f.tar.lz tangerine-wallet-browser-272bea31b5983a64c26fdc28c827ccd456bc778f.tar.xz tangerine-wallet-browser-272bea31b5983a64c26fdc28c827ccd456bc778f.tar.zst tangerine-wallet-browser-272bea31b5983a64c26fdc28c827ccd456bc778f.zip |
Fix hashed address validation
-rw-r--r-- | test/unit/util_test.js | 6 | ||||
-rw-r--r-- | ui/app/util.js | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/test/unit/util_test.js b/test/unit/util_test.js index 6ad27ed81..12a16999e 100644 --- a/test/unit/util_test.js +++ b/test/unit/util_test.js @@ -78,11 +78,11 @@ describe('util', function() { }) it('should recognize this sample hashed address', function() { - const address = '0x5Fda30Bb72B8Dfe20e48A00dFc108d0915BE9BbA' + const address = '0x5Fda30Bb72B8Dfe20e48A00dFc108d0915BE9Bb0' const result = util.isValidAddress(address) - const hashed = ethUtil.toChecksumAddress(address) + const hashed = ethUtil.toChecksumAddress(address.toLowerCase()) assert.equal(hashed, address, 'example is hashed correctly') - assert.ok(result) + assert.ok(result, 'is valid by our check') }) }) 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) { |