Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/network/05-mining/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ sleep 3

# Verify it can mine more blocks
assert_success "test_wait_for_log '$LOG_DIR/${CURRENT_TEST}_miner-restart.log' 'Block .* mined' 120" "Should mine blocks after restart"
# A fresh chain can satisfy the new-block log check. Catch a restart that
# loses the existing block count before mining resumes.
RESTART_BLOCK_COUNT=$(modal node inspect --dir ./tmp/miner | sed -n 's/^Total Blocks: \([0-9][0-9]*\).*/\1/p')
[[ "$RESTART_BLOCK_COUNT" =~ ^[0-9]+$ ]] || test_fail "Restarted miner should report a block count"
assert_number "$RESTART_BLOCK_COUNT" ">=" "$BLOCK_COUNT" "Restart should retain blocks mined before shutdown"

# Finalize test
test_finalize
Expand Down
Loading