Skip to content

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdurrent committed Oct 31, 2019
1 parent 3a60c29 commit 7cfe0a7
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 40 deletions.
23 changes: 15 additions & 8 deletions app/light.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
6 changes: 3 additions & 3 deletions web/assets/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 19 additions & 20 deletions web/assets/js/dapps.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ var DApps = {
});
$('.toast').toast({animation: true, autohide: true, delay: 2000})
this.genPageData();

},

dapps_en_US: [
Expand Down Expand Up @@ -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",
Expand All @@ -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: [
{
Expand Down Expand Up @@ -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",
Expand All @@ -140,15 +148,6 @@ var DApps = {
url: "",
showTips: true,
state: 0,
},
{
img: "./assets/img/sanguo.png",
title: "超零三国-无限穿越",
desc: "",
author: "盘古",
url: "",
showTips: true,
state: 0,
}
],

Expand Down
6 changes: 4 additions & 2 deletions web/assets/js/stake.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ var StakeHome = {
"0x5c7dbbe680d7687e23b0dd927c37e77f051d701d57ef118f2e7ef5ad9bf50c51":"超零猫猫",
"0x36e40dc58bf2db57f1831a02c2a248b0fa378ba3a99908c17a63ed622174d496":"超零猴哥",
"0x16a800063ef8345f8441de438d97c8a49bc3373778e45a2f2cd25699be8d2c2b":"抹茶节点",
"0xfd703f582147e4725a9b3567635dde7e442182c1f28e315360e07692a968183b":"超级节点"
"0xfd703f582147e4725a9b3567635dde7e442182c1f28e315360e07692a968183b":"超级节点",
"0xb688861cf4b0f74509a4a4a0bdcdbe80ec0b5647bfcc41973498c9b8152fce41":"OKEx Pool",
},
en_US:{
"0x388b2c9ba68a96bf697602fef9219f64e4ff8aef49815d0aeb56afd2a1276942":"SERO Node (sero.im)",
Expand All @@ -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",
}
},

Expand Down
5 changes: 0 additions & 5 deletions web/dapps.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ <h5 class="modal-title" id="showModalTitle">Add Dapp</h5>

Common.init();

var refer = document.referrer;
if(){
Common.postPullupRpc()
}

$("#form1").submit(function (event) {
const f = $(this);
event.preventDefault()
Expand Down
2 changes: 1 addition & 1 deletion web/stake.html
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ <h5 class="modal-title" id="modifyModalTitle">Modify Stake Pool</h5>
<script src="assets/plugin/clipboard.min.js"></script>
<script src="assets/plugin/bignumber.js"></script>
<script src="assets/js/common.js?v0.1.5"></script>
<script src="assets/js/stake.js?v"></script>
<script src="assets/js/stake.js?v0.1.7"></script>

<script>
$('.header').load('header.html');
Expand Down

0 comments on commit 7cfe0a7

Please sign in to comment.