Print output addr on failed tx to help debug #147

This commit is contained in:
Ethan Frey 2017-06-29 15:13:33 +02:00
parent d3b66492f7
commit d36486aed7
5 changed files with 13 additions and 13 deletions

View File

@ -34,7 +34,7 @@ test01SendTx() {
assertFalse "missing dest" "${CLIENT_EXE} tx send --amount=992mycoin --sequence=1"
assertFalse "bad password" "echo foo | ${CLIENT_EXE} tx send --amount=992mycoin --sequence=1 --to=$RECV --name=$RICH"
TX=$(echo qwertyuiop | ${CLIENT_EXE} tx send --amount=992mycoin --sequence=1 --to=$RECV --name=$RICH)
txSucceeded $? "$TX"
txSucceeded $? "$TX" "$RECV"
HASH=$(echo $TX | jq .hash | tr -d \")
TX_HEIGHT=$(echo $TX | jq .height)

View File

@ -138,13 +138,13 @@ checkAccount() {
return $?
}
# XXX Ex Usage: txSucceeded $? "$TX"
# XXX Ex Usage: txSucceeded $? "$TX" "$RECIEVER"
# Desc: Must be called right after the `tx` command, makes sure it got a success response
txSucceeded() {
if (assertTrue "sent tx: $2" $1); then
if (assertTrue "sent tx ($3): $2" $1); then
TX=$2
assertEquals "good check: $TX" "0" $(echo $TX | jq .check_tx.code)
assertEquals "good deliver: $TX" "0" $(echo $TX | jq .deliver_tx.code)
assertEquals "good check ($3): $TX" "0" $(echo $TX | jq .check_tx.code)
assertEquals "good deliver ($3): $TX" "0" $(echo $TX | jq .deliver_tx.code)
else
return 1
fi

View File

@ -34,7 +34,7 @@ test01SendTx() {
assertFalse "missing dest" "${CLIENT_EXE} tx send --amount=992mycoin --sequence=1 2>/dev/null"
assertFalse "bad password" "echo foo | ${CLIENT_EXE} tx send --amount=992mycoin --sequence=1 --to=$RECV --name=$RICH 2>/dev/null"
TX=$(echo qwertyuiop | ${CLIENT_EXE} tx send --amount=992mycoin --sequence=1 --to=$RECV --name=$RICH 2>/dev/null)
txSucceeded $? "$TX"
txSucceeded $? "$TX" "$RECV"
HASH=$(echo $TX | jq .hash | tr -d \")
TX_HEIGHT=$(echo $TX | jq .height)
@ -65,7 +65,7 @@ test03AddCount() {
assertFalse "bad password" "echo hi | ${CLIENT_EXE} tx counter --amount=1000mycoin --sequence=2 --name=${RICH} 2>/dev/null"
TX=$(echo qwertyuiop | ${CLIENT_EXE} tx counter --amount=10mycoin --sequence=2 --name=${RICH} --valid --countfee=5mycoin)
txSucceeded $? "$TX"
txSucceeded $? "$TX" "counter"
HASH=$(echo $TX | jq .hash | tr -d \")
TX_HEIGHT=$(echo $TX | jq .height)

View File

@ -92,7 +92,7 @@ test01SendIBCTx() {
export BC_HOME=${CLIENT_1}
TX=$(echo qwertyuiop | ${CLIENT_EXE} tx send --amount=20002mycoin \
--sequence=1 --to=${CHAIN_ID_2}/${RECV} --name=$RICH)
txSucceeded $? "$TX"
txSucceeded $? "$TX" "${CHAIN_ID_2}/${RECV}"
# an example to quit early if there is no point in more tests
if [ $? != 0 ]; then echo "aborting!"; return 1; fi
@ -141,7 +141,7 @@ startRelay() {
SENDER=$(getAddr $RICH)
RES=$(echo qwertyuiop | ${CLIENT_EXE} tx send --amount=100000mycoin \
--sequence=$1 --to=$RELAY_ADDR --name=$RICH)
txSucceeded $? "$RES"
txSucceeded $? "$RES" "$RELAY_ADDR"
if [ $? != 0 ]; then echo "can't pay chain1!"; return 1; fi
# Get paid on chain2
@ -149,7 +149,7 @@ startRelay() {
SENDER=$(getAddr $RICH)
RES=$(echo qwertyuiop | ${CLIENT_EXE} tx send --amount=100000mycoin \
--sequence=$2 --to=$RELAY_ADDR --name=$RICH)
txSucceeded $? "$RES"
txSucceeded $? "$RES" "$RELAY_ADDR"
if [ $? != 0 ]; then echo "can't pay chain2!"; return 1; fi
# Initialize the relay (register both chains)

View File

@ -20,7 +20,7 @@ test00PreRestart() {
RECV=$(getAddr $POOR)
TX=$(echo qwertyuiop | ${CLIENT_EXE} tx send --amount=992mycoin --sequence=1 --to=$RECV --name=$RICH)
txSucceeded $? "$TX"
txSucceeded $? "$TX" "$RECV"
HASH=$(echo $TX | jq .hash | tr -d \")
TX_HEIGHT=$(echo $TX | jq .height)
@ -37,7 +37,7 @@ test01OnRestart() {
RECV=$(getAddr $POOR)
TX=$(echo qwertyuiop | ${CLIENT_EXE} tx send --amount=10000mycoin --sequence=2 --to=$RECV --name=$RICH)
txSucceeded $? "$TX"
txSucceeded $? "$TX" "$RECV"
if [ $? != 0 ]; then echo "can't make tx!"; return 1; fi
HASH=$(echo $TX | jq .hash | tr -d \")
@ -51,7 +51,7 @@ test01OnRestart() {
# last minute tx just at the block cut-off...
TX=$(echo qwertyuiop | ${CLIENT_EXE} tx send --amount=20000mycoin --sequence=3 --to=$RECV --name=$RICH)
txSucceeded $? "$TX"
txSucceeded $? "$TX" "$RECV"
if [ $? != 0 ]; then echo "can't make second tx!"; return 1; fi
# now we do a restart...