From 1fac83858a8bbf778272172c4995609d60a75805 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 26 May 2019 18:14:01 +0000 Subject: [PATCH] functional_tests: pop exactly what we need to test before testing --- tests/functional_tests/blockchain.py | 3 ++- tests/functional_tests/cold_signing.py | 3 ++- tests/functional_tests/get_output_distribution.py | 3 ++- tests/functional_tests/mining.py | 3 ++- tests/functional_tests/multisig.py | 3 ++- tests/functional_tests/proofs.py | 3 ++- tests/functional_tests/speed.py | 3 ++- tests/functional_tests/transfer.py | 3 ++- tests/functional_tests/txpool.py | 3 ++- tests/functional_tests/wallet.py | 3 ++- 10 files changed, 20 insertions(+), 10 deletions(-) diff --git a/tests/functional_tests/blockchain.py b/tests/functional_tests/blockchain.py index 92857eae3..324af624a 100755 --- a/tests/functional_tests/blockchain.py +++ b/tests/functional_tests/blockchain.py @@ -53,7 +53,8 @@ class BlockchainTest(): def reset(self): print('Resetting blockchain') daemon = Daemon() - daemon.pop_blocks(1000) + res = daemon.get_height() + daemon.pop_blocks(res.height - 1) daemon.flush_txpool() def _test_generateblocks(self, blocks): diff --git a/tests/functional_tests/cold_signing.py b/tests/functional_tests/cold_signing.py index a722d8927..f915df77a 100755 --- a/tests/functional_tests/cold_signing.py +++ b/tests/functional_tests/cold_signing.py @@ -45,7 +45,8 @@ class ColdSigningTest(): def reset(self): print('Resetting blockchain') daemon = Daemon() - daemon.pop_blocks(1000) + res = daemon.get_height() + daemon.pop_blocks(res.height - 1) daemon.flush_txpool() def create(self, idx): diff --git a/tests/functional_tests/get_output_distribution.py b/tests/functional_tests/get_output_distribution.py index 93822e90a..077b094ba 100755 --- a/tests/functional_tests/get_output_distribution.py +++ b/tests/functional_tests/get_output_distribution.py @@ -44,7 +44,8 @@ class GetOutputDistributionTest(): def reset(self): print('Resetting blockchain') daemon = Daemon() - daemon.pop_blocks(1000) + res = daemon.get_height() + daemon.pop_blocks(res.height - 1) daemon.flush_txpool() def create(self): diff --git a/tests/functional_tests/mining.py b/tests/functional_tests/mining.py index 360f2763d..f1b91e8fc 100755 --- a/tests/functional_tests/mining.py +++ b/tests/functional_tests/mining.py @@ -53,7 +53,8 @@ class MiningTest(): def reset(self): print('Resetting blockchain') daemon = Daemon() - daemon.pop_blocks(1000) + res = daemon.get_height() + daemon.pop_blocks(res.height - 1) daemon.flush_txpool() def create(self): diff --git a/tests/functional_tests/multisig.py b/tests/functional_tests/multisig.py index 7d73a5d71..e0d8b06a4 100755 --- a/tests/functional_tests/multisig.py +++ b/tests/functional_tests/multisig.py @@ -81,7 +81,8 @@ class MultisigTest(): def reset(self): print('Resetting blockchain') daemon = Daemon() - daemon.pop_blocks(1000) + res = daemon.get_height() + daemon.pop_blocks(res.height - 1) daemon.flush_txpool() def mine(self, address, blocks): diff --git a/tests/functional_tests/proofs.py b/tests/functional_tests/proofs.py index f443ba795..7beb3ec6e 100755 --- a/tests/functional_tests/proofs.py +++ b/tests/functional_tests/proofs.py @@ -50,7 +50,8 @@ class ProofsTest(): def reset(self): print('Resetting blockchain') daemon = Daemon() - daemon.pop_blocks(1000) + res = daemon.get_height() + daemon.pop_blocks(res.height - 1) daemon.flush_txpool() def mine(self, address, blocks): diff --git a/tests/functional_tests/speed.py b/tests/functional_tests/speed.py index 5858c5803..591c98ec1 100755 --- a/tests/functional_tests/speed.py +++ b/tests/functional_tests/speed.py @@ -50,7 +50,8 @@ class SpeedTest(): def reset(self): print 'Resetting blockchain' daemon = Daemon() - daemon.pop_blocks(1000) + res = daemon.get_height() + daemon.pop_blocks(res.height - 1) daemon.flush_txpool() def run_test(self): diff --git a/tests/functional_tests/transfer.py b/tests/functional_tests/transfer.py index baefd033e..9cb03741f 100755 --- a/tests/functional_tests/transfer.py +++ b/tests/functional_tests/transfer.py @@ -56,7 +56,8 @@ class TransferTest(): def reset(self): print('Resetting blockchain') daemon = Daemon() - daemon.pop_blocks(1000) + res = daemon.get_height() + daemon.pop_blocks(res.height - 1) daemon.flush_txpool() def create(self): diff --git a/tests/functional_tests/txpool.py b/tests/functional_tests/txpool.py index fd74ae129..27ae89764 100755 --- a/tests/functional_tests/txpool.py +++ b/tests/functional_tests/txpool.py @@ -46,7 +46,8 @@ class TransferTest(): def reset(self): print('Resetting blockchain') daemon = Daemon() - daemon.pop_blocks(1000) + res = daemon.get_height() + daemon.pop_blocks(res.height - 1) daemon.flush_txpool() def create(self): diff --git a/tests/functional_tests/wallet.py b/tests/functional_tests/wallet.py index 2240f96ec..85f6a4955 100755 --- a/tests/functional_tests/wallet.py +++ b/tests/functional_tests/wallet.py @@ -74,7 +74,8 @@ class WalletTest(): def reset(self): print('Resetting blockchain') daemon = Daemon() - daemon.pop_blocks(1000) + res = daemon.get_height() + daemon.pop_blocks(res.height - 1) daemon.flush_txpool() def create(self):