Skip to content

Commit

Permalink
fix refund amount error;
Browse files Browse the repository at this point in the history
  • Loading branch information
MickWang committed Aug 7, 2019
1 parent 030530c commit fc8c336
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/common/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default {
passError: 'Password error',
ontidNotExist: 'The ONT ID to import does not exist on the blockchain',
keystoreImport: 'ONT ID Keystore Import',
invalidKeystore: 'The keysotre you input is invalid.',
invalidKeystore: 'The keystore you input is invalid.',
ontidExist: 'The identity already exists in local.',
importSuccess: 'Import Identity succeessfully!'
},
Expand Down Expand Up @@ -628,7 +628,9 @@ Within their 50% share each consensus node will receive their share according to
initPosInLock: "Locked",
initPosRedeemable: 'Claimable',
noClaimbleInitPos: 'No claimble ONT.',
redeemInitPosOk: 'Redeem'
redeemInitPosOk: 'Redeem',
hasClaimableInitPos: 'You have redeemable init pos. Plase redeem this part first.',
noClaimbleToRefund: 'No redeemable ONT to refund.'
},
exchange: {
exchange: 'Exchange',
Expand Down
4 changes: 3 additions & 1 deletion src/common/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,9 @@ export default {
initPosInLock: "锁定中",
initPosRedeemable: '可提取',
noClaimbleInitPos: '没有可提取的初始质押。',
redeemInitPosOk: '确认提取'
redeemInitPosOk: '确认提取',
hasClaimableInitPos: '您还有可提取的初始质押。请先提取该部分ONT。',
noClaimbleToRefund: '没有可提取的ONT。无法提款。'
},
exchange: {
exchange: 'Exchange',
Expand Down
12 changes: 11 additions & 1 deletion src/renderer/components/Node/NodeStake/NodeStakeInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -441,17 +441,27 @@ export default {
},
handleRefund() {
if(this.authorizationInfo && this.authorizationInfo.claimableVal === 0) {
this.$message.warning(this.$t('nodeMgmt.noClaimbleToRefund'))
return;
}
const userAddr = new Crypto.Address(this.stakeWallet.address);
const peerPubkeys = [this.detail.publickey]
// const withdrawList = [this.detail.stakequantity]
// Fix:节点质押部分可能会增加或减少,退款应该用initPos;
const withdrawList = [this.current_peer.initPos]
// Fix2: 退款都可以用可提取部分
const withdrawList = [this.authorizationInfo.claimableVal]
const payer = userAddr
const tx = GovernanceTxBuilder.makeWithdrawTx(userAddr, peerPubkeys, withdrawList, payer, GAS_PRICE, GAS_LIMIT)
this.tx = tx;
this.walletPassModal = true;
},
handleQuitNode() {
//Fixme:退出节点前先把可提取初始质押提取出来。
if(this.authorizationInfo && this.authorizationInfo.claimableVal > 0) {
this.$message.warning(this.$t('nodeMgmt.hasClaimableInitPos'))
return;
}
const userAddr = new Crypto.Address(this.stakeWallet.address);
const peerPubkey = this.detail.publickey;
const payer = userAddr;
Expand Down

0 comments on commit fc8c336

Please sign in to comment.