Test reading back counter tx
This commit is contained in:
parent
c6c5e34c3a
commit
8003034bbb
|
@ -30,8 +30,8 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
type CounterTx struct {
|
type CounterTx struct {
|
||||||
Valid bool
|
Valid bool `json:"valid"`
|
||||||
Fee types.Coins
|
Fee types.Coins `json:"fee"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCounterTx(valid bool, fee types.Coins) basecoin.Tx {
|
func NewCounterTx(valid bool, fee types.Coins) basecoin.Tx {
|
||||||
|
|
|
@ -72,21 +72,17 @@ test03AddCount() {
|
||||||
|
|
||||||
checkCounter "1" "10"
|
checkCounter "1" "10"
|
||||||
|
|
||||||
# FIXME: cannot load apptx properly.
|
|
||||||
# Look at the stack trace
|
|
||||||
# This cannot be fixed with the current ugly apptx structure...
|
|
||||||
# Leave for refactoring
|
|
||||||
|
|
||||||
# make sure tx is indexed
|
# make sure tx is indexed
|
||||||
# echo hash $HASH
|
TX=$(${CLIENT_EXE} query tx $HASH --trace)
|
||||||
# TX=$(${CLIENT_EXE} query tx $HASH --trace)
|
if assertTrue "found tx" $?; then
|
||||||
# echo tx $TX
|
assertEquals "proper height" $TX_HEIGHT $(echo $TX | jq .height)
|
||||||
# if [-z assertTrue "found tx" $?]; then
|
assertEquals "type=sig" '"sig"' $(echo $TX | jq .data.type)
|
||||||
# assertEquals "proper height" $TX_HEIGHT $(echo $TX | jq .height)
|
CTX=$(echo $TX | jq .data.data.tx)
|
||||||
# assertEquals "type=app" '"app"' $(echo $TX | jq .data.type)
|
assertEquals "type=chain" '"chain"' $(echo $CTX | jq .type)
|
||||||
# assertEquals "proper sender" "\"$SENDER\"" $(echo $TX | jq .data.data.input.address)
|
CNTX=$(echo $CTX | jq .data.tx)
|
||||||
# fi
|
assertEquals "type=cntr/count" '"cntr/count"' $(echo $CNTX | jq .type)
|
||||||
# echo $TX
|
assertEquals "proper fee" "10" $(echo $CNTX | jq .data.fee[0].amount)
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Load common then run these tests with shunit2!
|
# Load common then run these tests with shunit2!
|
||||||
|
|
Loading…
Reference in New Issue