diff --git a/glide.lock b/glide.lock index b13de02249..a586e14360 100644 --- a/glide.lock +++ b/glide.lock @@ -133,7 +133,7 @@ imports: - data - data/base58 - name: github.com/tendermint/light-client - version: fd166a86ccc2e4d2abcf2e765e70f341b7676d89 + version: fcf4e411583135a1900157b8b0274c41e20ea3a1 subpackages: - certifiers - certifiers/client diff --git a/modules/coin/commands/query.go b/modules/coin/commands/query.go index e77614bead..1faabb6214 100644 --- a/modules/coin/commands/query.go +++ b/modules/coin/commands/query.go @@ -28,6 +28,7 @@ func accountQueryCmd(cmd *cobra.Command, args []string) error { if err != nil { return err } + act = coin.ChainAddr(act) key := stack.PrefixedKey(coin.NameCoin, act.Bytes()) acc := coin.Account{} diff --git a/tests/cli/ibc.sh b/tests/cli/ibc.sh index c9a86382a3..849516cf20 100755 --- a/tests/cli/ibc.sh +++ b/tests/cli/ibc.sh @@ -205,52 +205,52 @@ test04SendIBCPacket() { assertFalse "line=${LINENO}, no relay running" "BC_HOME=${CLIENT_2} ${CLIENT_EXE} query account $RECV" } -# test05ReceiveIBCPacket() { -# export BC_HOME=${CLIENT_2} +test05ReceiveIBCPacket() { + export BC_HOME=${CLIENT_2} -# # make some credit, so we can accept the packet -# TX=$(echo qwertyuiop | ${CLIENT_EXE} tx credit --amount=60006mycoin --to=$CHAIN_1:: --name=$RICH) -# txSucceeded $? "$TX" "${CHAIN_ID_2}::${RECV}" -# checkAccount $CHAIN_2:: "60006" + # make some credit, so we can accept the packet + TX=$(echo qwertyuiop | ${CLIENT_EXE} tx credit --amount=60006mycoin --to=$CHAIN_ID_1:: --name=$RICH) + txSucceeded $? "$TX" "${CHAIN_ID_1}::" + checkAccount $CHAIN_ID_1:: "60006" -# # now, we try to post it.... (this is PACKET from last test) + # now, we try to post it.... (this is PACKET from last test) -# # get the seed and post it -# SRC_HEIGHT=$(echo $PACKET | jq .src_height) -# # FIXME: this should auto-update on proofs... -# ${CLIENT_EXE} seeds update --height=$SRC_HEIGHT --home=${CLIENT_1} > /dev/null -# assertTrue "line=${LINENO}, update seed failed" $? + # get the seed and post it + SRC_HEIGHT=$(echo $PACKET | jq .src_height) + # FIXME: this should auto-update on proofs... + ${CLIENT_EXE} seeds update --height=$SRC_HEIGHT --home=${CLIENT_1} > /dev/null + assertTrue "line=${LINENO}, update seed failed" $? -# PACKET_SEED="$BASE_DIR_1/packet_seed.json" -# ${CLIENT_EXE} seeds export $PACKET_SEED --home=${CLIENT_1} #--height=$SRC_HEIGHT -# assertTrue "line=${LINENO}, export seed failed" $? -# echo "**** SEED ****" -# cat $PACKET_SEED | jq . + PACKET_SEED="$BASE_DIR_1/packet_seed.json" + ${CLIENT_EXE} seeds export $PACKET_SEED --home=${CLIENT_1} #--height=$SRC_HEIGHT + assertTrue "line=${LINENO}, export seed failed" $? + # echo "**** SEED ****" + # cat $PACKET_SEED | jq . -# TX=$(echo qwertyuiop | ${CLIENT_EXE} tx ibc-update \ -# --seed=${PACKET_SEED} --name=$POOR) -# txSucceeded $? "$TX" "prepare packet chain1 on chain 2" -# # an example to quit early if there is no point in more tests -# if [ $? != 0 ]; then echo "aborting!"; return 1; fi + TX=$(echo qwertyuiop | ${CLIENT_EXE} tx ibc-update \ + --seed=${PACKET_SEED} --name=$POOR) + txSucceeded $? "$TX" "prepare packet chain1 on chain 2" + # an example to quit early if there is no point in more tests + if [ $? != 0 ]; then echo "aborting!"; return 1; fi -# # write the packet to the file -# POST_PACKET="$BASE_DIR_1/post_packet.json" -# echo $PACKET > $POST_PACKET -# echo "**** POST ****" -# cat $POST_PACKET | jq . + # write the packet to the file + POST_PACKET="$BASE_DIR_1/post_packet.json" + echo $PACKET > $POST_PACKET + # echo "**** POST ****" + # cat $POST_PACKET | jq . -# # post it as a tx (cross-fingers) -# TX=$(echo qwertyuiop | ${CLIENT_EXE} tx ibc-post \ -# --packet=${POST_PACKET} --name=$POOR) -# txSucceeded $? "$TX" "post packet from chain1 on chain 2" + # post it as a tx (cross-fingers) + TX=$(echo qwertyuiop | ${CLIENT_EXE} tx ibc-post \ + --packet=${POST_PACKET} --name=$POOR) + txSucceeded $? "$TX" "post packet from chain1 on chain 2" -# # TODO: more queries on stuff... + # TODO: more queries on stuff... -# # look, we wrote a packet -# PACKETS=$(${CLIENT_EXE} query ibc packets --from=$CHAIN_ID_1) -# assertTrue "line=${LINENO}, packets query" $? -# assertEquals "line=${LINENO}, packet count" 1 $(echo $PACKETS | jq .data) -# } + # look, we wrote a packet + PACKETS=$(${CLIENT_EXE} query ibc packets --from=$CHAIN_ID_1) + assertTrue "line=${LINENO}, packets query" $? + assertEquals "line=${LINENO}, packet count" 1 $(echo $PACKETS | jq .data) +} # XXX Ex Usage: assertNewHeight $MSG $SEED_1 $SEED_2