@@ -6,7 +6,7 @@ import { Button, UploadButton } from '../../components/Base';
66import { Input, InnerLabel, InputCaption } from '../../components/Base';
77import { Row, Col, H1, H3, Warning } from '../../components/Base';
88
9−import { BRIDGE_ERROR } from '../../lib/error';
9+import * as need from '../../lib/need';
1010import { EthereumWallet } from '../../lib/wallet';
1111import { compose } from '../../lib/lib';
1212import { withWallet } from '../../store/wallet';
@@ -32,21 +32,10 @@ class Keystore extends React.Component {
3232
3333 constructWallet() {
3434 const { setWallet } = this.props;
35− const { keystore, password } = this.state;
35+ const { password } = this.state;
3636
3737 try {
38− const text = keystore.matchWith({
39− Nothing: _ => {
40− throw BRIDGE_ERROR.MISSING_KEYSTORE;
41− },
42− Just: ks =>
43− ks.value.matchWith({
44− Ok: result => result.value,
45− Error: _ => {
46− throw BRIDGE_ERROR.MISSING_KEYSTORE;
47− },
48− }),
49− });
38+ const text = need.keystore(this.state);
5039
5140 const json = JSON.parse(text);
5241 const privateKey = keythereum.recover(password, json);