diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-05-03 15:42:24 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-05-03 15:42:58 +0200 |
commit | 35da2aeed7d4000dde93957c3b6e048ab83c4f2b (patch) | |
tree | a92752002f3d152d86446c88a97808594e180f0d /test | |
parent | 22d870016eb630560c0bd6ba911b764ef46fefc9 (diff) | |
parent | 981e586ab833c280170db22eee267803759077ee (diff) |
Merge #10327: [tests] remove import-abort-rescan.py
981e586 [tests] remove import-abort-rescan.py (John Newbery)
Tree-SHA512: 8658d42b5ecdefbb71c55849036ee4e8e113abbc9c549730524009fb6eacc50340ffb7ef99fb35809d4abd6b304d491a618e45ff6ded1990f01f18cbcebf2b12
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/import-abort-rescan.py | 66 | ||||
-rwxr-xr-x | test/functional/test_runner.py | 1 |
2 files changed, 0 insertions, 67 deletions
diff --git a/test/functional/import-abort-rescan.py b/test/functional/import-abort-rescan.py deleted file mode 100755 index ffe45bbb1d..0000000000 --- a/test/functional/import-abort-rescan.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2017 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. -"""Test wallet import RPCs. - -Test rescan behavior of importprivkey when aborted. The test ensures that: -1. The abortrescan command indeed stops the rescan process. -2. Subsequent rescan catches the aborted address UTXO -""" - -from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import (assert_equal, get_rpc_proxy) -from decimal import Decimal -import threading # for bg importprivkey -import time # for sleep - -class ImportAbortRescanTest(BitcoinTestFramework): - def __init__(self): - super().__init__() - self.setup_clean_chain = True - - def run_test(self): - # Generate for BTC - assert_equal(self.nodes[0].getbalance(), 0) - assert_equal(self.nodes[1].getbalance(), 0) - self.nodes[0].generate(300) - assert_equal(self.nodes[1].getbalance(), 0) - # Make blocks with spam to cause rescan delay - for i in range(5): - for j in range(5): - self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 0.1) - self.nodes[0].generate(10) - addr = self.nodes[0].getnewaddress() - privkey = self.nodes[0].dumpprivkey(addr) - self.nodes[0].sendtoaddress(addr, 0.123) - self.nodes[0].generate(10) # mature tx - self.sync_all() - - # Import this address in the background ... - node1ref = get_rpc_proxy(self.nodes[1].url, 1, timeout=600) - importthread = threading.Thread(target=node1ref.importprivkey, args=[privkey]) - importthread.start() - # ... then abort rescan; try a bunch until abortres becomes true, - # because we will start checking before above thread starts processing - for i in range(2000): - time.sleep(0.001) - abortres = self.nodes[1].abortrescan() - if abortres: break - assert abortres # if false, we failed to abort - # import should die soon - for i in range(10): - time.sleep(0.1) - deadres = not importthread.isAlive() - if deadres: break - - assert deadres # if false, importthread did not die soon enough - assert_equal(self.nodes[1].getbalance(), 0.0) - - # Import a different address and let it run - self.nodes[1].importprivkey(self.nodes[0].dumpprivkey(self.nodes[0].getnewaddress())) - # Expect original privkey to now also be discovered and added to balance - assert_equal(self.nodes[1].getbalance(), Decimal("0.123")) - -if __name__ == "__main__": - ImportAbortRescanTest().main() diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 467e1668d1..c87010b0f4 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -110,7 +110,6 @@ BASE_SCRIPTS= [ 'rpcnamedargs.py', 'listsinceblock.py', 'p2p-leaktests.py', - 'import-abort-rescan.py', ] EXTENDED_SCRIPTS = [ |