aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-01-16 11:00:23 +0800
committerGitHub <noreply@github.com>2019-01-16 11:00:23 +0800
commitb823aedb9bb355439538afe0dfb025f3c1943c82 (patch)
tree7d2c9d7a517280dd0edbe01505fd2e05c142d8fc
parent020c8a477578cef3764b54f33d9ca0cf6caf7631 (diff)
downloaddexon-b823aedb9bb355439538afe0dfb025f3c1943c82.tar
dexon-b823aedb9bb355439538afe0dfb025f3c1943c82.tar.gz
dexon-b823aedb9bb355439538afe0dfb025f3c1943c82.tar.bz2
dexon-b823aedb9bb355439538afe0dfb025f3c1943c82.tar.lz
dexon-b823aedb9bb355439538afe0dfb025f3c1943c82.tar.xz
dexon-b823aedb9bb355439538afe0dfb025f3c1943c82.tar.zst
dexon-b823aedb9bb355439538afe0dfb025f3c1943c82.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