Commit eb71b43f authored by harrylee's avatar harrylee Committed by vipwzw

fix a bug for docker-compose ci

parent 488f63fb
......@@ -230,6 +230,27 @@ function block_wait() {
echo "wait new block $count/10 s, cur height=$expect,old=$cur_height"
}
function tx_wait() {
if [ "$#" -lt 2 ]; then
echo "wrong tx_wait params"
exit 1
fi
local req=\"${2}\"
local txhash=$(${1} tx query -s ${2} | jq ".tx.hash")
local count=0
while true; do
txhash=$(${1} tx query -s ${2} | jq ".tx.hash")
if [ "${txhash}" != "${req}" ]; then
count=$((count + 1))
echo "${txhash}" "${req}" "${count}"
sleep 0.1
else
RAW_TX_HASH=$txhash
echo "====query tx=$RAW_TX_HASH success"
break
fi
done
}
function block_wait2height() {
if [ "$#" -lt 3 ]; then
echo "wrong block_wait params"
......@@ -336,7 +357,8 @@ function transfer() {
echo "=========== # withdraw ============="
hash=$(${1} send coins transfer -a 2 -n deposit -t 1wvmD6RNHzwhY4eN75WnM6JcaAvNQ4nHx -k CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944)
echo "${hash}"
block_wait "${1}" 1
# block_wait "${1}" 2
tx_wait "${1}" "${hash}"
before=$(${1} account balance -a 14KEKbYtKKQm4wMthSK9J4La4nAiidGozt -e retrieve | jq -r ".balance")
if [ "${before}" == "0.0000" ]; then
echo "wrong ticket balance, should not be zero"
......@@ -345,7 +367,8 @@ function transfer() {
hash=$(${1} send coins withdraw -a 1 -n withdraw -e retrieve -k CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944)
echo "${hash}"
block_wait "${1}" 1
# block_wait "${1}" 1
tx_wait "${1}" "${hash}"
txs=$(${1} tx query_hash -s "${hash}" | jq ".txs")
if [ "${txs}" == "null" ]; then
echo "withdraw cannot find tx"
......@@ -354,7 +377,8 @@ function transfer() {
hash=$(${1} send coins transfer -a 1000 -n transfer -t 1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY -k 4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01)
echo "${hash}"
block_wait "${1}" 1
# block_wait "${1}" 1
tx_wait "${1}" "${hash}"
}
function dapp_test_address() {
......@@ -382,11 +406,14 @@ function dapp_test_address() {
hash=$(${1} send coins transfer -a 1500 -n transfer -t 1PUiGcbsccfxW3zuvHXZBJfznziph5miAo -k 2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989)
echo "${hash}"
tx_wait "${1}" "${hash}"
#total allocation for rpc test
hash=$(${1} send coins transfer -a 8000 -n transfer -t 1PcGKYYoLn1PLLJJodc1UpgWGeFAQasAkx -k 2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989)
echo "${hash}"
block_wait "${1}" 1
# block_wait "${1}" 1
tx_wait "${1}" "${hash}"
}
function base_config() {
......
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