Commit 20050771 authored by mdj33's avatar mdj33 Committed by vipwzw

add paracross rpc test

parent 3aa89eb0
...@@ -11,6 +11,14 @@ echo_rst() { ...@@ -11,6 +11,14 @@ echo_rst() {
fi fi
} }
paracross_GetBlock2MainInfo() {
height=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"paracross.GetBlock2MainInfo","params":[{"start":1,"end":3}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result.items[1].height")
[ "$height" -eq 2 ]
rst=$?
echo_rst $FUNCNAME $rst
}
chain33_lock() { chain33_lock() {
ok=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.Lock","params":[]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result.isOK") ok=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.Lock","params":[]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result.isOK")
[ "$ok" == true ] [ "$ok" == true ]
...@@ -18,6 +26,7 @@ chain33_lock() { ...@@ -18,6 +26,7 @@ chain33_lock() {
echo_rst $FUNCNAME $rst echo_rst $FUNCNAME $rst
} }
chain33_unlock() { chain33_unlock() {
ok=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.UnLock","params":[{"passwd":"1314fuzamei","timeout":0}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result.isOK") ok=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.UnLock","params":[{"passwd":"1314fuzamei","timeout":0}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result.isOK")
[ "$ok" == true ] [ "$ok" == true ]
...@@ -30,8 +39,8 @@ function dapp_rpc_test() { ...@@ -30,8 +39,8 @@ function dapp_rpc_test() {
MAIN_HTTP="http://$ip:8901" MAIN_HTTP="http://$ip:8901"
echo "=========== # paracross rpc test =============" echo "=========== # paracross rpc test ============="
echo "ip=$MAIN_HTTP" echo "ip=$MAIN_HTTP"
chain33_lock paracross_GetBlock2MainInfo
chain33_unlock chain33_unlock
} }
#system_rpc_test #dapp_rpc_test $1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment