Minor refactor for clarity (#4174)
* Spelling & grammar in TxQueue Viewer description * minor refactor for clarity * Fix lint.
This commit is contained in:
parent
581604aae4
commit
7dde80fdf3
@ -18,12 +18,13 @@ import { keccak_256 } from 'js-sha3'; // eslint-disable-line camelcase
|
|||||||
|
|
||||||
export function isChecksumValid (_address) {
|
export function isChecksumValid (_address) {
|
||||||
const address = _address.replace('0x', '');
|
const address = _address.replace('0x', '');
|
||||||
const hash = keccak_256(address.toLowerCase(address));
|
const hash = keccak_256(address.toLowerCase());
|
||||||
|
|
||||||
for (let n = 0; n < 40; n++) {
|
for (let n = 0; n < 40; n++) {
|
||||||
|
const char = address[n];
|
||||||
|
const isLower = char !== char.toUpperCase();
|
||||||
|
const isUpper = char !== char.toLowerCase();
|
||||||
const hashval = parseInt(hash[n], 16);
|
const hashval = parseInt(hash[n], 16);
|
||||||
const isLower = address[n].toUpperCase() !== address[n];
|
|
||||||
const isUpper = address[n].toLowerCase() !== address[n];
|
|
||||||
|
|
||||||
if ((hashval > 7 && isLower) || (hashval <= 7 && isUpper)) {
|
if ((hashval > 7 && isLower) || (hashval <= 7 && isUpper)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
"id": "0xae74ad174b95cdbd01c88ac5b73a296d33e9088fc2a200e76bcedf3a94a7815d",
|
"id": "0xae74ad174b95cdbd01c88ac5b73a296d33e9088fc2a200e76bcedf3a94a7815d",
|
||||||
"url": "localtx",
|
"url": "localtx",
|
||||||
"name": "TxQueue Viewer",
|
"name": "TxQueue Viewer",
|
||||||
"description": "Have a peak on internals of transaction queue of your node.",
|
"description": "Have a peek at the internals of your node's transaction queue.",
|
||||||
"author": "Parity Team <admin@ethcore.io>",
|
"author": "Parity Team <admin@ethcore.io>",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"visible": true,
|
"visible": true,
|
||||||
|
Loading…
Reference in New Issue
Block a user