Commit 3bf8962b authored by linj's avatar linj Committed by vipwzw

fix shellcheck

parent 757a5aa2
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2128 # shellcheck disable=SC2128
# shellcheck source=/dev/null
source ../dapp-test-common.sh source ../dapp-test-common.sh
MAIN_HTTP="" MAIN_HTTP=""
function init() { function init() {
ispara=$(echo '"'"${MAIN_HTTP}"'"' | jq '.|contains("8901")') ispara=$(echo '"'"${MAIN_HTTP}"'"' | jq '.|contains("8901")')
......
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2128 # shellcheck disable=SC2128
# shellcheck source=/dev/null
source ../dapp-test-common.sh source ../dapp-test-common.sh
MAIN_HTTP="" MAIN_HTTP=""
txhash=""
function block_wait() {
req='{"method":"Chain33.GetLastHeader","params":[{}]}'
cur_height=$(curl -ksd "$req" ${MAIN_HTTP} | jq ".result.height")
expect=$((cur_height + ${1}))
local count=0
while true; do
new_height=$(curl -ksd "$req" ${MAIN_HTTP} | jq ".result.height")
if [ "${new_height}" -ge "${expect}" ]; then
break
fi
count=$((count + 1))
sleep 1
done
echo "wait new block $count s, cur height=$expect,old=$cur_height"
}
function query_unfreezeID() { function query_unfreezeID() {
block_wait 1 chain33_BlockWait 1 "$MAIN_HTTP"
# echo "req=$req" # echo "req=$req"
local times=10 local times=10
...@@ -99,6 +85,7 @@ function CreateRawUnfreezeWithdraw() { ...@@ -99,6 +85,7 @@ function CreateRawUnfreezeWithdraw() {
rawtx=$(jq -r ".result" <<<"$resp") rawtx=$(jq -r ".result" <<<"$resp")
chain33_SignRawTx "$rawtx" "${beneficiary_key}" "${MAIN_HTTP}" chain33_SignRawTx "$rawtx" "${beneficiary_key}" "${MAIN_HTTP}"
} }
function CreateRawUnfreezeTerminate() { function CreateRawUnfreezeTerminate() {
req='{"method":"unfreeze.CreateRawUnfreezeTerminate","params":[{"unfreezeID":"'${uid}'"}]}' req='{"method":"unfreeze.CreateRawUnfreezeTerminate","params":[{"unfreezeID":"'${uid}'"}]}'
# echo "#request: $req" # echo "#request: $req"
......
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