OSDN Git Service

update underscore to camelcase
authorZhiting Lin <zlin035@uottawa.ca>
Wed, 27 May 2020 02:41:30 +0000 (10:41 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Wed, 27 May 2020 02:41:30 +0000 (10:41 +0800)
18 files changed:
dist.pem [new file with mode: 0644]
src/background.js
src/models/transaction.js
src/store/actions.js
src/utils/Number.js
src/utils/utils.js [new file with mode: 0644]
src/views/assetList.vue
src/views/home.vue
src/views/sendTransaction/advancedTransfer.vue
src/views/sendTransaction/crossChainTransaction.vue
src/views/sendTransaction/signTransaction.vue
src/views/sendTransaction/transfer.vue
src/views/sideMenu/menuSettings.vue
src/views/transferDetail.vue
src/views/vote/listCancel.vue
src/views/vote/veto.vue
src/views/vote/vote.vue
src/views/vote/voteRecord.vue

diff --git a/dist.pem b/dist.pem
new file mode 100644 (file)
index 0000000..1607cee
--- /dev/null
+++ b/dist.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCoV6zfYEyFZHcc
+sDmo9+WF00j3KWe3gFZTch1s45raFe0eaok8QXLQ2KbHXcxgbexqOOCLIHafoxYb
+zxPXPxcAnsD+VyTWwTNyGPByscCYzh6zstYF6ows9b2lvQV9y5t8P/Alt7RJEEcx
+0Gnyo82C8l0QyjoY7BLGKk2yNc1olFl+X3bez4B2MQ80GCGdbrJhkK9pcLEQ77vT
+dsHH33VxoD3ri6HiXUdqAo/dI1WcoVlA8Sk7YFwxeSops9oj8rAIRytjJDp+1XLi
+FnEWvdYYKzso3UufBA3eAOzCcTUtcP/Y4k01cHC21kI2y4ePmm++vtuBIcDRPXk5
+6CRigxnlAgMBAAECggEAD78PuQnmw81yGiQJE1szbsak0GsLkWMMRXGVpgijhJsW
+Gx5nqClju3xLHA0+ikCN+Mue2UoCk+EV4X5dApPGAOADTmcerNsqhurP8Z0wgOU6
+2EqLRsdkhZTA616tw6axbGMGAV6DGxh43a8l0d/s377wN0YAlDHfebDITrnwn5j7
+Pd0bml25wmISVduRzIy6hnu8Os59MyPI2fxWTBhrFkf4FNrfSJzc7Xgr5LADoNwt
+/FN7Dak74AwPKWXywhc3iVAbsiiDIZrYi2hFiYDVI2uUP5kR6+V7K7zM/ydCdA4I
+3j1Ml5qwD51NzqJUARcoKLKmcpDPDNLacHeZaPW+6wKBgQDYHWOmkhqExhSW3eZk
+8VbzoJ0En5RgnOT1+tcQXOurCN3v8fE6oHT3SIA9ZleLip3oVJhl/EhQrbt9QkOy
+B+tfP0C2m6t3hCL6Bq5GD9642LrE0AsSUUDjhbKqehWTtHajKlPCw2zAHZO+hWZX
+DUIiSDbJ7VjPRokmcpU5tae7QwKBgQDHaTlHo4xr3Azu1CJz+AbF8taHuMHmfnuf
+39q84H/pOiwwBqmJKvJnS1B4+SmyKSEI9bIQ5QEN4FO9nfgxS5L8YPHP5ZfnLIhU
+Tk4h8kLYxw4Wg0AsBneOC+KDdYZ8l3pKy/24xNsekBXHMBIYBuEymJhnqjaxV9gJ
+5I/NTRJ/twKBgQCPMen1VJl9oEHENQOTntWeV62ygoot+cc7tRkLHoaIrTdg5U6R
+KgBWWROfm1AmhZJbfrH74U2JJ5QzStTQAa9TTPX0CPF0H3mNcR/IDHvmvrQB9Fdh
+q7TzDIN1sa7aT5jMRB97zUEhind6palJxN8tF+w1n65YqMP3VbTKqDKbQQKBgQCm
+CdZ48RQWJ0bZgeciGs5A+n9oyQ0iyARVzYYLqP64iwiKALIflZP7MDnUUNtIDnkE
+Rdg7uwLStAvmIeer3BqKbIpMKgb+pRTq5bynBVplt/DiC+1d+xCHRRwZi70sdtCM
+ASjFNZyh6SVJEpyuRuQyRd74ykD6D4PCUP7v2hHiJwKBgQDRfCPxD8R7A40EXbSa
+9Nu3uVcl03ixdYVE6BpJkUN+AlB+AHI2BxaO4tXegWQeeGrSFK3JM83OdlWUZOxw
+EEX6TUKJ2TlA8ib/7YC9WHBsrp57aOo+kjszpGjX48V1fXG3zswczSY+7EBvRuAe
+YDX11mTsCASl8Tdwl9X/z4jU1w==
+-----END PRIVATE KEY-----
index fec6683..447cfba 100644 (file)
@@ -200,7 +200,7 @@ export default class Background {
           }
 
           let balances = currentAccount.vpBalances ||[]
-          balances = balances.map(({ in_btc, in_cny, in_usd, name, ...keepAttrs}) => {
+          balances = balances.map(({ inBtc, inCny, inUsd, name, ...keepAttrs}) => {
             if(keepAttrs.asset === BTM)
               return {availableBalance: (keepAttrs.balance-vote),...keepAttrs}
               else
@@ -216,7 +216,7 @@ export default class Background {
           };
         }else{
           let balances = currentAccount.balances ||[]
-          balances = balances.map(({ in_btc, in_cny, in_usd, name, ...keepAttrs}) => keepAttrs)
+          balances = balances.map(({ inBtc, inCny, inUsd, name, ...keepAttrs}) => keepAttrs)
 
           account ={
             address: currentAccount.address,
@@ -317,7 +317,7 @@ export default class Background {
         }
 
         let balances = currentAccount.vpBalances ||[]
-        balances = balances.map(({ in_btc, in_cny, in_usd, name, ...keepAttrs}) => {
+        balances = balances.map(({ inBtc, inCny, inUsd, name, ...keepAttrs}) => {
           if(keepAttrs.asset === BTM)
             return {availableBalance: (keepAttrs.balance-vote),...keepAttrs}
           else
@@ -334,7 +334,7 @@ export default class Background {
 
       }else{
         let balances = currentAccount.balances ||[]
-        balances = balances.map(({ in_btc, in_cny, in_usd, name, ...keepAttrs}) => keepAttrs)
+        balances = balances.map(({ inBtc, inCny, inUsd, name, ...keepAttrs}) => keepAttrs)
 
         account ={
           address: currentAccount.address,
index 7eef434..4704c99 100644 (file)
@@ -33,7 +33,7 @@ transaction.asset = function(asset_id) {
 transaction.build = function(guid, to, asset, amount, fee, confirmations) {
   let retPromise = new Promise((resolve, reject) => {
     bytom.transaction
-      .buildPayment(guid, to, asset, Number(amount), Number(fee*100000000), confirmations)
+      .buildPayment(guid, to, asset, Number(amount), Number(fee), confirmations)
       .then(res => {
         resolve(res);
       })
index 675f0c7..e41b89f 100644 (file)
@@ -43,7 +43,7 @@ export const actions = {
                 }
 
                 bytom.settings.login = true
-                bytom.settings.currency = "in_cny"
+                bytom.settings.currency = "inCny"
                 bytom.settings.netType = ''
                 dispatch(Actions.UPDATE_STORED_BYTOM, bytom).then(_bytom => {
                     dispatch(Actions.SET_BYTOM, Bytom.fromJson(_bytom));
@@ -66,7 +66,7 @@ export const actions = {
               }
 
               bytom.settings.login = true
-              bytom.settings.currency = "in_cny"
+              bytom.settings.currency = "inCny"
               bytom.settings.netType = ''
               dispatch(Actions.UPDATE_STORED_BYTOM, bytom).then(_bytom => {
                   dispatch(Actions.SET_BYTOM, Bytom.fromJson(_bytom));
index e69ea1d..492f087 100644 (file)
@@ -47,10 +47,13 @@ export class Number {
   static formatCurrency(num, type) {
     let n = new BigNumber(num);
     switch(type){
+      case "inCny":
       case "in_cny":
         return `¥ ${n.toFormat(2)}`
+      case "inUsd":
       case "in_usd":
         return `$ ${n.toFormat()}`
+      case "inBtc":
       case "in_btc":
         return `₿ ${n.toFormat()}`
       default:
diff --git a/src/utils/utils.js b/src/utils/utils.js
new file mode 100644 (file)
index 0000000..2d183e3
--- /dev/null
@@ -0,0 +1,24 @@
+export const camelize = (object) => {
+  if ( typeof object == 'object'){
+    for (let key in object) {
+      let value = object[key];
+      let newKey = key;
+
+      if (/_/.test(key)) {
+        newKey = key.replace(/([_][a-z])/g, v => v[1].toUpperCase());
+        delete object[key];
+      }
+
+      if (typeof value == 'object') {
+        value = camelize(value);
+      }
+
+      object[newKey] = value;
+    }
+
+    return object;
+  }else{
+    return object.replace(/([_][a-z])/g, v => v[1].toUpperCase())
+  }
+};
+
index 5446c02..13857c1 100644 (file)
                     <div class="token-amount">
                         {{itemBalance(currentAsset)}}
                     </div>
-                    <div>{{formatCurrency(currentAsset[ currency ])}}</div>
+                    <div>{{formatCurrency(currentAsset[ camelize(currency) ])}}</div>
                 </div>
             </div>
         </section>
                           <li class="list-item" v-for="(transaction, index) in transactions" :key="index" @click="$router.push({name: 'transfer-info', params: {transaction: transaction, address: currentAccount.address}})">
                               <div>
                                   <div>{{transaction.address}}</div>
-                                  <div class="addr color-grey" v-if="transaction.hasOwnProperty('block_timestamp')">
-                                    {{transaction.submission_timestamp | moment}}
+                                  <div class="addr color-grey" v-if="transaction.hasOwnProperty('blockTimestamp')">
+                                    {{transaction.submissionTimestamp | moment}}
                                   </div>
                                   <div class="addr color-grey" v-else>
                                     {{ $t('main.unconfirmed') }}
 import address from "@/utils/address";
 import query from "@/models/query";
 import transaction from "@/models/transaction";
+import { camelize } from "@/utils/utils";
 import { BTM } from "@/utils/constants";
 import { mapActions, mapGetters, mapState } from 'vuex'
 import * as Actions from '@/store/constants';
@@ -221,6 +222,9 @@ export default {
         ])
     },
     methods: {
+      camelize: function (object) {
+        return camelize(object)
+      },
       close: function () {
         this.$router.go(-1)
       },
@@ -232,9 +236,9 @@ export default {
       },
       itemBalance: function(asset){
         if(asset.asset === BTM){
-          return Num.formatNue(asset.available_balance,8)
+          return Num.formatNue(asset.availableBalance,8)
         }else{
-          return Num.formatNue(asset.available_balance,asset.decimals)
+          return Num.formatNue(asset.availableBalance,asset.decimals)
         }
 
       },
@@ -258,7 +262,7 @@ export default {
         },
         refreshTransactions: function (start, limit) {
             return new Promise((resolve, reject) => {
-                transaction.list(this.address, this.currentAsset.asset.asset_id, start, limit).then(transactions => {
+                transaction.list(this.address, this.currentAsset.asset.assetId, start, limit).then(transactions => {
                   if (transactions == null) {
                         return;
                     }
@@ -273,11 +277,11 @@ export default {
         },
         transactionsFormat: function (transactions) {
           const formattedTransactions = []
-          const assetID = this.currentAsset.asset.asset_id
+          const assetID = this.currentAsset.asset.assetId
 
           transactions.forEach(transaction => {
             const balanceObject = transaction.balances
-              .filter(b => b.asset.asset_id === assetID);
+              .filter(b => b.asset.assetId === assetID);
 
             const filterInput = _.find(transaction.inputs, function(o) { return o.type =='veto'; })
             const filterOutput = _.find(transaction.outputs, function(o) { return o.type =='vote'; })
@@ -303,11 +307,11 @@ export default {
 
             if(balanceObject.length ===1 ){
                 const inputAddresses = transaction.inputs
-                  .filter(input => input.asset.asset_id === assetID && input.address !== this.currentAccount.address)
+                  .filter(input => input.asset.assetId === assetID && input.address !== this.currentAccount.address)
                   .map(input => input.address)
 
                 const outputAddresses = transaction.outputs
-                  .filter(output => output.asset.asset_id === assetID && output.address !== this.currentAccount.address)
+                  .filter(output => output.asset.assetId === assetID && output.address !== this.currentAccount.address)
                   .map(output => output.address)
 
                 let val = Math.abs(balanceObject[0].amount)
@@ -323,7 +327,6 @@ export default {
                 }
 
                 transaction.val =  val ;
-                transaction.fee = transaction.fee / 100000000;
 
                 formattedTransactions.push(transaction);
               }
@@ -342,7 +345,7 @@ export default {
         if(this.listVote.length == 0 && this.netType === 'vapor'){
           query.chainStatus().then(resp => {
             if(resp){
-              const votes =  resp.consensus_nodes.map( (item, index) => {
+              const votes =  resp.consensusNodes.map( (item, index) => {
                 item.rank = index+1;
                 return item
               });
index 55e5847..c20319f 100644 (file)
             <li class="list-item" v-for="(balance, index) in balances" :key="index" @click="assetOpen(balance)">
               <div class="float-right text-align-right">
                 <div class="value">{{ itemBalance(balance) }}</div>
-                <div class="addr color-grey">{{ formatCurrency(balance[ currency ]) }}</div>
+                <div class="addr color-grey">{{ formatCurrency(currentBalanceAmount(balance)) }}</div>
               </div>
               <div v-if="balance.asset.symbol!== 'Asset'">
                 <div class="uppercase">
                   Asset
                 </div>
 
-                <div class="addr color-grey uppercase">{{ shortAddress(balance.asset.asset_id) }}</div>
+                <div class="addr color-grey uppercase">{{ shortAddress(balance.asset.assetId) }}</div>
               </div>
 
             </li>
 import address from "@/utils/address";
 import account from "@/models/account";
 import transaction from "@/models/transaction";
+import { camelize } from "@/utils/utils";
 import { BTM } from "@/utils/constants";
 import { mapActions, mapGetters, mapState } from 'vuex'
 import * as Actions from '@/store/constants';
@@ -299,16 +300,16 @@ export default {
             defaultBalances: [
               {
                 asset:{
-                  asset_id: BTM,
+                  assetId: BTM,
                   name: "Bytom",
                   symbol: "BTM",
 
                 } ,
                 balance: 0,
                 decimals: 8,
-                in_btc: "0",
-                in_cny: "0",
-                in_usd: "0"
+                inBtc: "0",
+                inCny: "0",
+                inUsd: "0"
               }
             ],
         };
@@ -351,7 +352,7 @@ export default {
             const balances = this.balances
 
             if(balances && balances.length >0 ){
-                const currency = this.currency
+                const currency = camelize(this.currency)
                 balance = _.sumBy(balances, function(o) { return Number(o[currency]); })
             }
             return  Num.formatCurrency( (balance != null && balance != 0)? balance : '0.00', this.currency)
@@ -382,6 +383,9 @@ export default {
         ])
     },
     methods: {
+      currentBalanceAmount: function (balance) {
+        return balance[ camelize(this.currency) ]
+      },
       shortAddress: function (add) {
         return address.short(add)
       },
@@ -390,10 +394,10 @@ export default {
       },
       itemBalance: function(assetObj){
         const asset = assetObj.asset
-        if(asset.asset_id === BTM){
-          return Num.formatNue(assetObj.available_balance,8)
+        if(asset.assetId === BTM){
+          return Num.formatNue(assetObj.availableBalance,8)
         }else{
-          return assetObj.available_balance
+          return assetObj.availableBalance
         }
       },
         setupRefreshTimer() {
index bf0e82e..b02018c 100644 (file)
@@ -189,7 +189,7 @@ export default {
                 onCancel: this.onCancel
             });
 
-            transaction.buildTransaction(this.currentAccount.guid,  this.transaction.input, this.transaction.output, this.transaction.fee * 100000000, this.transaction.confirmations).then(async (result) => {
+            transaction.buildTransaction(this.currentAccount.guid,  this.transaction.input, this.transaction.output, this.transaction.fee , this.transaction.confirmations).then(async (result) => {
 
               let arrayData
               if(this.transaction.args){
@@ -235,7 +235,7 @@ export default {
                  this.transaction.args = inout.args
               }
               if(inout.gas !== undefined){
-                 this.transaction.fee = inout.gas/100000000
+                 this.transaction.fee = inout.gas
               }
               if(inout.confirmations !== undefined){
                  this.transaction.confirmations = inout.confirmations
index 4712d6d..d7877ee 100644 (file)
@@ -189,9 +189,9 @@ import { Number as Num } from "@/utils/Number"
   import _ from 'lodash';
 
   const currencyInPrice = {
-  in_cny: 'cny_price',
-  in_usd: 'usd_price',
-  in_btc:'btc_price'
+  inCny: 'cny_price',
+  inUsd: 'usd_price',
+  inBtc:'btc_price'
 }
 
 export default {
@@ -363,7 +363,7 @@ export default {
                 transaction.build(this.account.guid, address, this.transaction.asset, Num.convertToNue(this.transaction.amount,this.selectAsset.decimals), this.transaction.confirmations).then(result => {
                   loader.hide();
                   if(!this.transaction.fee){
-                    this.transaction.fee = Number( _.sumBy(result, 'fee') / 100000000);
+                    this.transaction.fee = Number( _.sumBy(result, 'fee'));
                   }
                   this.$router.push({ name: 'transfer-confirm', params: { account: this.account, transaction: this.transaction, rawData: result,assetAlias: this.selectAsset.symbol, type: this.$route.query.type } })
                 }).catch(error => {
@@ -410,10 +410,10 @@ export default {
               this.transaction.to = this.$route.query.to
           }
           if (this.$route.query.amount != undefined) {
-              this.transaction.amount = this.$route.query.amount /100000000
+              this.transaction.amount = this.$route.query.amount
           }
           if (this.$route.query.gas != undefined) {
-              this.transaction.fee = this.$route.query.gas /100000000
+              this.transaction.fee = this.$route.query.gas
           }
           if(this.$route.query.confirmations != undefined) {
               this.transaction.confirmations = this.$route.query.confirmations
index b11639f..fee1dc6 100644 (file)
@@ -240,7 +240,7 @@ export default {
                   this.transaction.output = param.outputs
               }
               if(param.fee !== undefined){
-                 this.transaction.fee = param.fee/100000000
+                 this.transaction.fee = param.fee
               }
 
               const array = param.inputs.filter(action => action.type ==='spend')
index 6900fcf..88b7c3f 100644 (file)
@@ -165,9 +165,9 @@ import * as Actions from '@/store/constants';
   import _ from 'lodash'
 
   const currencyInPrice = {
-    in_cny: 'cny_price',
-    in_usd: 'usd_price',
-    in_btc:'btc_price'
+    inCny: 'cny_price',
+    inUsd: 'usd_price',
+    inBtc:'btc_price'
   }
 
 export default {
@@ -316,7 +316,7 @@ export default {
             transaction.build(this.account.guid, this.transaction.to, this.transaction.asset, Num.convertToNue(this.transaction.amount,this.selectAsset.decimals), this.transaction.fee, this.transaction.confirmations).then(result => {
                 loader.hide();
                 if(!this.transaction.fee){
-                    this.transaction.fee = Number( _.sumBy(result, 'fee') / 100000000);
+                    this.transaction.fee = Number( _.sumBy(result, 'fee'));
                 }
                 this.$router.push({ name: 'transfer-confirm', params: { account: this.account, transaction: this.transaction, rawData: result, assetAlias: this.selectAsset.symbol, type: this.$route.query.type } })
             }).catch(error => {
@@ -348,10 +348,10 @@ export default {
               this.transaction.to = this.$route.query.to
           }
           if (this.$route.query.amount != undefined) {
-              this.transaction.amount = this.$route.query.amount /100000000
+              this.transaction.amount = this.$route.query.amount
           }
           if (this.$route.query.gas != undefined) {
-              this.transaction.fee = this.$route.query.gas /100000000
+              this.transaction.fee = this.$route.query.gas
           }
           if(this.$route.query.confirmations != undefined) {
               this.transaction.confirmations = this.$route.query.confirmations
index 66fc54d..b6494a3 100644 (file)
@@ -81,11 +81,11 @@ export default {
             ],
             selected: { label: "中文", value: "cn" },
             hashVersion: "",
-            currentCurrency: { label: "CNY", value: "in_cny" },
+            currentCurrency: { label: "CNY", value: "inCny" },
             currencyList: [
-              { label: "CNY", value: "in_cny" },
-              { label: "USD", value: "in_usd" },
-              { label: "BTC", value: "in_btc" }
+              { label: "CNY", value: "inCny" },
+              { label: "USD", value: "inUsd" },
+              { label: "BTC", value: "inBtc" }
             ],
         };
     },
@@ -186,13 +186,13 @@ export default {
 
           if(this.currency) {
             switch(this.currency){
-              case 'in_cny':
+              case 'inCny':
                 this.currentCurrency = this.currencyList[0]
                 break;
-              case 'in_usd':
+              case 'inUsd':
                 this.currentCurrency = this.currencyList[1]
                 break;
-              case 'in_btc':
+              case 'inBtc':
                 this.currentCurrency = this.currencyList[2]
                 break;
             }
index 5b32f0f..ec94be7 100644 (file)
               <small class="header-text" v-if="transaction.status_fail">
                 {{ $t('transactionDetail.fail') }}
               </small>
-              <small class="header-text" v-else-if="transaction.hasOwnProperty('block_timestamp')">
+              <small class="header-text" v-else-if="transaction.hasOwnProperty('blockTimestamp')">
                 {{ $t('transactionDetail.success') }}
               </small>
               <small class="header-text" v-else>
                           {{ $t('transactionDetail.assetId') }}
                         </td>
                         <td class="asset value">
-                          <p>{{currentAsset.asset}}</p>
+                          <p>{{currentAsset.asset.assetId}}</p>
                         </td>
                       </tr>
                       <tr>
                           {{ $t('transactionDetail.time') }}
                         </td>
                         <td class="value">
-                            <div v-if="transaction.hasOwnProperty('block_timestamp')">
-                              {{transaction.submission_timestamp | moment}}
+                            <div v-if="transaction.hasOwnProperty('blockTimestamp')">
+                              {{transaction.submissionTimestamp | moment}}
                             </div>
                             <div v-else>
                               -
                             {{ $t('transactionDetail.blockHeight') }}
                         </td>
                         <td class="value">
-                          <p v-if="transaction.block_height != undefined">{{transaction.block_height}}</p>
+                          <p v-if="transaction.blockHeight != undefined">{{transaction.blockHeight}}</p>
                           <p v-else>-</p>
                         </td>
                       </tr>
     computed: {
       classObject: function () {
         return {
-          'success-header': !this.transaction.status_fail && this.transaction.hasOwnProperty('block_timestamp'),
-          'pending-header': !this.transaction.status_fail  && !this.transaction.hasOwnProperty('block_timestamp') ,
-          'fail-header': this.transaction.status_fail
+          'success-header': this.transaction.status && this.transaction.hasOwnProperty('blockTimestamp'),
+          'pending-header': this.transaction.status  && !this.transaction.hasOwnProperty('blockTimestamp') ,
+          'fail-header': !this.transaction.status
         }
       },
       ...mapState([
index a59079e..bc99246 100644 (file)
@@ -184,7 +184,7 @@ export default {
       const originVotes = this.currentAccount.votes
       const allVotes = this.listVote;
       this.votes = _.map(originVotes, function(obj) {
-        return _.assign(obj, _.find(allVotes, {pub_key: obj.vote}));
+        return _.assign(obj, _.find(allVotes, {pubKey: obj.vote}));
       });
     }
 };
index 333cd87..48238e8 100644 (file)
@@ -97,9 +97,9 @@ import { mapGetters, mapState } from 'vuex'
 import { Number as Num } from "@/utils/Number"
 
 const currencyInPrice = {
-  in_cny: 'cny_price',
-  in_usd: 'usd_price',
-  in_btc:'btc_price'
+  inCny: 'cny_price',
+  inUsd: 'usd_price',
+  inBtc:'btc_price'
 }
 
 export default {
@@ -177,12 +177,12 @@ export default {
                 onCancel: this.onCancel
             });
 
-            const vote = this.selectVote.pub_key
+            const vote = this.selectVote.pubKey
             this.transaction.to = vote
             transaction.buildVeto(this.currentAccount.guid, vote,  Num.convertToNue(this.transaction.amount,8), this.transaction.confirmations).then(result => {
                 loader.hide();
                 if(!this.transaction.fee){
-                  this.transaction.fee = Number( _.sumBy(result, 'fee') / 100000000);
+                  this.transaction.fee = Number( _.sumBy(result, 'fee'));
                 }
                 this.$router.push({ name: 'vote-confirm', params: { account: this.currentAccount, transaction: this.transaction, assetAlias: 'BTM',rawData: result} })
             }).catch(error => {
index b2b53d3..5dc7aee 100644 (file)
@@ -98,9 +98,9 @@ import { Number as Num } from "@/utils/Number"
 import _ from 'lodash';
 
 const currencyInPrice = {
-  in_cny: 'cny_price',
-  in_usd: 'usd_price',
-  in_btc:'btc_price'
+  inCny: 'cny_price',
+  inUsd: 'usd_price',
+  inBtc:'btc_price'
 }
 
 export default {
@@ -193,7 +193,7 @@ export default {
             transaction.buildVote(this.currentAccount.guid, vote,  Num.convertToNue(this.transaction.amount,8), this.transaction.confirmations).then(result => {
                 loader.hide();
               if(!this.transaction.fee){
-                this.transaction.fee = Number( _.sumBy(result, 'fee') / 100000000);
+                this.transaction.fee = Number( _.sumBy(result, 'fee') );
               }
                 this.$router.push({ name: 'vote-confirm', params: { account: this.currentAccount,  transaction: this.transaction,assetAlias: 'BTM', rawData: result} })
             }).catch(error => {
index 25bb084..3e206de 100644 (file)
@@ -218,7 +218,7 @@ export default {
                 let val = Math.abs(balanceObject[0].amount)
 
                 transaction.val =  Num.formatNue(val, 8) ;
-                transaction.fee = transaction.fee / 100000000;
+                transaction.fee = transaction.fee ;
 
                 formattedTransactions.push(transaction);
               }