Commit f795f328 authored by pengjun's avatar pengjun

add rpc-test debug info

parent fa6a6bf2
...@@ -154,6 +154,7 @@ chain33_ImportPrivkey() { ...@@ -154,6 +154,7 @@ chain33_ImportPrivkey() {
} }
signrawtx() { signrawtx() {
echo "sign tx '$1' begin"
txHex="$1" txHex="$1"
priKey="$2" priKey="$2"
type="$3" type="$3"
...@@ -164,9 +165,11 @@ signrawtx() { ...@@ -164,9 +165,11 @@ signrawtx() {
else else
echo "signedTx null error" echo "signedTx null error"
fi fi
echo "sign tx '$1' end"
} }
sendTx() { sendTx() {
echo "send tx '$1' begin"
signedTx=$1 signedTx=$1
type=$2 type=$2
local req='"method":"Chain33.SendTransaction","params":[{"token":"BTY","data":"'"$signedTx"'"}]' local req='"method":"Chain33.SendTransaction","params":[{"token":"BTY","data":"'"$signedTx"'"}]'
...@@ -181,10 +184,11 @@ sendTx() { ...@@ -181,10 +184,11 @@ sendTx() {
else else
echo "send tx error:$err" echo "send tx error:$err"
fi fi
echo "send tx '$1' end"
} }
Chain33_SendToAddress() { Chain33_SendToAddress() {
echo "send '$3' from '$1' to '$2' begin"
local from="$1" local from="$1"
local to="$2" local to="$2"
local amount=$3 local amount=$3
...@@ -195,6 +199,7 @@ Chain33_SendToAddress() { ...@@ -195,6 +199,7 @@ Chain33_SendToAddress() {
echo_rst "$FUNCNAME" "$?" echo_rst "$FUNCNAME" "$?"
hash=$(jq '(.result.hash)' <<<"$resp") hash=$(jq '(.result.hash)' <<<"$resp")
echo "hash=$hash" echo "hash=$hash"
echo "send '$3' from '$1' to '$2' end"
} }
init() { init() {
......
...@@ -189,6 +189,23 @@ Chain33_SendToAddress() { ...@@ -189,6 +189,23 @@ Chain33_SendToAddress() {
query_tx "$hash" query_tx "$hash"
} }
init() {
ispara=$(echo '"'"${MAIN_HTTP}"'"' | jq '.|contains("8901")')
echo "ipara=$ispara"
if [ "$ispara" == true ]; then
retrieve_addr=$(curl -ksd '{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"user.p.para.retrieve"}]}' ${MAIN_HTTP} | jq -r ".result")
else
chain33_ImportPrivkey "${MAIN_HTTP}" "0x9c451df9e5cb05b88b28729aeaaeb3169a2414097401fcb4c79c1971df734588" "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY"
retrieve_addr=$(curl -ksd '{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"retrieve"}]}' ${MAIN_HTTP} | jq -r ".result")
fi
echo "retrieveaddr=$retrieve_addr"
from="14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
Chain33_SendToAddress "$from" "$retrieve_addr" 10000000000
block_wait 1
}
function run_test() { function run_test() {
retrieve_Backup "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" 61 retrieve_Backup "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" 61
retrieve_QueryResult "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" 1 retrieve_QueryResult "1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY" "14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" 1
...@@ -208,6 +225,7 @@ function main() { ...@@ -208,6 +225,7 @@ function main() {
echo "=========== # retrieve rpc test =============" echo "=========== # retrieve rpc test ============="
echo "ip=$MAIN_HTTP" echo "ip=$MAIN_HTTP"
init
run_test run_test
if [ -n "$CASE_ERR" ]; then if [ -n "$CASE_ERR" ]; then
......
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