Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
ff6ed7b4
Commit
ff6ed7b4
authored
Oct 12, 2019
by
张振华
Committed by
vipwzw
Oct 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
69b7f53f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
guess_test.go
plugin/dapp/guess/rpc/guess_test.go
+11
-11
No files found.
plugin/dapp/guess/rpc/guess_test.go
View file @
ff6ed7b4
...
@@ -122,9 +122,9 @@ verMix=200
...
@@ -122,9 +122,9 @@ verMix=200
verMax=200
verMax=200
[rpc]
[rpc]
# jrpc绑定地址
# jrpc绑定地址
jrpcBindAddr="localhost:
8
801"
jrpcBindAddr="localhost:
9
801"
# grpc绑定地址
# grpc绑定地址
grpcBindAddr="localhost:
8
802"
grpcBindAddr="localhost:
9
802"
# 白名单列表,允许访问的IP地址,默认是“*”,允许所有IP访问
# 白名单列表,允许访问的IP地址,默认是“*”,允许所有IP访问
whitelist=["127.0.0.1"]
whitelist=["127.0.0.1"]
# jrpc方法请求白名单,默认是“*”,允许访问所有RPC方法
# jrpc方法请求白名单,默认是“*”,允许访问所有RPC方法
...
@@ -696,7 +696,7 @@ func initEnvGuess() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Mo
...
@@ -696,7 +696,7 @@ func initEnvGuess() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Mo
func
createConn
()
error
{
func
createConn
()
error
{
var
err
error
var
err
error
url
:=
"127.0.0.1:
8
802"
url
:=
"127.0.0.1:
9
802"
fmt
.
Println
(
"grpc url:"
,
url
)
fmt
.
Println
(
"grpc url:"
,
url
)
conn
,
err
=
grpc
.
Dial
(
url
,
grpc
.
WithInsecure
())
conn
,
err
=
grpc
.
Dial
(
url
,
grpc
.
WithInsecure
())
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -1079,7 +1079,7 @@ func queryGuessByIds(gameIDs string) *gty.ReplyGuessGameInfos {
...
@@ -1079,7 +1079,7 @@ func queryGuessByIds(gameIDs string) *gty.ReplyGuessGameInfos {
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
gty
.
ReplyGuessGameInfos
var
res
gty
.
ReplyGuessGameInfos
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
8
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
9
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
return
&
res
return
&
res
}
}
...
@@ -1095,7 +1095,7 @@ func queryGuessByID(gameID string) *gty.ReplyGuessGameInfo {
...
@@ -1095,7 +1095,7 @@ func queryGuessByID(gameID string) *gty.ReplyGuessGameInfo {
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
gty
.
ReplyGuessGameInfo
var
res
gty
.
ReplyGuessGameInfo
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
8
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
9
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
return
&
res
return
&
res
}
}
...
@@ -1111,7 +1111,7 @@ func queryGuessByAddr(addr string) *gty.GuessGameRecords {
...
@@ -1111,7 +1111,7 @@ func queryGuessByAddr(addr string) *gty.GuessGameRecords {
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
gty
.
GuessGameRecords
var
res
gty
.
GuessGameRecords
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
8
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
9
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
return
&
res
return
&
res
}
}
...
@@ -1127,7 +1127,7 @@ func queryGuessByStatus(status int32) *gty.GuessGameRecords {
...
@@ -1127,7 +1127,7 @@ func queryGuessByStatus(status int32) *gty.GuessGameRecords {
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
gty
.
GuessGameRecords
var
res
gty
.
GuessGameRecords
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
8
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
9
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
return
&
res
return
&
res
}
}
...
@@ -1143,7 +1143,7 @@ func queryGuessByAdminAddr(addr string) *gty.GuessGameRecords {
...
@@ -1143,7 +1143,7 @@ func queryGuessByAdminAddr(addr string) *gty.GuessGameRecords {
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
gty
.
GuessGameRecords
var
res
gty
.
GuessGameRecords
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
8
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
9
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
return
&
res
return
&
res
}
}
...
@@ -1160,7 +1160,7 @@ func queryGuessByAddrStatus(addr string, status int32) *gty.GuessGameRecords {
...
@@ -1160,7 +1160,7 @@ func queryGuessByAddrStatus(addr string, status int32) *gty.GuessGameRecords {
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
gty
.
GuessGameRecords
var
res
gty
.
GuessGameRecords
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
8
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
9
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
return
&
res
return
&
res
}
}
...
@@ -1177,7 +1177,7 @@ func queryGuessByAdminAddrStatus(addr string, status int32) *gty.GuessGameRecord
...
@@ -1177,7 +1177,7 @@ func queryGuessByAdminAddrStatus(addr string, status int32) *gty.GuessGameRecord
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
gty
.
GuessGameRecords
var
res
gty
.
GuessGameRecords
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
8
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
9
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
return
&
res
return
&
res
}
}
...
@@ -1194,7 +1194,7 @@ func queryGuessByCategoryStatus(category string, status int32) *gty.GuessGameRec
...
@@ -1194,7 +1194,7 @@ func queryGuessByCategoryStatus(category string, status int32) *gty.GuessGameRec
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
params
.
Payload
=
types
.
MustPBToJSON
(
req
)
var
res
gty
.
GuessGameRecords
var
res
gty
.
GuessGameRecords
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
//ctx := jsonrpc.NewRPCCtx("http://"+types.Conf("config.rpc").GStr("jrpcBindAddr"), "Chain33.Query", params, &res)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
8
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewRPCCtx
(
"http://127.0.0.1:
9
801"
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
return
&
res
return
&
res
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment