Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #22 from govm-net/lengzhao
Browse files Browse the repository at this point in the history
bug:not change energy of wGOVM
  • Loading branch information
lengzhao authored Sep 13, 2020
2 parents 494f7ac + 980ee34 commit 627c779
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/gui/conf/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

// Vserion version of wallet
const Vserion = "v0.5.3"
const Vserion = "v0.5.4"

// Config config
type Config struct {
Expand Down
8 changes: 8 additions & 0 deletions bin/gui/screens/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ func makeWGOVMTab(w fyne.Window) fyne.Widget {
amount.SetPlaceHolder(amount.Text)
amount.SetText("")

engF, err := strconv.ParseFloat(energy.Text, 10)
if err != nil {
dialog.ShowError(fmt.Errorf("error energy"), w)
return
}

if costF < 5000 {
dialog.ShowError(fmt.Errorf("require amount >= 5000govm"), w)
return
Expand All @@ -183,6 +189,7 @@ func makeWGOVMTab(w fyne.Window) fyne.Widget {
dialog.ShowError(err, w)
return
}
trans.Energy = uint64(engF * float64(base))

td := trans.GetSignData()
sign := myWlt.Sign(td)
Expand All @@ -193,6 +200,7 @@ func makeWGOVMTab(w fyne.Window) fyne.Widget {
err = postTrans(1, td)
if err != nil {
// result.SetText(fmt.Sprintf("%s", err))
log.Println(ethEntry.Text, trans.Cost, trans.Energy, err)
dialog.ShowError(err, w)
return
}
Expand Down
2 changes: 1 addition & 1 deletion bin/html/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type TConfig struct {
}

// Version Version
const Version = "v0.5.3"
const Version = "v0.5.4"
const defaultPWD = "govm_pwd@2019"

var (
Expand Down
6 changes: 4 additions & 2 deletions bin/html/static/wgovm.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,12 @@ <h3 class="panel-title" data-localize="info">
urlStr2 = "/api/v1/1/data?app_name=a99b97a411b45c91779e1609386fa18484b8e50016379bd98c6822b491247b9b";
urlStr2 += "&struct_name=tSign&is_db_data=true&key=" + key;
$.get(urlStr2, function (data, status) {
if (status == "success") {
if (status != "success" || data.value === undefined) {
// console.log("sign:", data.value)
$("#mint_signature").val("0x" + data.value)
$("#result").html("Waiting for the administrator to sign");
return
}
$("#mint_signature").val("0x" + data.value)
});
});
});
Expand Down

0 comments on commit 627c779

Please sign in to comment.