Skip to content

Commit 5fd6f2f

Browse files
committed
fixed estimate diamonds
1 parent c561741 commit 5fd6f2f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/popup/views/Home/HeadTabs.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ export default {
389389
async signedAndCommitMobileData() {
390390
const reqId = this.$uid();
391391
const gasPriceSwei = this.$refs.gasCtx.gasPrice;
392+
console.log('gasPriceSwei', gasPriceSwei.toFixed(2));
392393
const that = this;
393394
try {
394395
const whisperer = new WhispererController({ portName: `BT_SIGNED_MObile` });
@@ -476,7 +477,6 @@ export default {
476477
reqId: this.$uid(),
477478
})
478479
.then(async (mobState) => {
479-
logger.debug('>>>>>>>>>>', mobState);
480480
await that.$store.dispatch('passbook/subInitState4Mob', mobState);
481481
});
482482

src/popup/widgets/GasControllerPanel.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,21 @@ export default {
5555
estimateDiamonds() {
5656
let gwei = parseFloat(this.gasPrice || 0) / 10;
5757
let ether = Web3.utils.fromWei(Web3.utils.toWei(gwei.toString(), 'Gwei'), 'ether');
58-
return (parseFloat(ether) * parseFloat(this.estimate) * 1000.0).toFixed(4);
58+
return (parseFloat(ether) * parseFloat(this.estimate) * 10000.0).toFixed(4);
5959
},
6060
},
6161
data() {
6262
return {
6363
showGasDiamonds: true,
6464
gasPanelShow: false,
65-
gasPrice: 0,
65+
gasPrice: 0, //anotation Gwei*10
6666
gasLimit: 21000,
6767
};
6868
},
6969
mounted() {
70-
this.gasPrice = this.gasState.average || this.gasState.gasPrice;
70+
const defaultGasPriceGwei =
71+
parseFloat(Web3.utils.fromWei(this.gasState.gasPrice.toString(), 'Gwei')) * 10;
72+
this.gasPrice = parseFloat(this.gasState.average) || defaultGasPriceGwei;
7173
},
7274
props: {
7375
iconsize: {

0 commit comments

Comments
 (0)