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
8ceecca3
Commit
8ceecca3
authored
May 29, 2019
by
vipwzw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto ci
parent
83f86a48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
41 deletions
+35
-41
docker-compose.sh
build/docker-compose.sh
+1
-1
test-rpc.sh
plugin/dapp/guess/cmd/build/test-rpc.sh
+34
-40
No files found.
build/docker-compose.sh
View file @
8ceecca3
...
@@ -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 @
8ceecca3
...
@@ -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
"
...
@@ -88,7 +87,7 @@ sendTransaction1() {
...
@@ -88,7 +87,7 @@ sendTransaction1() {
Chain33_SendToAddress 14KEKbYtKKQm4wMthSK9J4La4nAiidGozt 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv 120000000000
Chain33_SendToAddress 14KEKbYtKKQm4wMthSK9J4La4nAiidGozt 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv 120000000000
old
=
${
MAIN_HTTP
}
old
=
${
MAIN_HTTP
}
MAIN_HTTP
=
`
echo
${
MAIN_HTTP
}
|sed
's/8901/8801/'
`
MAIN_HTTP
=
$(
echo
${
MAIN_HTTP
}
|
sed
's/8901/8801/'
)
Chain33_SendToAddress 14KEKbYtKKQm4wMthSK9J4La4nAiidGozt 1EbDHAXpoiewjPLX9uqoz38HsKqMXayZrF 300000000
Chain33_SendToAddress 14KEKbYtKKQm4wMthSK9J4La4nAiidGozt 1EbDHAXpoiewjPLX9uqoz38HsKqMXayZrF 300000000
MAIN_HTTP
=
${
old
}
MAIN_HTTP
=
${
old
}
return
return
...
@@ -142,7 +141,7 @@ queryBalance1() {
...
@@ -142,7 +141,7 @@ queryBalance1() {
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"
}
}
sendTransaction2
()
{
sendTransaction2
()
{
local
fee
=
1000000
local
fee
=
1000000
...
@@ -201,14 +200,14 @@ sendToExec2() {
...
@@ -201,14 +200,14 @@ 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
}
}
queryBalance2
()
{
queryBalance2
()
{
...
@@ -219,7 +218,7 @@ queryBalance2() {
...
@@ -219,7 +218,7 @@ 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"]}]'
...
@@ -229,7 +228,7 @@ queryBalance3() {
...
@@ -229,7 +228,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"
}
}
set
-x
set
-x
...
@@ -449,7 +448,6 @@ init() {
...
@@ -449,7 +448,6 @@ init() {
echo
"guess_addr=
$guess_addr
"
echo
"guess_addr=
$guess_addr
"
}
}
function
run_test
()
{
function
run_test
()
{
#保存seed
#保存seed
...
@@ -515,7 +513,6 @@ function run_test() {
...
@@ -515,7 +513,6 @@ function run_test() {
#查询游戏状态
#查询游戏状态
guess_QueryGameByID
$eventId
12
guess_QueryGameByID
$eventId
12
#管理员停止下注
#管理员停止下注
guess_game_stop
guess_game_stop
...
@@ -534,7 +531,6 @@ function run_test() {
...
@@ -534,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,39 +582,39 @@ function run_test() {
...
@@ -586,39 +582,39 @@ function run_test() {
#start->bet->abort
#start->bet->abort
#管理员创建游戏
#管理员创建游戏
guess_game_start
guess_game_start
#等待2个区块
#等待2个区块
block_wait 2
block_wait 2
#查询游戏状态
#查询游戏状态
guess_QueryGameByID
$eventId
11
guess_QueryGameByID
$eventId
11
#用户1下注
#用户1下注
guess_game_bet1
guess_game_bet1
#等待1个区块
#等待1个区块
block_wait 2
block_wait 2
#查询游戏状态
#查询游戏状态
guess_QueryGameByID
$eventId
12
guess_QueryGameByID
$eventId
12
#用户2下注
#用户2下注
guess_game_bet2
guess_game_bet2
#等待2个区块
#等待2个区块
block_wait 2
block_wait 2
#查询游戏状态
#查询游戏状态
guess_QueryGameByID
$eventId
12
guess_QueryGameByID
$eventId
12
#管理员发布结果
#管理员发布结果
guess_game_abort
guess_game_abort
#等待1个区块
#等待1个区块
block_wait 2
block_wait 2
#查询游戏状态
#查询游戏状态
guess_QueryGameByID
$eventId
14
guess_QueryGameByID
$eventId
14
#start->bet->stop->abort
#start->bet->stop->abort
#管理员创建游戏
#管理员创建游戏
...
@@ -648,7 +644,6 @@ function run_test() {
...
@@ -648,7 +644,6 @@ function run_test() {
#查询游戏状态
#查询游戏状态
guess_QueryGameByID
$eventId
12
guess_QueryGameByID
$eventId
12
#管理员停止下注
#管理员停止下注
guess_game_stop
guess_game_stop
...
@@ -688,4 +683,4 @@ function main() {
...
@@ -688,4 +683,4 @@ function main() {
main
"
$1
"
main
"
$1
"
set
+x
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