Skip to content

Commit 0ef50a5

Browse files
committed
Updated values of balance for members
1 parent 1dddfd7 commit 0ef50a5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const (
2929
waitTablesCount = 32
3030
demoPageURL = "https://raw.githubusercontent.com/GenesisKernel/apps/master/demo_apps.json"
3131
serveKeysPort = 85
32+
33+
walletBalance = 100
3234
)
3335

3436
var (

utils.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"io"
99
"io/ioutil"
10+
"math"
1011
"net"
1112
"net/http"
1213
"net/url"
@@ -681,8 +682,8 @@ func updateKeys(nodesCount int) error {
681682
jvtToken := "Bearer " + loginResult.Token
682683

683684
contName := "con_updatekeys" + strconv.FormatInt(int64(i), 10)
684-
code := `{data {}conditions {} action {$result=DBInsert("keys", "id,pub,amount", "` + keyID + `", "` + pubKey + `", "100") }}`
685-
updateKeysCode := "contract " + contName + code
685+
balance := walletBalance * math.Pow(10, 18)
686+
updateKeysCode := fmt.Sprintf(`contract %s {data {}conditions {} action {$result=DBInsert("keys", "id,pub,amount", "%s", "%s", "%.0f") }}`, contName, keyID, pubKey, balance)
686687
values = &url.Values{"Wallet": {""}, "Value": {updateKeysCode}, "Conditions": {`"ContractConditions(` + "`MainCondition`" + `)"`}}
687688

688689
res, err = sendRequest("POST", baseURL+"/prepare/NewContract", values, jvtToken)

0 commit comments

Comments
 (0)