diff options
-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) { |