Browse Source

test-cli/scripts: use setmocktime.

TIL about setmocktime.

Suggested-by: Gavin <gavinandresen@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 9 years ago
parent
commit
57f0c3b38c
  1. 3
      test-cli/scripts/test.sh

3
test-cli/scripts/test.sh

@ -38,10 +38,9 @@ send_after_delay()
# Bitcoin bumps block times so that blocks are valid.
TIME=$($CLI getblock $($CLI getbestblockhash) | sed -n 's/.*"time" *: *\([0-9]*\),/\1/p')
echo Waiting for CSV timeout $(( $TIME + $TEST_LOCKTIME - $(date -u +%s) )) seconds. >&2
$CLI setmocktime $(($TIME + $TEST_LOCKTIME))
# Move median time, for sure!
while [ `date -u +%s` -lt $(($TIME + $TEST_LOCKTIME)) ]; do sleep 1; done
for i in `seq 6`; do scripts/generate-block.sh; done
for tx; do

Loading…
Cancel
Save