check ipld-eth-db in test
Some checks failed
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (push) Has been cancelled
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Has been cancelled

This commit is contained in:
Roy Crihfield 2024-06-26 22:00:38 +08:00
parent 66435eb60c
commit e20ad560d0

View File

@ -56,7 +56,7 @@ test_deployment_spec=$CERC_REPO_BASE_DIR/test-deployment-spec.yml
$SO_COMMAND --stack ${stack_name} deploy init --output $test_deployment_spec $SO_COMMAND --stack ${stack_name} deploy init --output $test_deployment_spec
# Check the file now exists # Check the file now exists
if [ ! -f "$test_deployment_spec" ]; then if [ ! -f "$test_deployment_spec" ]; then
test_fail_exit "deploy init test: spec fille not present" test_fail_exit "deploy init test: spec file not present"
fi fi
echo "deploy init test: passed" echo "deploy init test: passed"
@ -109,18 +109,24 @@ log_info "Results of block height queries:"
echo "Initial block height: $initial_block_number" echo "Initial block height: $initial_block_number"
echo "Subsequent block height: $subsequent_block_number" echo "Subsequent block height: $subsequent_block_number"
# Block height difference should be between 1 and some small number dump_logs () {
if [[ $block_number_difference -gt 1 && $block_number_difference -lt 100 ]]; then echo "Test failed. Logs from stack:"
echo "Test passed"
test_result=0
else
echo "Test failed: block numbers were ${initial_block_number} and ${subsequent_block_number}"
echo "Logs from stack:"
$SO_COMMAND deployment --dir $test_deployment_dir logs $SO_COMMAND deployment --dir $test_deployment_dir logs
test_result=1 }
fi trap dump_logs ERR
$SO_COMMAND deployment --dir $test_deployment_dir stop --delete-volumes
log_info "Removing cloned repositories" # Block height difference should be between 1 and some small number
rm -rf $CERC_REPO_BASE_DIR [[ $block_number_difference -gt 1 && $block_number_difference -lt 100 ]]
log_info "Test finished"
exit $test_result # Check that the block hash is present in the ipld-eth-db
echo "Querying ipld-eth-db for block number $subsequent_block_number"
block_hash_query="SELECT block_hash from eth.header_cids where block_number = $subsequent_block_number"
block_hash=$(
$SO_COMMAND deployment --dir $test_deployment_dir exec ipld-eth-db \
"psql -qtA -U vdbm -c '$block_hash_query' cerc_testing"
)
echo "Block hash in ipld-eth-db: $block_hash"
[[ -n $block_hash ]]
echo "Test passed."