From 4fc2bc2a75e0a5900a0481221f7e48c1f21a4368 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Wed, 16 Jan 2019 11:00:23 +0800 Subject: test: update dmoment with python script (#153) --- test/run_test.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/run_test.sh b/test/run_test.sh index a42e27142..5455dee2b 100755 --- a/test/run_test.sh +++ b/test/run_test.sh @@ -21,8 +21,17 @@ fi rm -f log-latest ln -s $logsdir log-latest -let dmoment=`date +%s`+7 -sed -i "s/\"dMoment\": [0-9]\+,/\"dMoment\": $dmoment,/g" $GENESIS +python << __FILE__ +import re +import time + +with open('$GENESIS', 'r') as f: + data = f.read() + +with open('$GENESIS', 'w') as f: + dMoment = int(time.time()) + 7 + f.write(re.sub('"dMoment": [0-9]+,', '"dMoment": %d,' % dMoment, data)) +__FILE__ # A standalone RPC server for accepting RPC requests. datadir=$PWD/Dexon.rpc -- cgit v1.2.3