diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-01-16 11:00:23 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:56 +0800 |
commit | 4fc2bc2a75e0a5900a0481221f7e48c1f21a4368 (patch) | |
tree | be6a6f344dc9ba611a77b160195268ab5e65ded8 | |
parent | 174edb614cd9a9600e818fc105b9c8f566eff0ab (diff) | |
download | dexon-4fc2bc2a75e0a5900a0481221f7e48c1f21a4368.tar.gz dexon-4fc2bc2a75e0a5900a0481221f7e48c1f21a4368.tar.zst dexon-4fc2bc2a75e0a5900a0481221f7e48c1f21a4368.zip |
test: update dmoment with python script (#153)
-rwxr-xr-x | test/run_test.sh | 13 |
1 files 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 |