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
7ae9e8e5
Commit
7ae9e8e5
authored
May 30, 2019
by
张振华
Browse files
Options
Browse Files
Download
Plain Diff
update
parents
52c44dd9
8ceecca3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
docker-compose.sh
build/docker-compose.sh
+1
-1
test-rpc.sh
plugin/dapp/guess/cmd/build/test-rpc.sh
+12
-11
No files found.
build/docker-compose.sh
View file @
7ae9e8e5
...
@@ -366,7 +366,7 @@ function main() {
...
@@ -366,7 +366,7 @@ function main() {
### test cases ###
### test cases ###
ip
=
$(${
CLI
}
net info | jq
-r
".externalAddr"
)
ip
=
$(${
CLI
}
net info | jq
-r
".externalAddr"
)
ip
=
`
echo
$ip
|cut
-d
':'
-f
1
`
ip
=
$(
echo
$ip
|
cut
-d
':'
-f
1
)
dapp_run
test
"
${
ip
}
"
dapp_run
test
"
${
ip
}
"
### rpc test ###
### rpc test ###
...
...
plugin/dapp/guess/cmd/build/test-rpc.sh
View file @
7ae9e8e5
...
@@ -26,7 +26,7 @@ echo_rst() {
...
@@ -26,7 +26,7 @@ echo_rst() {
CASE_ERR
=
"err"
CASE_ERR
=
"err"
fi
fi
}
}
set
-x
saveSeed
()
{
saveSeed
()
{
seed
=
"journey notable narrow few bar stuff notable custom miss brother attend tongue price theme resist"
seed
=
"journey notable narrow few bar stuff notable custom miss brother attend tongue price theme resist"
...
@@ -79,7 +79,6 @@ importPrivkey3() {
...
@@ -79,7 +79,6 @@ importPrivkey3() {
echo_rst
"
$FUNCNAME
"
"
$?
"
echo_rst
"
$FUNCNAME
"
"
$?
"
}
}
sendTransaction1
()
{
sendTransaction1
()
{
ispara
=
$(
echo
'"'
"
${
MAIN_HTTP
}
"
'"'
| jq
'.|contains("8901")'
)
ispara
=
$(
echo
'"'
"
${
MAIN_HTTP
}
"
'"'
| jq
'.|contains("8901")'
)
echo
"ipara=
$ispara
"
echo
"ipara=
$ispara
"
...
@@ -89,6 +88,7 @@ sendTransaction1() {
...
@@ -89,6 +88,7 @@ sendTransaction1() {
old
=
${
MAIN_HTTP
}
old
=
${
MAIN_HTTP
}
MAIN_HTTP
=
"
${
MAIN_HTTP
//8901/8801
}
"
MAIN_HTTP
=
"
${
MAIN_HTTP
//8901/8801
}
"
Chain33_SendToAddress 14KEKbYtKKQm4wMthSK9J4La4nAiidGozt 1EbDHAXpoiewjPLX9uqoz38HsKqMXayZrF 300000000
Chain33_SendToAddress 14KEKbYtKKQm4wMthSK9J4La4nAiidGozt 1EbDHAXpoiewjPLX9uqoz38HsKqMXayZrF 300000000
MAIN_HTTP
=
${
old
}
MAIN_HTTP
=
${
old
}
return
return
...
@@ -141,6 +141,7 @@ queryBalance1() {
...
@@ -141,6 +141,7 @@ queryBalance1() {
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$?
"
echo_rst
"
$FUNCNAME
"
"
$?
"
echo
"
$resp
"
|jq
-r
".result"
echo
"
$resp
"
|jq
-r
".result"
}
}
sendTransaction2
()
{
sendTransaction2
()
{
local
fee
=
1000000
local
fee
=
1000000
...
@@ -196,12 +197,12 @@ sendToExec2() {
...
@@ -196,12 +197,12 @@ sendToExec2() {
echo_rst
"
$FUNCNAME
"
"
$rst
"
echo_rst
"
$FUNCNAME
"
"
$rst
"
}
}
sendToExec11
(){
sendToExec11
()
{
from
=
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
from
=
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
Chain33_SendToAddress
"
$from
"
"
$guess_addr
"
20000000000
Chain33_SendToAddress
"
$from
"
"
$guess_addr
"
20000000000
}
}
sendToExec12
(){
sendToExec12
()
{
from
=
"1EbDHAXpoiewjPLX9uqoz38HsKqMXayZrF"
from
=
"1EbDHAXpoiewjPLX9uqoz38HsKqMXayZrF"
Chain33_SendToAddress
"
$from
"
"
$guess_addr
"
20000000000
Chain33_SendToAddress
"
$from
"
"
$guess_addr
"
20000000000
}
}
...
@@ -214,7 +215,9 @@ queryBalance2() {
...
@@ -214,7 +215,9 @@ queryBalance2() {
ok
=
$(
jq
'(.error|not) and (.result != "")'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not) and (.result != "")'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$?
"
echo_rst
"
$FUNCNAME
"
"
$?
"
echo
"
$resp
"
|jq
-r
".result"
echo
"
$resp
"
|jq
-r
".result"
}
}
queryBalance3
()
{
queryBalance3
()
{
req
=
'"method":"Chain33.GetBalance","params":[{"Addresses":["1EbDHAXpoiewjPLX9uqoz38HsKqMXayZrF"]}]'
req
=
'"method":"Chain33.GetBalance","params":[{"Addresses":["1EbDHAXpoiewjPLX9uqoz38HsKqMXayZrF"]}]'
...
@@ -224,6 +227,7 @@ queryBalance3() {
...
@@ -224,6 +227,7 @@ queryBalance3() {
ok
=
$(
jq
'(.error|not) and (.result != "")'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not) and (.result != "")'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$?
"
echo_rst
"
$FUNCNAME
"
"
$?
"
echo
"
$resp
"
|jq
-r
".result"
echo
"
$resp
"
|jq
-r
".result"
}
}
...
@@ -444,7 +448,6 @@ init() {
...
@@ -444,7 +448,6 @@ init() {
echo
"guess_addr=
$guess_addr
"
echo
"guess_addr=
$guess_addr
"
}
}
function
run_test
()
{
function
run_test
()
{
#保存seed
#保存seed
...
@@ -510,7 +513,6 @@ function run_test() {
...
@@ -510,7 +513,6 @@ function run_test() {
#查询游戏状态
#查询游戏状态
guess_QueryGameByID
"
$eventId
"
12
guess_QueryGameByID
"
$eventId
"
12
#管理员停止下注
#管理员停止下注
guess_game_stop
guess_game_stop
...
@@ -529,7 +531,6 @@ function run_test() {
...
@@ -529,7 +531,6 @@ function run_test() {
#查询游戏状态
#查询游戏状态
guess_QueryGameByID
"
$eventId
"
15
guess_QueryGameByID
"
$eventId
"
15
#start->stop->abort
#start->stop->abort
guess_game_start
guess_game_start
...
@@ -586,9 +587,11 @@ function run_test() {
...
@@ -586,9 +587,11 @@ function run_test() {
#等待2个区块
#等待2个区块
block_wait 2
block_wait 2
#查询游戏状态
#查询游戏状态
guess_QueryGameByID
"
$eventId
"
11
guess_QueryGameByID
"
$eventId
"
11
#用户1下注
#用户1下注
guess_game_bet1
guess_game_bet1
...
@@ -598,6 +601,7 @@ function run_test() {
...
@@ -598,6 +601,7 @@ function run_test() {
#查询游戏状态
#查询游戏状态
guess_QueryGameByID
"
$eventId
"
12
guess_QueryGameByID
"
$eventId
"
12
#用户2下注
#用户2下注
guess_game_bet2
guess_game_bet2
...
@@ -607,6 +611,7 @@ function run_test() {
...
@@ -607,6 +611,7 @@ function run_test() {
#查询游戏状态
#查询游戏状态
guess_QueryGameByID
"
$eventId
"
12
guess_QueryGameByID
"
$eventId
"
12
#管理员发布结果
#管理员发布结果
guess_game_abort
guess_game_abort
...
@@ -643,7 +648,6 @@ function run_test() {
...
@@ -643,7 +648,6 @@ function run_test() {
#查询游戏状态
#查询游戏状态
guess_QueryGameByID
"
$eventId
"
12
guess_QueryGameByID
"
$eventId
"
12
#管理员停止下注
#管理员停止下注
guess_game_stop
guess_game_stop
...
@@ -682,5 +686,3 @@ function main() {
...
@@ -682,5 +686,3 @@ function main() {
}
}
main
"
$1
"
main
"
$1
"
set
+x
\ 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