mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-03 10:32:05 +00:00
* [cherrypicked] abci-cli: added `PrepareProposal` command to cli (#8656) * Prepare prosal cli * [cherrypicked + fixes] abci-cli: Add `process_proposal` command to abci-cli (#8901) * Add `process_proposal` command to abci-cli * Added process proposal to the 'tutorial' examples * Added entry in CHANGELOG_PENDING.md * Allow empty blocks in PrepareProposal, ProcessProposal, and FinalizeBlock * Fix minimum arguments * Add tests for empty block * Updated abci-cli doc Co-authored-by: Sergio Mena <sergio@informal.systems> Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com> * Addressed @williambanfield's comment Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com> Co-authored-by: Hernán Vanzetto <hernan.vanzetto@gmail.com>
46 lines
931 B
Bash
Executable File
46 lines
931 B
Bash
Executable File
#! /bin/bash
|
|
set -e
|
|
|
|
# Get the root directory.
|
|
export PATH="$GOBIN:$PATH"
|
|
SOURCE="${BASH_SOURCE[0]}"
|
|
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
|
DIR="$( cd -P "$( dirname "$SOURCE" )/../.." && pwd )"
|
|
|
|
# Change into that dir because we expect that.
|
|
cd "$DIR" || exit
|
|
|
|
function testExample() {
|
|
N=$1
|
|
INPUT=$2
|
|
APP="$3 $4"
|
|
|
|
echo "Example $N: $APP"
|
|
$APP &> /dev/null &
|
|
sleep 2
|
|
abci-cli --log_level=error --verbose batch < "$INPUT" > "${INPUT}.out.new"
|
|
killall "$3"
|
|
|
|
pre=$(shasum < "${INPUT}.out")
|
|
post=$(shasum < "${INPUT}.out.new")
|
|
|
|
if [[ "$pre" != "$post" ]]; then
|
|
echo "You broke the tutorial"
|
|
echo "Got:"
|
|
cat "${INPUT}.out.new"
|
|
echo "Expected:"
|
|
cat "${INPUT}.out"
|
|
echo "Diff:"
|
|
diff "${INPUT}.out" "${INPUT}.out.new"
|
|
exit 1
|
|
fi
|
|
|
|
rm "${INPUT}".out.new
|
|
}
|
|
|
|
testExample 1 tests/test_cli/ex1.abci abci-cli kvstore
|
|
testExample 2 tests/test_cli/ex2.abci abci-cli kvstore
|
|
|
|
echo ""
|
|
echo "PASS"
|