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
6ae42d0a
Commit
6ae42d0a
authored
May 24, 2019
by
pengjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add block wait
parent
e8e52a49
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
10 deletions
+44
-10
test-rpc.sh
plugin/dapp/pokerbull/cmd/build/test-rpc.sh
+8
-3
test-rpc.sh
plugin/dapp/retrieve/cmd/build/test-rpc.sh
+36
-7
No files found.
plugin/dapp/pokerbull/cmd/build/test-rpc.sh
View file @
6ae42d0a
...
...
@@ -66,7 +66,6 @@ function query_tx() {
pokerbull_PlayRawTx
()
{
echo
"========== # pokerbull play tx begin =========="
tx
=
$(
curl
-ksd
'{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Play","payload":{"gameId":"pokerbull-abc", "value":"1000000000", "round":1}}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
PLAY_TX
=
$tx
data
=
$(
curl
-ksd
'{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'
"
$tx
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result.txs[0]"
)
ok
=
$(
jq
'(.execer == "pokerbull")'
<<<
"
$data
"
)
...
...
@@ -76,12 +75,13 @@ pokerbull_PlayRawTx() {
signrawtx
"
$tx
"
"CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944"
"play"
echo
"========== # pokerbull play tx end =========="
block_wait 1
}
pokerbull_QuitRawTx
()
{
echo
"========== # pokerbull quit tx begin =========="
tx
=
$(
curl
-ksd
'{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Quit","payload":{"gameId":"'
$GAME_ID
'"}}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
QUIT_TX
=
$tx
data
=
$(
curl
-ksd
'{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'
"
$tx
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result.txs[0]"
)
ok
=
$(
jq
'(.execer == "pokerbull")'
<<<
"
$data
"
)
...
...
@@ -91,12 +91,13 @@ pokerbull_QuitRawTx() {
signrawtx
"
$tx
"
"CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944"
"quit"
echo
"========== # pokerbull quit tx end =========="
block_wait 1
}
pokerbull_ContinueRawTx
()
{
echo
"========== # pokerbull continue tx begin =========="
tx
=
$(
curl
-ksd
'{"method":"Chain33.CreateTransaction","params":[{"execer":"pokerbull","actionName":"Continue","payload":{"gameId":"'
$GAME_ID
'"}}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
CONTINUE_TX
=
$tx
data
=
$(
curl
-ksd
'{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'
"
$tx
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result.txs[0]"
)
ok
=
$(
jq
'(.execer == "pokerbull")'
<<<
"
$data
"
)
...
...
@@ -106,6 +107,8 @@ pokerbull_ContinueRawTx() {
signrawtx
"
$tx
"
"0x9c451df9e5cb05b88b28729aeaaeb3169a2414097401fcb4c79c1971df734588"
"continue"
echo
"========== # pokerbull continue tx end =========="
block_wait 1
}
pokerbull_StartRawTx
()
{
...
...
@@ -120,6 +123,8 @@ pokerbull_StartRawTx() {
signrawtx
"
$tx
"
"CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944"
"start"
echo
"========== # pokerbull start tx end =========="
block_wait 1
}
pokerbull_QueryResult
()
{
...
...
plugin/dapp/retrieve/cmd/build/test-rpc.sh
View file @
6ae42d0a
...
...
@@ -64,7 +64,12 @@ function query_tx() {
retrieve_Backup
()
{
echo
"========== # retrieve backup begin =========="
tx
=
$(
curl
-ksd
'{"method":"retrieve.CreateRawRetrieveBackupTx","params":[{"backupAddr":"'
$1
'","defaultAddr":"'
$2
'","delayPeriod":'
$3
'}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
local
backupaddr
=
$1
local
defaultaddr
=
$2
local
delayPeriod
=
$3
tx
=
$(
curl
-ksd
'{"method":"retrieve.CreateRawRetrieveBackupTx","params":[{"backupAddr":"$backupaddr","defaultAddr":"$defaultaddr","delayPeriod": $delayPeriod}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
data
=
$(
curl
-ksd
'{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'
"
$tx
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result.txs[0]"
)
ok
=
$(
jq
'(.execer == "retrieve")'
<<<
"
$data
"
)
...
...
@@ -74,11 +79,17 @@ retrieve_Backup() {
signrawtx
"
$tx
"
"CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944"
echo
"========== # retrieve backup end =========="
block_wait 1
}
retrieve_Prepare
()
{
echo
"========== # retrieve prepare begin =========="
tx
=
$(
curl
-ksd
'{"method":"retrieve.CreateRawRetrievePrepareTx","params":[{"backupAddr":"'
$1
'","defaultAddr":"'
$2
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
local
backupaddr
=
$1
local
defaultaddr
=
$2
tx
=
$(
curl
-ksd
'{"method":"retrieve.CreateRawRetrievePrepareTx","params":[{"backupAddr":"$backupaddr","defaultAddr":"$defaultaddr"}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
data
=
$(
curl
-ksd
'{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'
"
$tx
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result.txs[0]"
)
ok
=
$(
jq
'(.execer == "retrieve")'
<<<
"
$data
"
)
...
...
@@ -88,11 +99,17 @@ retrieve_Prepare() {
signrawtx
"
$tx
"
"0x9c451df9e5cb05b88b28729aeaaeb3169a2414097401fcb4c79c1971df734588"
echo
"========== # retrieve prepare end =========="
block_wait 1
}
retrieve_Perform
()
{
echo
"========== # retrieve perform begin =========="
tx
=
$(
curl
-ksd
'{"method":"retrieve.CreateRawRetrievePerformTx","params":[{"backupAddr":"'
$1
'","defaultAddr":"'
$2
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
local
backupaddr
=
$1
local
defaultaddr
=
$2
tx
=
$(
curl
-ksd
'{"method":"retrieve.CreateRawRetrievePerformTx","params":[{"backupAddr":"$backupaddr","defaultAddr":"$defaultaddr"}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
data
=
$(
curl
-ksd
'{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'
"
$tx
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result.txs[0]"
)
ok
=
$(
jq
'(.execer == "retrieve")'
<<<
"
$data
"
)
...
...
@@ -102,11 +119,17 @@ retrieve_Perform() {
signrawtx
"
$tx
"
"0x9c451df9e5cb05b88b28729aeaaeb3169a2414097401fcb4c79c1971df734588"
echo
"========== # retrieve perform end =========="
block_wait 1
}
retrieve_Cancel
()
{
echo
"========== # retrieve cancel begin =========="
tx
=
$(
curl
-ksd
'{"method":"retrieve.CreateRawRetrieveCancelTx","params":[{"backupAddr":"'
$1
'","defaultAddr":"'
$2
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
local
backupaddr
=
$1
local
defaultaddr
=
$2
tx
=
$(
curl
-ksd
'{"method":"retrieve.CreateRawRetrieveCancelTx","params":[{"backupAddr":"$backupaddr","defaultAddr":"$defaultaddr"}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
data
=
$(
curl
-ksd
'{"method":"Chain33.DecodeRawTransaction","params":[{"txHex":"'
"
$tx
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result.txs[0]"
)
ok
=
$(
jq
'(.execer == "retrieve")'
<<<
"
$data
"
)
...
...
@@ -116,12 +139,19 @@ retrieve_Cancel() {
signrawtx
"
$tx
"
"CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944"
echo
"========== # retrieve cancel end =========="
block_wait 1
}
retrieve_QueryResult
()
{
echo
"========== # retrieve query result begin =========="
data
=
$(
curl
-ksd
'{"method":"Chain33.Query","params":[{"execer":"retrieve","funcName":"GetRetrieveInfo","payload":{"backupAddress":"'
$1
'", "defaultAddress":"'
$2
'"}}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
ok
=
$(
jq
'(.status == '
$3
')'
<<<
"
$data
"
)
local
backupaddr
=
$1
local
defaultaddr
=
$2
local
status
=
$3
data
=
$(
curl
-ksd
'{"method":"Chain33.Query","params":[{"execer":"retrieve","funcName":"GetRetrieveInfo","payload":{"backupAddress":"$backupaddr", "defaultAddress":"defaultaddr"}}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
ok
=
$(
jq
'(.status == $3)'
<<<
"
$data
"
)
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$?
"
...
...
@@ -144,7 +174,6 @@ chain33_ImportPrivkey() {
signrawtx
()
{
txHex
=
"
$1
"
priKey
=
"
$2
"
type
=
"
$3
"
local
req
=
'"method":"Chain33.SignRawTx","params":[{"privkey":"'
"
$priKey
"
'","txHex":"'
"
$txHex
"
'","expire":"120s"}]'
echo
"#request SignRawTx:
$req
"
signedTx
=
$(
curl
-ksd
"{
$req
}"
${
MAIN_HTTP
}
| jq
-r
".result"
)
...
...
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