Skip to content

Commit

Permalink
fix import mnemonic bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MickWang committed Aug 15, 2018
1 parent 4beff07 commit 85001db
Show file tree
Hide file tree
Showing 10 changed files with 10,952 additions and 5,483 deletions.
Binary file modified build/icons/256x256.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/icons/512x512.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/icons/icon.icns
Binary file not shown.
Binary file modified build/icons/icon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -2,7 +2,7 @@
"name": "ont-wallet-test",
"productName": "OWallet",
"homepage": "http://ont.io",
"version": "v0.8.2",
"version": "v0.8.3",
"author": "MickeyWang <wangdashuang@onchain.com>",
"description": "ledger",
"license": "Apache-2.0",
Expand Down Expand Up @@ -70,7 +70,7 @@
"icon": "build/icons"
},
"directories": {
"buildResources": "resources",
"buildResources": "build",
"output": "release"
},
"mac": {
Expand Down
22 changes: 20 additions & 2 deletions src/renderer/components/Dashboard.vue
Expand Up @@ -302,6 +302,17 @@
color: #5E6369;
border: none;
}
.copy-icon {
width:18px;
height:18px;
display: inline-block;
margin-left: 10px;
background: url('../assets/copy.png') center center;
background-size: cover;
cursor: pointer;
position: relative;
top: 5px;
}
</style>
<template>
<div class="home-container">
Expand All @@ -310,7 +321,10 @@
<div class="content-container">
<div class="left-half">
<div class="wallet-info">
<p>{{$t('sharedWalletHome.address')}}: {{this.address}}</p>
<p>
<span>{{$t('sharedWalletHome.address')}}: {{this.address}}</span>
<span class="copy-icon" @click="copy(address)"></span>
</p>
<!-- <div>
<span>{{$t('sharedWalletHome.publicKey')}}:</span>
<span class="wallet-pk">{{this.publicKey}}</span>
Expand Down Expand Up @@ -543,7 +557,7 @@ import { BigNumber } from 'bignumber.js';
this.balance.ont = r.Balance;
}
}
this.getExchangeCurrency()
// this.getExchangeCurrency()
}
})
Expand Down Expand Up @@ -688,6 +702,10 @@ import { BigNumber } from 'bignumber.js';
url += '/testnet'
}
window.location.href = url;
},
copy(value) {
this.$copyText(value);
this.$message.success(this.$t('common.copied'))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/Home.vue
Expand Up @@ -86,7 +86,7 @@
</div>

<div class="div-footer-version">
<p>Version: 0.8.2</p>
<p>Version: 0.8.3</p>
<p>Powered by Ontology</p>
</div>
</div>
Expand Down
14 changes: 8 additions & 6 deletions src/renderer/components/JsonWallet/Import/BasicInfo.vue
Expand Up @@ -261,15 +261,17 @@
},
importAccountForMnemonic() {
// 助记词导入
const res = Ont.SDK.importAccountMnemonic(this.mnemonicLabel, this.mnemonic, this.mnemonicPassword);
if (res.error === 0) {
this.mnemonicAccount = JSON.parse(res.result)
this.saveToDb(this.mnemonicAccount)
} else if (res.error === 42002) {
this.$message.error(this.$t('basicInfo.InvalidMnemonic'));
let account
try {
account = Ont.Account.importWithMnemonic(this.mnemonicLabel, this.mnemonic, this.mnemonicPassword, DEFAULT_SCRYPT)
} catch (err) {
this.message.error(this.t('basicInfo.InvalidMnemonic'))
}
this.mnemonicAccount = account.toJsonObj()
this.saveToDb(this.mnemonicAccount)
},
saveToDb(account) {
account.isDefault = true;
const that = this;
const wallet = {
type: 'CommonWallet',
Expand Down
22 changes: 20 additions & 2 deletions src/renderer/components/SharedWallet/SharedWalletHome.vue
Expand Up @@ -246,6 +246,17 @@
border-radius: 0;
background: rgba(0,0,0,0.1);
}
.copy-icon {
width:18px;
height:18px;
display: inline-block;
margin-left: 10px;
background: url('../../assets/copy.png') center center;
background-size: cover;
cursor: pointer;
position: relative;
top: 5px;
}
</style>
<template>
<div class="home-container">
Expand All @@ -254,7 +265,10 @@
<div class="content-container">
<div class="left-half">
<div class="wallet-info">
<p>{{$t('sharedWalletHome.walletAddress')}}: {{this.sharedWallet.sharedWalletAddress}}</p>
<p>
<span>{{$t('sharedWalletHome.walletAddress')}}: {{this.sharedWallet.sharedWalletAddress}}</span>
<span class="copy-icon" @click="copy()"></span>
</p>

</div>
<div class="wallet-balance">
Expand Down Expand Up @@ -438,7 +452,7 @@ export default {
restClient.getBalance(from).then(res => {
this.balance.ont = res.Result.ont
this.balance.ong = new BigNumber(res.Result.ong).div(1e9).toFixed(9)
this.getExchangeCurrency()
// this.getExchangeCurrency()
})
},
getExchangeCurrency() {
Expand Down Expand Up @@ -545,6 +559,10 @@ export default {
url += '/testnet'
}
window.location.href = url;
},
copy() {
this.$copyText(this.sharedWallet.sharedWalletAddress);
this.$message.success(this.$t('common.copied'))
}
}
}
Expand Down

0 comments on commit 85001db

Please sign in to comment.