@@ -7,8 +7,6 @@ import { Row, Col, H1 } from '../components/Base'
7import { ROUTE_NAMES } from '../lib/router'
7import { ROUTE_NAMES } from '../lib/router'
8import { EthereumWallet } from '../lib/wallet'
8import { EthereumWallet } from '../lib/wallet'
10−const secre = /[0-9A-Fa-f]{64}/g
12class PrivateKey extends React.Component {
10class PrivateKey extends React.Component {
14 constructor(props) {
12 constructor(props) {
@@ -28,7 +26,7 @@ class PrivateKey extends React.Component {
29 constructWallet(privateKey) {
27 constructWallet(privateKey) {
30 const { setWallet } = this.props
28 const { setWallet } = this.props
31− if (secre.test(privateKey) === true) {
29+ if (/^[0-9A-Fa-f]{64}$/g.test(privateKey) === true) {
32 const sec = Buffer.from(privateKey, 'hex')
30 const sec = Buffer.from(privateKey, 'hex')
33 const wallet = new EthereumWallet(sec)
31 const wallet = new EthereumWallet(sec)
34 setWallet(Maybe.Just(wallet))
32 setWallet(Maybe.Just(wallet))