aboutsummaryrefslogtreecommitdiffstats
path: root/test
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-03-12 12:19:09 +0800
commit865923df59963f20ad738c1e141d196f99f20b39 (patch)
tree08152aa4eace0bafd0c61ad28770d8d94279b6d1 /test
parentd71e6191396db2b8e6aab008e4ddce5baefb81d1 (diff)
downloaddexon-865923df59963f20ad738c1e141d196f99f20b39.tar.gz
dexon-865923df59963f20ad738c1e141d196f99f20b39.tar.zst
dexon-865923df59963f20ad738c1e141d196f99f20b39.zip
test: update dmoment with python script (#153)
Diffstat (limited to 'test')
-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