diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-11-25 17:11:32 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-11-25 17:11:32 +0100 |
commit | a905ed1a61da2fc278f4bc9fa523e81604f61a5e (patch) | |
tree | b42f0ee36c00d52e22aa7f9f38efdad04be35881 | |
parent | 681b25e3cd7d084f642693152322ed9a40f33ba0 (diff) | |
download | bitcoin-a905ed1a61da2fc278f4bc9fa523e81604f61a5e.tar.xz |
test: refactor: use `set_node_times` helper in wallet_transactiontime_rescan.py
-rwxr-xr-x | test/functional/wallet_transactiontime_rescan.py | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/test/functional/wallet_transactiontime_rescan.py b/test/functional/wallet_transactiontime_rescan.py index d26d1b9bfa..0e9c9710ec 100755 --- a/test/functional/wallet_transactiontime_rescan.py +++ b/test/functional/wallet_transactiontime_rescan.py @@ -10,7 +10,8 @@ import time from test_framework.blocktools import COINBASE_MATURITY from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( - assert_equal + assert_equal, + set_node_times, ) @@ -35,9 +36,7 @@ class TransactionTimeRescanTest(BitcoinTestFramework): # synchronize nodes and time self.sync_all() - minernode.setmocktime(cur_time) - usernode.setmocktime(cur_time) - restorenode.setmocktime(cur_time) + set_node_times(self.nodes, cur_time) # prepare miner wallet minernode.createwallet(wallet_name='default') @@ -68,9 +67,7 @@ class TransactionTimeRescanTest(BitcoinTestFramework): # synchronize nodes and time self.sync_all() - minernode.setmocktime(cur_time + ten_days) - usernode.setmocktime(cur_time + ten_days) - restorenode.setmocktime(cur_time + ten_days) + set_node_times(self.nodes, cur_time + ten_days) # send 10 btc to user's first watch-only address self.log.info('Send 10 btc to user') miner_wallet.sendtoaddress(wo1, 10) @@ -81,9 +78,7 @@ class TransactionTimeRescanTest(BitcoinTestFramework): # synchronize nodes and time self.sync_all() - minernode.setmocktime(cur_time + ten_days + ten_days) - usernode.setmocktime(cur_time + ten_days + ten_days) - restorenode.setmocktime(cur_time + ten_days + ten_days) + set_node_times(self.nodes, cur_time + ten_days + ten_days) # send 5 btc to our second watch-only address self.log.info('Send 5 btc to user') miner_wallet.sendtoaddress(wo2, 5) @@ -94,9 +89,7 @@ class TransactionTimeRescanTest(BitcoinTestFramework): # synchronize nodes and time self.sync_all() - minernode.setmocktime(cur_time + ten_days + ten_days + ten_days) - usernode.setmocktime(cur_time + ten_days + ten_days + ten_days) - restorenode.setmocktime(cur_time + ten_days + ten_days + ten_days) + set_node_times(self.nodes, cur_time + ten_days + ten_days + ten_days) # send 1 btc to our third watch-only address self.log.info('Send 1 btc to user') miner_wallet.sendtoaddress(wo3, 1) |