From 7cfe0a7e0b0b773b253fc128aeca6bd452710090 Mon Sep 17 00:00:00 2001 From: tomdurrent Date: Thu, 31 Oct 2019 14:52:17 +0800 Subject: [PATCH] fixed bugs --- app/light.go | 23 +++++++++++++++-------- main.go | 2 +- web/assets/js/common.js | 6 +++--- web/assets/js/dapps.js | 39 +++++++++++++++++++-------------------- web/assets/js/stake.js | 6 ++++-- web/dapps.html | 5 ----- web/stake.html | 2 +- 7 files changed, 43 insertions(+), 40 deletions(-) diff --git a/app/light.go b/app/light.go index 3cd1577..efaea5b 100644 --- a/app/light.go +++ b/app/light.go @@ -206,12 +206,16 @@ func (self *SEROLight) SyncOut() { func (self *SEROLight) fetchAndDecOuts(account *Account, pkrIndex uint64, start, end uint64) (rtn fetchReturn, err error) { - logex.Info(account.pk,start,end) + logex.Info(account.pk, start, end) pkrTypeMap, currentPkrsMap, pkrs := self.genPkrs(pkrIndex, account) param := []interface{}{pkrs, start} if end != 0 { - param = append(param, end) + currentPkr := []string{} + for pkr := range currentPkrsMap { + currentPkr = append(currentPkr, base58.Encode(pkr[:])) + } + param = []interface{}{currentPkr, start, end} } else { param = []interface{}{pkrs, start, nil} } @@ -496,12 +500,12 @@ func (self *SEROLight) CheckNil() { continue } } - if len(Nils) >0 { + if len(Nils) > 0 { self.rpcCheckNil(Nils) } } -func (self *SEROLight) rpcCheckNil(Nils []string) { +func (self *SEROLight) rpcCheckNil(Nils []string) { sync := Sync{RpcHost: GetRpcHost(), Method: "light_checkNil", Params: []interface{}{Nils}} jsonResp, err := sync.Do() if err != nil { @@ -797,6 +801,9 @@ func (self *SEROLight) needSzk(param *txtool.GTxParam) { data, err := self.db.Get(remoteNumKey) if err == nil { num := decodeNumber(data[:]) + if IsDev { + useZNum = uint64(100) + } if num >= useZNum { param.Z = &need_szk } @@ -828,9 +835,9 @@ func (self *SEROLight) storePeddingUtxo(param *txtool.GTxParam, currency string, batch.Put(indexTxKey(*pk, utxoIn.TxHash, utxoIn.TxHash, uint64(2)), dataIn) batch.Put(txHashKey(txInfo.TxHash[:]), txData) batch.Write() - }else{ - fmt.Println("storePeddingUtxo err1: ",err1) - fmt.Println("storePeddingUtxo err2: ",err1) + } else { + fmt.Println("storePeddingUtxo err1: ", err1) + fmt.Println("storePeddingUtxo err2: ", err1) } } @@ -1129,7 +1136,7 @@ func (self *SEROLight) buyShare(from, vote, passwd, pool string, amount, gaspric } utxoIn := Utxo{Pkr: votePkr, Root: hash, TxHash: hash, Fee: *fee} - self.storePeddingUtxo(param, "SERO", amount, utxoIn, ac.pk,25000,*gasprice) + self.storePeddingUtxo(param, "SERO", amount, utxoIn, ac.pk, 25000, *gasprice) ac.isChanged = true return hash, nil diff --git a/main.go b/main.go index a494e62..a6a038e 100644 --- a/main.go +++ b/main.go @@ -42,7 +42,7 @@ func init() { flag.StringVar(&w, "w", "", "set `web url`") flag.BoolVar(&d, "d", false, "set `dev env`") flag.StringVar(&c, "c", "", "set `component path`") - flag.StringVar(&l, "l", "en", "set `location`") + flag.StringVar(&l, "l", "zh", "set `location`") flag.Usage = usage } func usage() { diff --git a/web/assets/js/common.js b/web/assets/js/common.js index fe59b37..7f90945 100644 --- a/web/assets/js/common.js +++ b/web/assets/js/common.js @@ -27,16 +27,16 @@ var Common = { that.getLang(); }); - }, 100) + }, 100); }, convertErrors: function (err) { var s = err; if (err.indexOf("could not decrypt key with given passphrase") > -1) { s = $.i18n.prop('convert_error_password'); - }else if (err.indexOf("no enough unlocked utxos") > -1) { + } else if (err.indexOf("no enough unlocked utxos") > -1) { s = $.i18n.prop('convert_error_utxo'); - }else if (err.indexOf("stx Verify error") > -1) { + } else if (err.indexOf("stx Verify error") > -1) { s = $.i18n.prop('convert_error_verifytx'); } return s diff --git a/web/assets/js/dapps.js b/web/assets/js/dapps.js index 450cb1d..559dab3 100644 --- a/web/assets/js/dapps.js +++ b/web/assets/js/dapps.js @@ -37,7 +37,6 @@ var DApps = { }); $('.toast').toast({animation: true, autohide: true, delay: 2000}) this.genPageData(); - }, dapps_en_US: [ @@ -77,6 +76,15 @@ var DApps = { showTips: true, "state": 1 }, + { + img: "./assets/img/sanguo.png", + title: "超零三国-无限穿越", + desc: "抽卡功能已上线!人物全服唯一,是属于你的数字资产,可交易,可赚钱! 后续马上推出游历闯关、红颜约会、武将养成、养马、三国杀等丰富玩法! 超零平台第一款真正意义上的游戏", + author: "盘古", + url: "http://122.112.190.100/www/slg/slg.html", + showTips: true, + state: 1, + }, { img: "./assets/img/bluna.jpeg", title: "Bluna", @@ -85,16 +93,7 @@ var DApps = { url: "", showTips: true, state: 0, - }, - { - img: "./assets/img/sanguo.png", - title: "超零三国-无限穿越", - desc: "", - author: "盘古", - url: "", - showTips: true, - state: 0, - }, + } ], dapps_zh_CN: [ { @@ -132,6 +131,15 @@ var DApps = { showTips: true, "state": 1 }, + { + img: "./assets/img/sanguo.png", + title: "超零三国-无限穿越", + desc: "抽卡功能已上线!人物全服唯一,是属于你的数字资产,可交易,可赚钱! 后续马上推出游历闯关、红颜约会、武将养成、养马、三国杀等丰富玩法! 超零平台第一款真正意义上的游戏", + author: "盘古", + url: "http://122.112.190.100/www/slg/slg.html", + showTips: true, + state: 1, + }, { img: "./assets/img/bluna.jpeg", title: "Bluna", @@ -140,15 +148,6 @@ var DApps = { url: "", showTips: true, state: 0, - }, - { - img: "./assets/img/sanguo.png", - title: "超零三国-无限穿越", - desc: "", - author: "盘古", - url: "", - showTips: true, - state: 0, } ], diff --git a/web/assets/js/stake.js b/web/assets/js/stake.js index fae9250..f5029db 100644 --- a/web/assets/js/stake.js +++ b/web/assets/js/stake.js @@ -28,7 +28,8 @@ var StakeHome = { "0x5c7dbbe680d7687e23b0dd927c37e77f051d701d57ef118f2e7ef5ad9bf50c51":"超零猫猫", "0x36e40dc58bf2db57f1831a02c2a248b0fa378ba3a99908c17a63ed622174d496":"超零猴哥", "0x16a800063ef8345f8441de438d97c8a49bc3373778e45a2f2cd25699be8d2c2b":"抹茶节点", - "0xfd703f582147e4725a9b3567635dde7e442182c1f28e315360e07692a968183b":"超级节点" + "0xfd703f582147e4725a9b3567635dde7e442182c1f28e315360e07692a968183b":"超级节点", + "0xb688861cf4b0f74509a4a4a0bdcdbe80ec0b5647bfcc41973498c9b8152fce41":"OKEx Pool", }, en_US:{ "0x388b2c9ba68a96bf697602fef9219f64e4ff8aef49815d0aeb56afd2a1276942":"SERO Node (sero.im)", @@ -53,7 +54,8 @@ var StakeHome = { "0x5c7dbbe680d7687e23b0dd927c37e77f051d701d57ef118f2e7ef5ad9bf50c51":"SERO Cat Node", "0x36e40dc58bf2db57f1831a02c2a248b0fa378ba3a99908c17a63ed622174d496":"SERO Monkey Node", "0x16a800063ef8345f8441de438d97c8a49bc3373778e45a2f2cd25699be8d2c2b":"MXC Node", - "0xfd703f582147e4725a9b3567635dde7e442182c1f28e315360e07692a968183b":"Super Node" + "0xfd703f582147e4725a9b3567635dde7e442182c1f28e315360e07692a968183b":"Super Node", + "0xb688861cf4b0f74509a4a4a0bdcdbe80ec0b5647bfcc41973498c9b8152fce41":"OKEx Pool", } }, diff --git a/web/dapps.html b/web/dapps.html index c763a8f..26b54d0 100644 --- a/web/dapps.html +++ b/web/dapps.html @@ -101,11 +101,6 @@ Common.init(); - var refer = document.referrer; - if(){ - Common.postPullupRpc() - } - $("#form1").submit(function (event) { const f = $(this); event.preventDefault() diff --git a/web/stake.html b/web/stake.html index fdb664f..302a5ff 100644 --- a/web/stake.html +++ b/web/stake.html @@ -272,7 +272,7 @@ - +