mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 05:46:32 +00:00
fix tests
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
killall tendermint
|
||||
killall dummy
|
||||
killall counter
|
||||
rm -rf ~/.tendermint_app
|
||||
|
||||
@@ -29,7 +29,7 @@ function getCode() {
|
||||
function sendTx() {
|
||||
TX=$1
|
||||
if [[ "$GRPC_BROADCAST_TX" == "" ]]; then
|
||||
RESPONSE=`curl -s localhost:46657/broadcast_tx_commit?tx=\"$TX\"`
|
||||
RESPONSE=`curl -s localhost:46657/broadcast_tx_commit?tx=0x$TX`
|
||||
ERROR=`echo $RESPONSE | jq .error`
|
||||
ERROR=$(echo "$ERROR" | tr -d '"') # remove surrounding quotes
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
set -e
|
||||
|
||||
function toHex() {
|
||||
echo -n $1 | hexdump -ve '1/1 "%.2X"'
|
||||
echo -n $1 | hexdump -ve '1/1 "%.2X"' | awk '{print "0x" $0}'
|
||||
|
||||
}
|
||||
|
||||
#####################
|
||||
@@ -13,7 +14,8 @@ TESTNAME=$1
|
||||
# store key value pair
|
||||
KEY="abcd"
|
||||
VALUE="dcba"
|
||||
curl -s 127.0.0.1:46657/broadcast_tx_commit?tx=\"$(toHex $KEY=$VALUE)\"
|
||||
echo $(toHex $KEY=$VALUE)
|
||||
curl -s 127.0.0.1:46657/broadcast_tx_commit?tx=$(toHex $KEY=$VALUE)
|
||||
echo $?
|
||||
echo ""
|
||||
|
||||
@@ -22,8 +24,10 @@ echo ""
|
||||
# test using the tmsp-cli
|
||||
###########################
|
||||
|
||||
echo "... testing query with tmsp-cli"
|
||||
|
||||
# we should be able to look up the key
|
||||
RESPONSE=`tmsp-cli query $KEY`
|
||||
RESPONSE=`tmsp-cli query \"$KEY\"`
|
||||
|
||||
set +e
|
||||
A=`echo $RESPONSE | grep '"exists":true'`
|
||||
@@ -35,7 +39,7 @@ fi
|
||||
set -e
|
||||
|
||||
# we should not be able to look up the value
|
||||
RESPONSE=`tmsp-cli query $VALUE`
|
||||
RESPONSE=`tmsp-cli query \"$VALUE\"`
|
||||
set +e
|
||||
A=`echo $RESPONSE | grep '"exists":true'`
|
||||
if [[ $? == 0 ]]; then
|
||||
@@ -49,8 +53,10 @@ set -e
|
||||
# test using the /tmsp_query
|
||||
#############################
|
||||
|
||||
echo "... testing query with /tmsp_query"
|
||||
|
||||
# we should be able to look up the key
|
||||
RESPONSE=`curl -s 127.0.0.1:46657/tmsp_query?query=\"$(toHex $KEY)\"`
|
||||
RESPONSE=`curl -s 127.0.0.1:46657/tmsp_query?query=$(toHex $KEY)`
|
||||
RESPONSE=`echo $RESPONSE | jq .result[1].result.Data | xxd -r -p`
|
||||
|
||||
set +e
|
||||
|
||||
Reference in New Issue
Block a user