From bdce4e0a29e7d68bc790fa2fee6d326c42276ed2 Mon Sep 17 00:00:00 2001 From: lengzhao Date: Sun, 13 Sep 2020 15:31:11 +0800 Subject: [PATCH 1/2] wGOVM of gui wallet --- bin/gui/assets/zh.json | 9 ++- bin/gui/build.sh | 2 +- bin/gui/conf/config.go | 2 +- bin/gui/res/resoure.go | 1 + bin/gui/screens/master.go | 1 + bin/html/build.sh | 2 +- bin/html/static/js/encode.js | 3 + bin/html/static/wgovm.html | 59 +++++++++++++++++--- go.mod | 9 ++- go.sum | 103 +++++++++++++++++++++++++---------- 10 files changed, 146 insertions(+), 45 deletions(-) diff --git a/bin/gui/assets/zh.json b/bin/gui/assets/zh.json index d760b00..28b3595 100644 --- a/bin/gui/assets/zh.json +++ b/bin/gui/assets/zh.json @@ -61,6 +61,11 @@ "View Private Key":"查看明文私钥", "Register Miner":"注册矿工", "Miner":"矿工", - "Number":"数量", - "":"" + "Eth Address":"以太坊地址", + "Run APP":"执行App", + "Data":"数据", + "Data Type":"数据类型", + "wgovm_desc":"将govm兑换为以太坊的wGovm\n1.执行当前App锁定govm\n2.管理员签名\n3.你自己在以太坊上造币(http://govm.net:9090/wgovm.html)", + "":"", + "Number":"数量" } \ No newline at end of file diff --git a/bin/gui/build.sh b/bin/gui/build.sh index ef735a2..0429c84 100644 --- a/bin/gui/build.sh +++ b/bin/gui/build.sh @@ -8,7 +8,7 @@ mkdir $folder mv govm.exe $folder cp assets $folder -rf cp conf.json $folder -rf -zip -r govm_windows_wallet_$(date +'%Y%m%d_%H%M%S').tar.gz $folder +zip -r govm_windows_wallet_$(date +'%Y%m%d_%H%M%S').zip $folder echo Enter to exit read k rm $folder -rf diff --git a/bin/gui/conf/config.go b/bin/gui/conf/config.go index f483cae..2a5238e 100644 --- a/bin/gui/conf/config.go +++ b/bin/gui/conf/config.go @@ -13,7 +13,7 @@ import ( ) // Vserion version of wallet -const Vserion = "v0.5.2" +const Vserion = "v0.5.3" // Config config type Config struct { diff --git a/bin/gui/res/resoure.go b/bin/gui/res/resoure.go index d987192..1dab9ef 100644 --- a/bin/gui/res/resoure.go +++ b/bin/gui/res/resoure.go @@ -33,6 +33,7 @@ var i18n = map[string]string{ "opCode.6": "Register Miner", "setting.desc": "Restart after setting", "vote_desc": "After voting, collect the income yourself (every month through 0 vote)", + "wgovm_desc": "govm exchange to eth.wGovm\n1. run this.Contract to lock coins.\n2. sign by admin(1 day)\n3. relayMint by yourself(http://govm.net:9090/wgovm.html)", } var readFile func(fn string) ([]byte, error) diff --git a/bin/gui/screens/master.go b/bin/gui/screens/master.go index 20f7370..0f52f1b 100644 --- a/bin/gui/screens/master.go +++ b/bin/gui/screens/master.go @@ -22,6 +22,7 @@ func Master(a fyne.App) fyne.Window { tabs := widget.NewTabContainer( widget.NewTabItemWithIcon(res.GetLocalString("Home"), theme.HomeIcon(), AccountScreen(w)), widget.NewTabItemWithIcon(res.GetLocalString("Transaction"), theme.MailSendIcon(), TransactionScreen(w)), + widget.NewTabItemWithIcon(res.GetLocalString("APP"), theme.MenuIcon(), AppScreen(w)), widget.NewTabItemWithIcon(res.GetLocalString("Search"), theme.SearchIcon(), SearchScreen(w)), widget.NewTabItemWithIcon(res.GetLocalString("History"), theme.ContentPasteIcon(), HistoryScreen(w)), widget.NewTabItemWithIcon(res.GetLocalString("Setting"), theme.SettingsIcon(), SettingScreen(w))) diff --git a/bin/html/build.sh b/bin/html/build.sh index 5ecfabd..9291930 100644 --- a/bin/html/build.sh +++ b/bin/html/build.sh @@ -12,7 +12,7 @@ mv html_wallet_linux $folder mv html_wallet_mac $folder cp static $folder -rf #tar zcvf "$folder"_$(date +'%Y%m%d_%H%M%S').tar.gz $folder -zip -r "$folder"_$(date +'%Y%m%d_%H%M%S').tar.gz $folder +zip -r "$folder"_$(date +'%Y%m%d_%H%M%S').zip $folder rm $folder -rf echo Enter to exit read k diff --git a/bin/html/static/js/encode.js b/bin/html/static/js/encode.js index a1a0eb0..8f0d9ff 100644 --- a/bin/html/static/js/encode.js +++ b/bin/html/static/js/encode.js @@ -102,6 +102,9 @@ function dataEncode(input, type) { case "bytes2int": return dataEncode(dataEncode(input, "bytes2hex"), "hex2int") case "hex2int": + if (input === undefined) { + return 0; + } return parseInt(input, 16) case "hex2bytes": var myUint8Array = new Uint8Array(input.match(/[\da-f]{2}/gi).map(function (h) { diff --git a/bin/html/static/wgovm.html b/bin/html/static/wgovm.html index f7bba01..d416609 100644 --- a/bin/html/static/wgovm.html +++ b/bin/html/static/wgovm.html @@ -8,6 +8,27 @@ + @@ -70,30 +91,31 @@

+
Key: - +
Owner: - +
Eth Address: - +
Amount: - + govm
Signature: - +
@@ -151,9 +173,32 @@