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
fd8a0924
Commit
fd8a0924
authored
May 14, 2019
by
vipwzw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto ci
parent
ddb29f2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
22 deletions
+19
-22
test-rpc.sh
plugin/dapp/blackwhite/cmd/build/test-rpc.sh
+19
-22
No files found.
plugin/dapp/blackwhite/cmd/build/test-rpc.sh
View file @
fd8a0924
...
@@ -22,7 +22,6 @@ echo_rst() {
...
@@ -22,7 +22,6 @@ echo_rst() {
gID
=
""
gID
=
""
gResp
=
""
gResp
=
""
glAddr
=
""
glAddr
=
""
gameAddr1
=
""
gameAddr1
=
""
gameAddr2
=
""
gameAddr2
=
""
...
@@ -64,7 +63,7 @@ chain33_SendToAddress() {
...
@@ -64,7 +63,7 @@ chain33_SendToAddress() {
note
=
"test"
note
=
"test"
resp
=
$(
curl
-ksd
'{"jsonrpc":"2.0","id":2,"method":"Chain33.SendToAddress","params":[{"from":"'
"
$from
"
'","to":"'
"
$to
"
'","amount":'
"
$amount
"
',"note":"'
"
$note
"
'"}]}'
-H
'content-type:text/plain;'
${
MAIN_HTTP
})
resp
=
$(
curl
-ksd
'{"jsonrpc":"2.0","id":2,"method":"Chain33.SendToAddress","params":[{"from":"'
"
$from
"
'","to":"'
"
$to
"
'","amount":'
"
$amount
"
',"note":"'
"
$note
"
'"}]}'
-H
'content-type:text/plain;'
${
MAIN_HTTP
})
ok
=
$(
jq
'(.error|not)'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not)'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
rst
=
$?
rst
=
$?
echo_rst
"
$FUNCNAME
"
"
$rst
"
echo_rst
"
$FUNCNAME
"
"
$rst
"
}
}
...
@@ -90,7 +89,6 @@ chain33_SendTransaction() {
...
@@ -90,7 +89,6 @@ chain33_SendTransaction() {
echo
"tx hash is
$gResp
"
echo
"tx hash is
$gResp
"
}
}
blackwhite_BlackwhiteCreateTx
()
{
blackwhite_BlackwhiteCreateTx
()
{
#创建交易
#创建交易
addr
=
$1
addr
=
$1
...
@@ -101,7 +99,7 @@ blackwhite_BlackwhiteCreateTx() {
...
@@ -101,7 +99,7 @@ blackwhite_BlackwhiteCreateTx() {
echo_rst
"
$FUNCNAME
"
"
$rst
"
echo_rst
"
$FUNCNAME
"
"
$rst
"
#发送交易
#发送交易
rawTx
=
$(
echo
"
${
resp
}
"
| jq
-r
".result"
)
rawTx
=
$(
echo
"
${
resp
}
"
| jq
-r
".result"
)
chain33_SendTransaction
"
${
rawTx
}
"
"
${
addr
}
"
chain33_SendTransaction
"
${
rawTx
}
"
"
${
addr
}
"
gID
=
"
${
gResp
}
"
gID
=
"
${
gResp
}
"
echo
"gameID
$gID
"
echo
"gameID
$gID
"
}
}
...
@@ -118,7 +116,7 @@ blackwhite_BlackwhitePlayTx() {
...
@@ -118,7 +116,7 @@ blackwhite_BlackwhitePlayTx() {
echo_rst
"
$FUNCNAME
"
"
$rst
"
echo_rst
"
$FUNCNAME
"
"
$rst
"
#发送交易
#发送交易
rawTx
=
$(
echo
"
${
resp
}
"
| jq
-r
".result"
)
rawTx
=
$(
echo
"
${
resp
}
"
| jq
-r
".result"
)
chain33_SendTransaction
"
${
rawTx
}
"
"
${
addr
}
"
chain33_SendTransaction
"
${
rawTx
}
"
"
${
addr
}
"
}
}
blackwhite_BlackwhiteShowTx
()
{
blackwhite_BlackwhiteShowTx
()
{
...
@@ -131,7 +129,7 @@ blackwhite_BlackwhiteShowTx() {
...
@@ -131,7 +129,7 @@ blackwhite_BlackwhiteShowTx() {
echo_rst
"
$FUNCNAME
"
"
$rst
"
echo_rst
"
$FUNCNAME
"
"
$rst
"
#发送交易
#发送交易
rawTx
=
$(
echo
"
${
resp
}
"
| jq
-r
".result"
)
rawTx
=
$(
echo
"
${
resp
}
"
| jq
-r
".result"
)
chain33_SendTransaction
"
${
rawTx
}
"
"
${
addr
}
"
chain33_SendTransaction
"
${
rawTx
}
"
"
${
addr
}
"
}
}
blackwhite_BlackwhiteTimeoutDoneTx
()
{
blackwhite_BlackwhiteTimeoutDoneTx
()
{
...
@@ -199,40 +197,40 @@ function run_testcases() {
...
@@ -199,40 +197,40 @@ function run_testcases() {
#给每个账户分别转帐
#给每个账户分别转帐
origAddr
=
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
origAddr
=
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
chain33_SendToAddress
"
${
origAddr
}
"
"
${
gameAddr1
}
"
1000000000
chain33_SendToAddress
"
${
origAddr
}
"
"
${
gameAddr1
}
"
1000000000
chain33_SendToAddress
"
${
origAddr
}
"
"
${
gameAddr2
}
"
1000000000
chain33_SendToAddress
"
${
origAddr
}
"
"
${
gameAddr2
}
"
1000000000
chain33_SendToAddress
"
${
origAddr
}
"
"
${
gameAddr3
}
"
1000000000
chain33_SendToAddress
"
${
origAddr
}
"
"
${
gameAddr3
}
"
1000000000
block_wait 1
block_wait 1
#给游戏合约中转帐
#给游戏合约中转帐
bwExecAddr
=
"146wei89zoX5TNQKATBJmduNPEtSKTXi1z"
bwExecAddr
=
"146wei89zoX5TNQKATBJmduNPEtSKTXi1z"
chain33_SendToAddress
"
${
gameAddr1
}
"
"
${
bwExecAddr
}
"
500000000
chain33_SendToAddress
"
${
gameAddr1
}
"
"
${
bwExecAddr
}
"
500000000
chain33_SendToAddress
"
${
gameAddr2
}
"
"
${
bwExecAddr
}
"
500000000
chain33_SendToAddress
"
${
gameAddr2
}
"
"
${
bwExecAddr
}
"
500000000
chain33_SendToAddress
"
${
gameAddr3
}
"
"
${
bwExecAddr
}
"
500000000
chain33_SendToAddress
"
${
gameAddr3
}
"
"
${
bwExecAddr
}
"
500000000
block_wait 1
block_wait 1
blackwhite_BlackwhiteCreateTx
"
${
gameAddr1
}
"
blackwhite_BlackwhiteCreateTx
"
${
gameAddr1
}
"
block_wait 1
block_wait 1
blackwhite_BlackwhitePlayTx
"
${
gameAddr1
}
"
"
${
white0
}
"
"
${
white1
}
"
"
${
black2
}
"
blackwhite_BlackwhitePlayTx
"
${
gameAddr1
}
"
"
${
white0
}
"
"
${
white1
}
"
"
${
black2
}
"
blackwhite_BlackwhitePlayTx
"
${
gameAddr2
}
"
"
${
white0
}
"
"
${
black1
}
"
"
${
black2
}
"
blackwhite_BlackwhitePlayTx
"
${
gameAddr2
}
"
"
${
white0
}
"
"
${
black1
}
"
"
${
black2
}
"
blackwhite_BlackwhitePlayTx
"
${
gameAddr3
}
"
"
${
white0
}
"
"
${
black1
}
"
"
${
black2
}
"
blackwhite_BlackwhitePlayTx
"
${
gameAddr3
}
"
"
${
white0
}
"
"
${
black1
}
"
"
${
black2
}
"
block_wait 1
block_wait 1
blackwhite_BlackwhiteShowTx
"
${
gameAddr1
}
"
"
${
sect1
}
"
blackwhite_BlackwhiteShowTx
"
${
gameAddr1
}
"
"
${
sect1
}
"
blackwhite_BlackwhiteShowTx
"
${
gameAddr2
}
"
"
${
sect1
}
"
blackwhite_BlackwhiteShowTx
"
${
gameAddr2
}
"
"
${
sect1
}
"
blackwhite_BlackwhiteShowTx
"
${
gameAddr3
}
"
"
${
sect1
}
"
blackwhite_BlackwhiteShowTx
"
${
gameAddr3
}
"
"
${
sect1
}
"
blackwhite_BlackwhiteTimeoutDoneTx
"
$gID
"
blackwhite_BlackwhiteTimeoutDoneTx
"
$gID
"
#查询部分
#查询部分
block_wait 1
block_wait 1
blackwhite_GetBlackwhiteRoundInfo
"
$gID
"
blackwhite_GetBlackwhiteRoundInfo
"
$gID
"
blackwhite_GetBlackwhiteByStatusAndAddr
"
$gID
"
"
${
gameAddr1
}
"
blackwhite_GetBlackwhiteByStatusAndAddr
"
$gID
"
"
${
gameAddr1
}
"
blackwhite_GetBlackwhiteloopResult
"
$gID
"
blackwhite_GetBlackwhiteloopResult
"
$gID
"
}
}
function
main
()
{
function
main
()
{
local
ip
=
$1
local
ip
=
$1
MAIN_HTTP
=
"http://
$ip
:8801"
MAIN_HTTP
=
"http://
$ip
:8801"
...
@@ -249,4 +247,4 @@ function main() {
...
@@ -249,4 +247,4 @@ function main() {
fi
fi
}
}
main
"172.19.0.6"
main
"172.19.0.6"
\ No newline at end of file
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