From 5ba62ccd45f170f6078928e01433990b83d1b171 Mon Sep 17 00:00:00 2001 From: William O'Beirne Date: Mon, 11 Jun 2018 17:22:25 -0400 Subject: [PATCH] Hex prefix & checksum paper wallet address. (#1926) --- common/components/PaperWallet/index.tsx | 4 +++- common/components/ui/Identicon.tsx | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/components/PaperWallet/index.tsx b/common/components/PaperWallet/index.tsx index db23352f..1d4c7b85 100644 --- a/common/components/PaperWallet/index.tsx +++ b/common/components/PaperWallet/index.tsx @@ -1,5 +1,6 @@ import { Identicon, QRCode } from 'components/ui'; import React from 'react'; +import { addHexPrefix, toChecksumAddress } from 'ethereumjs-util'; import ethLogo from 'assets/images/logo-ethereum-1.png'; import notesBg from 'assets/images/notes-bg.png'; @@ -96,7 +97,8 @@ interface Props { export default class PaperWallet extends React.Component { public render() { - const { privateKey, address } = this.props; + const { privateKey } = this.props; + const address = toChecksumAddress(addHexPrefix(this.props.address)); return (
diff --git a/common/components/ui/Identicon.tsx b/common/components/ui/Identicon.tsx index c7733f7e..fc4de891 100644 --- a/common/components/ui/Identicon.tsx +++ b/common/components/ui/Identicon.tsx @@ -11,7 +11,6 @@ interface Props { export default function Identicon(props: Props) { const size = props.size || '4rem'; const { address, className = '' } = props; - // FIXME breaks on failed checksums const identiconDataUrl = isValidETHAddress(address) ? makeBlockie(address) : ''; return ( // Use inline styles for printable wallets