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
f6eda7c7
Commit
f6eda7c7
authored
Jun 20, 2019
by
yukang
Browse files
Options
Browse Files
Download
Plain Diff
modify para rpc testcase
parents
2ae273c5
9db2a3c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
13 deletions
+3
-13
test-rpc.sh
plugin/dapp/paracross/cmd/build/test-rpc.sh
+3
-13
No files found.
plugin/dapp/paracross/cmd/build/test-rpc.sh
View file @
f6eda7c7
...
@@ -26,7 +26,6 @@ paracross_GetBlock2MainInfo() {
...
@@ -26,7 +26,6 @@ paracross_GetBlock2MainInfo() {
echo_rst
"
$FUNCNAME
"
"
$rst
"
echo_rst
"
$FUNCNAME
"
"
$rst
"
}
}
chain33_lock
()
{
chain33_lock
()
{
local
ok
local
ok
...
@@ -45,7 +44,6 @@ chain33_unlock() {
...
@@ -45,7 +44,6 @@ chain33_unlock() {
}
}
function
paracross_SignAndSend
()
{
function
paracross_SignAndSend
()
{
local
signedTx
local
signedTx
local
sendedTx
local
sendedTx
...
@@ -68,7 +66,6 @@ function paracross_QueryBalance() {
...
@@ -68,7 +66,6 @@ function paracross_QueryBalance() {
return
$?
return
$?
}
}
function
paracross_Transfer_Withdraw
()
{
function
paracross_Transfer_Withdraw
()
{
echo
"=========== ## para cross transfer/withdraw (main to para) test start"
echo
"=========== ## para cross transfer/withdraw (main to para) test start"
...
@@ -108,7 +105,6 @@ function paracross_Transfer_Withdraw() {
...
@@ -108,7 +105,6 @@ function paracross_Transfer_Withdraw() {
##echo "tx:$tx"
##echo "tx:$tx"
paracross_SignAndSend
$fee
"
$privkey
"
"
$tx_hash
"
paracross_SignAndSend
$fee
"
$privkey
"
"
$tx_hash
"
#3 资产从主链转移到平行链
#3 资产从主链转移到平行链
tx_hash
=
$(
curl
-ksd
'{"method":"Chain33.CreateTransaction","params":[{"execer":"paracross","actionName":"ParacrossAssetTransfer","payload":{"execer":"user.p.para.paracross","execName":"user.p.para.paracross","to":"'
$fromAddr
'","amount":'
$amount_should
'}}]}'
${
UNIT_HTTP
}
| jq
-r
".result"
)
tx_hash
=
$(
curl
-ksd
'{"method":"Chain33.CreateTransaction","params":[{"execer":"paracross","actionName":"ParacrossAssetTransfer","payload":{"execer":"user.p.para.paracross","execName":"user.p.para.paracross","to":"'
$fromAddr
'","amount":'
$amount_should
'}}]}'
${
UNIT_HTTP
}
| jq
-r
".result"
)
#echo "rawTx:$rawTx"
#echo "rawTx:$rawTx"
...
@@ -128,7 +124,6 @@ function paracross_Transfer_Withdraw() {
...
@@ -128,7 +124,6 @@ function paracross_Transfer_Withdraw() {
#echo "rawTx:$rawTx"
#echo "rawTx:$rawTx"
paracross_SignAndSend
$fee
"
$privkey
"
"
$tx_hash
"
paracross_SignAndSend
$fee
"
$privkey
"
"
$tx_hash
"
sleep
15
sleep
15
#6 查询取钱后余额状态
#6 查询取钱后余额状态
para_balance_withdraw_after
=
$(
paracross_QueryBalance
"
$fromAddr
"
)
para_balance_withdraw_after
=
$(
paracross_QueryBalance
"
$fromAddr
"
)
...
@@ -138,17 +133,15 @@ function paracross_Transfer_Withdraw() {
...
@@ -138,17 +133,15 @@ function paracross_Transfer_Withdraw() {
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 验证转移是否正确
[
"
$amount_real
"
==
"
$amount_should
"
]
&&
[
"
$withdraw_should
"
==
"
$withdraw_real
"
]
[
"
$amount_real
"
==
"
$amount_should
"
]
&&
[
"
$withdraw_should
"
==
"
$withdraw_real
"
]
rst
=
$?
rst
=
$?
echo_rst
"
$FUNCNAME
"
"
$rst
"
echo_rst
"
$FUNCNAME
"
"
$rst
"
echo
"=========== ## para cross transfer/withdraw (main to para) test start end"
echo
"=========== ## para cross transfer/withdraw (main to para) test start end"
}
}
function
paracross_IsSync
()
{
function
paracross_IsSync
()
{
local
ok
local
ok
...
@@ -159,6 +152,7 @@ function paracross_IsSync() {
...
@@ -159,6 +152,7 @@ function paracross_IsSync() {
}
}
function
paracross_ListTitles
()
{
function
paracross_ListTitles
()
{
local
resp
local
resp
local
ok
local
ok
...
@@ -170,8 +164,6 @@ function paracross_ListTitles() {
...
@@ -170,8 +164,6 @@ function paracross_ListTitles() {
echo_rst
"
$FUNCNAME
"
"
$rst
"
echo_rst
"
$FUNCNAME
"
"
$rst
"
}
}
function
paracross_GetHeight
()
{
function
paracross_GetHeight
()
{
local
resp
local
resp
local
ok
local
ok
...
@@ -220,7 +212,6 @@ function paracross_ListNodeGroupStatus() {
...
@@ -220,7 +212,6 @@ function paracross_ListNodeGroupStatus() {
echo_rst
"
$FUNCNAME
"
"
$rst
"
echo_rst
"
$FUNCNAME
"
"
$rst
"
}
}
function
paracross_ListNodeStatus
()
{
function
paracross_ListNodeStatus
()
{
local
resp
local
resp
local
ok
local
ok
...
@@ -233,7 +224,6 @@ function paracross_ListNodeStatus() {
...
@@ -233,7 +224,6 @@ function paracross_ListNodeStatus() {
echo_rst
"
$FUNCNAME
"
"
$rst
"
echo_rst
"
$FUNCNAME
"
"
$rst
"
}
}
function
run_main_testcases
()
{
function
run_main_testcases
()
{
chain33_lock
chain33_lock
chain33_unlock
chain33_unlock
...
...
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