Commit bca40bb8 authored by 张振华's avatar 张振华

update

parent a2690b38
...@@ -644,11 +644,11 @@ ...@@ -644,11 +644,11 @@
}, },
"font": "Arial;13;0", "font": "Arial;13;0",
"left": 96, "left": 96,
"top": 515, "top": 527,
"width": 113.46435546875, "width": 113.46435546875,
"height": 13, "height": 13,
"alpha": 0.8881057303801025, "alpha": 0.14930207097851655,
"distance": 11.40175425099138, "distance": 18.601075237738275,
"hostEdge": { "hostEdge": {
"$ref": "AAAAAAFnU9ToGQuaBII=" "$ref": "AAAAAAFnU9ToGQuaBII="
}, },
...@@ -2372,12 +2372,12 @@ ...@@ -2372,12 +2372,12 @@
}, },
"fontColor": "#ff0000", "fontColor": "#ff0000",
"font": "Arial;13;0", "font": "Arial;13;0",
"left": 511, "left": 496,
"top": 376, "top": 383,
"width": 89, "width": 89,
"height": 13, "height": 13,
"alpha": 0.5797154799347988, "alpha": 0.33266536401287555,
"distance": 54.45181356024793, "distance": 40.85339643163099,
"hostEdge": { "hostEdge": {
"$ref": "AAAAAAFnU+sx4g1ZC00=" "$ref": "AAAAAAFnU+sx4g1ZC00="
}, },
...@@ -2635,12 +2635,12 @@ ...@@ -2635,12 +2635,12 @@
}, },
"fontColor": "#00d600", "fontColor": "#00d600",
"font": "Arial;13;0", "font": "Arial;13;0",
"left": 270, "left": 214,
"top": 420, "top": 415,
"width": 44.08447265625, "width": 44.08447265625,
"height": 13, "height": 13,
"alpha": 1.802649048826961, "alpha": -0.9391717284139225,
"distance": 25.96150997149434, "distance": 31.144823004794873,
"hostEdge": { "hostEdge": {
"$ref": "AAAAAAFnc16P7Kaa5nw=" "$ref": "AAAAAAFnc16P7Kaa5nw="
}, },
...@@ -2733,12 +2733,12 @@ ...@@ -2733,12 +2733,12 @@
}, },
"fontColor": "#00d600", "fontColor": "#00d600",
"font": "Arial;13;0", "font": "Arial;13;0",
"left": 253, "left": 264,
"top": 487, "top": 487,
"width": 41.1962890625, "width": 41.1962890625,
"height": 13, "height": 13,
"alpha": 1.5707963267948966, "alpha": 1.7114542967370516,
"distance": 15, "distance": 25,
"hostEdge": { "hostEdge": {
"$ref": "AAAAAAFnduBlUKbHO2o=" "$ref": "AAAAAAFnduBlUKbHO2o="
}, },
......
...@@ -117,7 +117,9 @@ func main() { ...@@ -117,7 +117,9 @@ func main() {
status, _ := strconv.Atoi(os.Args[3]) status, _ := strconv.Atoi(os.Args[3])
index, _ := strconv.ParseInt(os.Args[4], 10, 64) index, _ := strconv.ParseInt(os.Args[4], 10, 64)
testQueryGamesByCategoryStatus(os.Args[2], int32(status), index) testQueryGamesByCategoryStatus(os.Args[2], int32(status), index)
} }else if os.Args[1] == "testQueryGamesByIds" {
testQueryGamesByIds(os.Args[2:])
}
} }
...@@ -155,7 +157,7 @@ func constructTx(poststr string) (string, error) { ...@@ -155,7 +157,7 @@ func constructTx(poststr string) (string, error) {
} }
func createGuessGameStartTx() (string, error) { func createGuessGameStartTx() (string, error) {
poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":2,"method":"Chain33.CreateTransaction","params":[{"execer":"guess","actionName":"GuessStart", "payload":{"topic":"%v","options":"%v", "category":"%v","maxBets":%v,"maxBetsNumber":%v,"fee":%v}}]}`,"WorldCup Final", "A:France;B:Claodia", "football", int64(100e8), int64(1000e8),fee) poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":2,"method":"Chain33.CreateTransaction","params":[{"execer":"guess","actionName":"GuessStart", "payload":{"topic":"%v","options":"%v", "category":"%v","maxBets":%v,"maxBetsNumber":%v,"fee":%v,"devFeeFactor":%v,"devFeeAddr":"%v","platFeeFactor":%v, "platFeeAddr":"%v"}}]}`,"WorldCup Final", "A:France;B:Claodia", "football", int64(100e8), int64(1000e8),fee, 5, "1D6RFZNp2rh6QdbcZ1d7RWuBUz61We6SD7", 5, "1PHtChNt3UcfssR7v7trKSk3WJtAWjKjjX")
fmt.Println(poststr) fmt.Println(poststr)
return constructTx(poststr) return constructTx(poststr)
} }
...@@ -307,6 +309,7 @@ func SendTx(hexTx string) { ...@@ -307,6 +309,7 @@ func SendTx(hexTx string) {
poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":2,"method":"Chain33.SendTransaction","params":[{"data":"%v"}]}`, poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":2,"method":"Chain33.SendTransaction","params":[{"data":"%v"}]}`,
hexTx) hexTx)
fmt.Println("post data:", poststr)
resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr)) resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr))
if err != nil { if err != nil {
panic(err) panic(err)
...@@ -319,10 +322,15 @@ func SendTx(hexTx string) { ...@@ -319,10 +322,15 @@ func SendTx(hexTx string) {
fmt.Printf("returned JSON: %s\n", string(b)) fmt.Printf("returned JSON: %s\n", string(b))
} }
func testQueryGamesByIds(gameId string) { func testQueryGamesByIds(gameIds []string) {
str := fmt.Sprintf("{%s}", gameIds[0])
for i := 1 ; i < len(gameIds); i++ {
str = fmt.Sprintf(",{\"%s\"}", gameIds[i])
}
poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query", poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query",
"params":[{"execer":"guess","funcName":"QueryGamesByIds","payload":{"gameIds":[{"%v"}]}}]}`, gameId) "params":[{"execer":"guess","funcName":"QueryGamesByIds","payload":{"gameIds":[%v]}}]}`, gameId, str)
fmt.Println("post data:", poststr)
resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr)) resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr))
if err != nil { if err != nil {
panic(err) panic(err)
...@@ -347,6 +355,8 @@ func testQueryGameById(gameId string) { ...@@ -347,6 +355,8 @@ func testQueryGameById(gameId string) {
poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query", poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query",
"params":[{"execer":"guess","funcName":"QueryGameById","payload":{"gameId":"%v"}}]}`, gameId) "params":[{"execer":"guess","funcName":"QueryGameById","payload":{"gameId":"%v"}}]}`, gameId)
fmt.Println("post data:", poststr)
resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr)) resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr))
if err != nil { if err != nil {
panic(err) panic(err)
...@@ -371,6 +381,7 @@ func testQueryGamesByAddr(addr string,index int64) { ...@@ -371,6 +381,7 @@ func testQueryGamesByAddr(addr string,index int64) {
poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query", poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query",
"params":[{"execer":"guess","funcName":"QueryGamesByAddr","payload":{"addr":"%v","index":"%v"}}]}`, addr, index) "params":[{"execer":"guess","funcName":"QueryGamesByAddr","payload":{"addr":"%v","index":"%v"}}]}`, addr, index)
fmt.Println("post data:", poststr)
resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr)) resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr))
if err != nil { if err != nil {
panic(err) panic(err)
...@@ -394,7 +405,7 @@ func testQueryGamesByAddr(addr string,index int64) { ...@@ -394,7 +405,7 @@ func testQueryGamesByAddr(addr string,index int64) {
func testQueryGamesByStatus(status int32, index int64) { func testQueryGamesByStatus(status int32, index int64) {
poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query", poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query",
"params":[{"execer":"guess","funcName":"QueryGamesByStatus","payload":{"status":"%v","index":"%v"}}]}`, status, index) "params":[{"execer":"guess","funcName":"QueryGamesByStatus","payload":{"status":"%v","index":"%v"}}]}`, status, index)
fmt.Println("post data:", poststr)
resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr)) resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr))
if err != nil { if err != nil {
panic(err) panic(err)
...@@ -418,7 +429,7 @@ func testQueryGamesByStatus(status int32, index int64) { ...@@ -418,7 +429,7 @@ func testQueryGamesByStatus(status int32, index int64) {
func testQueryGamesByAdminAddr(addr string,index int64) { func testQueryGamesByAdminAddr(addr string,index int64) {
poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query", poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query",
"params":[{"execer":"guess","funcName":"QueryGamesByAdminAddr","payload":{"adminAddr":"%v","index":"%v"}}]}`, addr, index) "params":[{"execer":"guess","funcName":"QueryGamesByAdminAddr","payload":{"adminAddr":"%v","index":"%v"}}]}`, addr, index)
fmt.Println("post data:", poststr)
resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr)) resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr))
if err != nil { if err != nil {
panic(err) panic(err)
...@@ -443,7 +454,7 @@ func testQueryGamesByAdminAddr(addr string,index int64) { ...@@ -443,7 +454,7 @@ func testQueryGamesByAdminAddr(addr string,index int64) {
func testQueryGamesByAddrStatus(addr string,status int32, index int64) { func testQueryGamesByAddrStatus(addr string,status int32, index int64) {
poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query", poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query",
"params":[{"execer":"guess","funcName":"QueryGamesByAddrStatus","payload":{"addr":"%v","status":"%v","index":"%v"}}]}`, addr, status, index) "params":[{"execer":"guess","funcName":"QueryGamesByAddrStatus","payload":{"addr":"%v","status":"%v","index":"%v"}}]}`, addr, status, index)
fmt.Println("post data:", poststr)
resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr)) resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr))
if err != nil { if err != nil {
panic(err) panic(err)
...@@ -467,7 +478,7 @@ func testQueryGamesByAddrStatus(addr string,status int32, index int64) { ...@@ -467,7 +478,7 @@ func testQueryGamesByAddrStatus(addr string,status int32, index int64) {
func testQueryGamesByAdminStatus(addr string,status int32, index int64) { func testQueryGamesByAdminStatus(addr string,status int32, index int64) {
poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query", poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query",
"params":[{"execer":"guess","funcName":"QueryGamesByAdminStatus","payload":{"adminAddr":"%v","status":"%v","index":"%v"}}]}`, addr, status, index) "params":[{"execer":"guess","funcName":"QueryGamesByAdminStatus","payload":{"adminAddr":"%v","status":"%v","index":"%v"}}]}`, addr, status, index)
fmt.Println("post data:", poststr)
resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr)) resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr))
if err != nil { if err != nil {
panic(err) panic(err)
...@@ -491,7 +502,7 @@ func testQueryGamesByAdminStatus(addr string,status int32, index int64) { ...@@ -491,7 +502,7 @@ func testQueryGamesByAdminStatus(addr string,status int32, index int64) {
func testQueryGamesByCategoryStatus(category string,status int32, index int64) { func testQueryGamesByCategoryStatus(category string,status int32, index int64) {
poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query", poststr := fmt.Sprintf(`{"jsonrpc":"2.0","id":0,"method":"Chain33.Query",
"params":[{"execer":"guess","funcName":"QueryGamesByCategoryStatus","payload":{"category":"%v","status":"%v","index":"%v"}}]}`, category, status, index) "params":[{"execer":"guess","funcName":"QueryGamesByCategoryStatus","payload":{"category":"%v","status":"%v","index":"%v"}}]}`, category, status, index)
fmt.Println("post data:", poststr)
resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr)) resp, err := http.Post(getJrpc(), "application/json", bytes.NewBufferString(poststr))
if err != nil { if err != nil {
panic(err) panic(err)
...@@ -511,3 +522,4 @@ func testQueryGamesByCategoryStatus(category string,status int32, index int64) { ...@@ -511,3 +522,4 @@ func testQueryGamesByCategoryStatus(category string,status int32, index int64) {
return return
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment