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
b32ec6be
Commit
b32ec6be
authored
May 27, 2019
by
pengjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix retrieve rpc test error
parent
d21a8b15
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
test-rpc.sh
plugin/dapp/pokerbull/cmd/build/test-rpc.sh
+4
-4
test-rpc.sh
plugin/dapp/retrieve/cmd/build/test-rpc.sh
+7
-7
rpc.go
plugin/dapp/retrieve/rpc/rpc.go
+4
-4
No files found.
plugin/dapp/pokerbull/cmd/build/test-rpc.sh
View file @
b32ec6be
...
...
@@ -68,7 +68,7 @@ pokerbull_PlayRawTx() {
tx
=
$(
curl
-ksd
'{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Play","payload":{"gameId":"pokerbull-abc", "value":"1000000000", "round":1}}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
data
=
$(
curl
-ksd
'{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'
"
$tx
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result.txs[0]"
)
ok
=
$(
jq
'(.execer
== "pokerbull
")'
<<<
"
$data
"
)
ok
=
$(
jq
'(.execer
!= "
")'
<<<
"
$data
"
)
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$?
"
...
...
@@ -84,7 +84,7 @@ pokerbull_QuitRawTx() {
tx
=
$(
curl
-ksd
'{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Quit","payload":{"gameId":"'
$GAME_ID
'"}}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
data
=
$(
curl
-ksd
'{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'
"
$tx
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result.txs[0]"
)
ok
=
$(
jq
'(.execer
== "pokerbull
")'
<<<
"
$data
"
)
ok
=
$(
jq
'(.execer
!= "
")'
<<<
"
$data
"
)
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$?
"
...
...
@@ -100,7 +100,7 @@ pokerbull_ContinueRawTx() {
tx
=
$(
curl
-ksd
'{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Continue","payload":{"gameId":"'
$GAME_ID
'"}}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
data
=
$(
curl
-ksd
'{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'
"
$tx
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result.txs[0]"
)
ok
=
$(
jq
'(.execer
== "pokerbull
")'
<<<
"
$data
"
)
ok
=
$(
jq
'(.execer
!= "
")'
<<<
"
$data
"
)
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$?
"
...
...
@@ -116,7 +116,7 @@ pokerbull_StartRawTx() {
tx
=
$(
curl
-ksd
'{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Start","payload":{"value":"1000000000", "playerNum":"2"}}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
data
=
$(
curl
-ksd
'{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'
"
$tx
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result.txs[0]"
)
ok
=
$(
jq
'(.execer
== "pokerbull
")'
<<<
"
$data
"
)
ok
=
$(
jq
'(.execer
!= "
")'
<<<
"
$data
"
)
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$?
"
...
...
plugin/dapp/retrieve/cmd/build/test-rpc.sh
View file @
b32ec6be
...
...
@@ -141,7 +141,7 @@ retrieve_Cancel() {
retrieve_QueryResult
()
{
echo
"========== # retrieve query result begin =========="
local
status
=
$
3
local
status
=
$
1
req
=
'"method":"Chain33.Query","params":[{"execer":"retrieve","funcName":"GetRetrieveInfo","payload":{"backupAddress":"1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY", "defaultAddress":"14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"}}]'
data
=
$(
curl
-ksd
"{
$req
}"
${
MAIN_HTTP
}
| jq
-r
".result"
)
...
...
@@ -213,17 +213,17 @@ Chain33_SendToAddress() {
}
function
run_test
()
{
retrieve_Backup
"1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY"
"14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
61
retrieve_QueryResult
"1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY"
"14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
1
retrieve_Backup
retrieve_QueryResult 1
retrieve_Prepare
"1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY"
"14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
retrieve_QueryResult
"1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY"
"14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
2
retrieve_Prepare
retrieve_QueryResult 2
#retrieve_Perform "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
#retrieve_QueryResult "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" 3
retrieve_Cancel
"1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY"
"14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
retrieve_QueryResult
"1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY"
"14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
4
retrieve_Cancel
retrieve_QueryResult 4
}
function
main
()
{
...
...
plugin/dapp/retrieve/rpc/rpc.go
View file @
b32ec6be
...
...
@@ -16,7 +16,7 @@ func (c *channelClient) Backup(ctx context.Context, v *rt.BackupRetrieve) (*type
Ty
:
rt
.
RetrieveActionBackup
,
Value
:
&
rt
.
RetrieveAction_Backup
{
Backup
:
v
},
}
tx
,
err
:=
types
.
CreateFormatTx
(
string
(
rt
.
ExecerRetrieve
),
types
.
Encode
(
backup
))
tx
,
err
:=
types
.
CreateFormatTx
(
types
.
ExecName
(
rt
.
RetrieveX
),
types
.
Encode
(
backup
))
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -29,7 +29,7 @@ func (c *channelClient) Prepare(ctx context.Context, v *rt.PrepareRetrieve) (*ty
Ty
:
rt
.
RetrieveActionPrepare
,
Value
:
&
rt
.
RetrieveAction_Prepare
{
Prepare
:
v
},
}
tx
,
err
:=
types
.
CreateFormatTx
(
string
(
rt
.
ExecerRetrieve
),
types
.
Encode
(
prepare
))
tx
,
err
:=
types
.
CreateFormatTx
(
types
.
ExecName
(
rt
.
RetrieveX
),
types
.
Encode
(
prepare
))
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -43,7 +43,7 @@ func (c *channelClient) Perform(ctx context.Context, v *rt.PerformRetrieve) (*ty
Ty
:
rt
.
RetrieveActionPerform
,
Value
:
&
rt
.
RetrieveAction_Perform
{
Perform
:
v
},
}
tx
,
err
:=
types
.
CreateFormatTx
(
string
(
rt
.
ExecerRetrieve
),
types
.
Encode
(
perform
))
tx
,
err
:=
types
.
CreateFormatTx
(
types
.
ExecName
(
rt
.
RetrieveX
),
types
.
Encode
(
perform
))
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -56,7 +56,7 @@ func (c *channelClient) Cancel(ctx context.Context, v *rt.CancelRetrieve) (*type
Ty
:
rt
.
RetrieveActionCancel
,
Value
:
&
rt
.
RetrieveAction_Cancel
{
Cancel
:
v
},
}
tx
,
err
:=
types
.
CreateFormatTx
(
string
(
rt
.
ExecerRetrieve
),
types
.
Encode
(
cancel
))
tx
,
err
:=
types
.
CreateFormatTx
(
types
.
ExecName
(
rt
.
RetrieveX
),
types
.
Encode
(
cancel
))
if
err
!=
nil
{
return
nil
,
err
}
...
...
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