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
7dcd4b1b
Commit
7dcd4b1b
authored
Jun 20, 2019
by
yukang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'para_rpc_test' of
https://github.com/freek99/plugin
into para_rpc_test
parents
7938cb8a
cb1a3c10
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
test-rpc.sh
plugin/dapp/paracross/cmd/build/test-rpc.sh
+8
-8
No files found.
plugin/dapp/paracross/cmd/build/test-rpc.sh
View file @
7dcd4b1b
...
@@ -117,7 +117,7 @@ function paracross_Transfer_Withdraw() {
...
@@ -117,7 +117,7 @@ function paracross_Transfer_Withdraw() {
echo
"after transferring:
$para_balance_after
"
echo
"after transferring:
$para_balance_after
"
#real_amount 实际转移金额
#real_amount 实际转移金额
amount_real
=
$((
$para_balance_after
-
$
para_balance_before
))
amount_real
=
$((
para_balance_after
-
para_balance_before
))
#5 取钱
#5 取钱
tx_hash
=
$(
curl
-ksd
'{"method":"Chain33.CreateTransaction","params":[{"execer":"paracross","actionName":"ParacrossAssetWithdraw","payload":{"IsWithdraw":true,"execer":"user.p.para.paracross","execName":"user.p.para.paracross","to":"'
$fromAddr
'","amount":'
$withdraw_should
'}}]}'
${
UNIT_HTTP
}
| jq
-r
".result"
)
tx_hash
=
$(
curl
-ksd
'{"method":"Chain33.CreateTransaction","params":[{"execer":"paracross","actionName":"ParacrossAssetWithdraw","payload":{"IsWithdraw":true,"execer":"user.p.para.paracross","execName":"user.p.para.paracross","to":"'
$fromAddr
'","amount":'
$withdraw_should
'}}]}'
${
UNIT_HTTP
}
| jq
-r
".result"
)
...
@@ -130,7 +130,7 @@ function paracross_Transfer_Withdraw() {
...
@@ -130,7 +130,7 @@ function paracross_Transfer_Withdraw() {
echo
"after withdrawing :
$para_balance_withdraw_after
"
echo
"after withdrawing :
$para_balance_withdraw_after
"
#实际取钱金额
#实际取钱金额
withdraw_real
=
$((
$para_balance_after
-
$
para_balance_withdraw_after
))
withdraw_real
=
$((
para_balance_after
-
para_balance_withdraw_after
))
#echo $withdraw_real
#echo $withdraw_real
#7 验证转移是否正确
#7 验证转移是否正确
...
@@ -156,7 +156,7 @@ function paracross_ListTitles() {
...
@@ -156,7 +156,7 @@ function paracross_ListTitles() {
local
resp
local
resp
local
ok
local
ok
resp
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"paracross.ListTitles","params":[]}'
-H
'content-type:text/plain;'
${
UNIT_HTTP
}
)
resp
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"paracross.ListTitles","params":[]}'
-H
'content-type:text/plain;'
${
UNIT_HTTP
})
#echo $resp
#echo $resp
ok
=
$(
jq
'(.error|not) and (.result| [has("titles"),true])'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not) and (.result| [has("titles"),true])'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
...
@@ -168,7 +168,7 @@ function paracross_GetHeight() {
...
@@ -168,7 +168,7 @@ function paracross_GetHeight() {
local
resp
local
resp
local
ok
local
ok
resp
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"paracross.GetHeight","params":[]}'
-H
'content-type:text/plain;'
${
UNIT_HTTP
}
)
resp
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"paracross.GetHeight","params":[]}'
-H
'content-type:text/plain;'
${
UNIT_HTTP
})
#echo $resp
#echo $resp
ok
=
$(
jq
'(.error|not) and (.result| [has("consensHeight"),true])'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not) and (.result| [has("consensHeight"),true])'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
...
@@ -180,7 +180,7 @@ function paracross_GetNodeGroupAddrs() {
...
@@ -180,7 +180,7 @@ function paracross_GetNodeGroupAddrs() {
local
resp
local
resp
local
ok
local
ok
resp
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"paracross.GetNodeGroupAddrs","params":[{"title":"user.p.para."}]}'
-H
'content-type:text/plain;'
${
UNIT_HTTP
}
)
resp
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"paracross.GetNodeGroupAddrs","params":[{"title":"user.p.para."}]}'
-H
'content-type:text/plain;'
${
UNIT_HTTP
})
#echo $resp
#echo $resp
ok
=
$(
jq
'(.error|not) and (.result| [has("key","value"),true])'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not) and (.result| [has("key","value"),true])'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
...
@@ -192,7 +192,7 @@ function paracross_GetNodeGroupStatus() {
...
@@ -192,7 +192,7 @@ function paracross_GetNodeGroupStatus() {
local
resp
local
resp
local
ok
local
ok
resp
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"paracross.GetNodeGroupStatus","params":[{"title":"user.p.para."}]}'
-H
'content-type:text/plain;'
${
UNIT_HTTP
}
)
resp
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"paracross.GetNodeGroupStatus","params":[{"title":"user.p.para."}]}'
-H
'content-type:text/plain;'
${
UNIT_HTTP
})
#echo $resp
#echo $resp
ok
=
$(
jq
'(.error|not) and (.result| [has("status"),true])'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not) and (.result| [has("status"),true])'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
...
@@ -204,7 +204,7 @@ function paracross_ListNodeGroupStatus() {
...
@@ -204,7 +204,7 @@ function paracross_ListNodeGroupStatus() {
local
resp
local
resp
local
ok
local
ok
resp
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"paracross.ListNodeGroupStatus","params":[{"title":"user.p.para.","status":2}]}'
-H
'content-type:text/plain;'
${
UNIT_HTTP
}
)
resp
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"paracross.ListNodeGroupStatus","params":[{"title":"user.p.para.","status":2}]}'
-H
'content-type:text/plain;'
${
UNIT_HTTP
})
#echo $resp
#echo $resp
ok
=
$(
jq
'(.error|not) and (.result| [has("status"),true])'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not) and (.result| [has("status"),true])'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
...
@@ -216,7 +216,7 @@ function paracross_ListNodeStatus() {
...
@@ -216,7 +216,7 @@ function paracross_ListNodeStatus() {
local
resp
local
resp
local
ok
local
ok
resp
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"paracross.ListNodeStatus","params":[{"title":"user.p.para.","status":4}]}'
-H
'content-type:text/plain;'
${
UNIT_HTTP
}
)
resp
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"paracross.ListNodeStatus","params":[{"title":"user.p.para.","status":4}]}'
-H
'content-type:text/plain;'
${
UNIT_HTTP
})
#echo $resp
#echo $resp
ok
=
$(
jq
'(.error|not) and (.result| [has("status"),true])'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not) and (.result| [has("status"),true])'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
...
...
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