aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-01-16 11:00:23 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 13:50:01 +0800
commit7583ccb96e37b0ba72c7e7f01ddf79cb80877514 (patch)
tree4476594b3bab38ab4284f3fb5a41d42968e02be7
parent822aea617fd7508db5c674e033428f76df548535 (diff)
downloaddexon-7583ccb96e37b0ba72c7e7f01ddf79cb80877514.tar.gz
dexon-7583ccb96e37b0ba72c7e7f01ddf79cb80877514.tar.zst
dexon-7583ccb96e37b0ba72c7e7f01ddf79cb80877514.zip
test: update dmoment with python script (#153)
-rwxr-xr-xtest/run_test.sh13
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