Narrow down the test case.

This commit is contained in:
Kris Nuttycombe 2020-04-14 17:47:29 -06:00
parent a4e8945cfa
commit 59d2a6458d
2 changed files with 9 additions and 7 deletions

View File

@ -5,12 +5,13 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, initialize_chain_clean, \
start_nodes, start_node, connect_nodes_bi, bitcoind_processes
start_nodes, start_node, connect_nodes_bi, bitcoind_processes, \
nuparams, OVERWINTER_BRANCH_ID, SAPLING_BRANCH_ID
import time
FAKE_SPROUT = ['-nuparams=5ba81b19:210', '-nuparams=76b809bb:220']
FAKE_OVERWINTER = ['-nuparams=5ba81b19:10', '-nuparams=76b809bb:220']
FAKE_SPROUT = [nuparams(OVERWINTER_BRANCH_ID, 210), nuparams(SAPLING_BRANCH_ID, 220)]
FAKE_OVERWINTER = [nuparams(OVERWINTER_BRANCH_ID, 10), nuparams(SAPLING_BRANCH_ID, 220)]
class RewindBlockIndexTest (BitcoinTestFramework):

View File

@ -28,7 +28,7 @@ from decimal import Decimal
import logging
HAS_SAPLING = [nuparams(OVERWINTER_BRANCH_ID, 10), nuparams(SAPLING_BRANCH_ID, 15)]
NO_SAPLING = [nuparams(OVERWINTER_BRANCH_ID, 10), nuparams(SAPLING_BRANCH_ID, 100)]
NO_SAPLING = [nuparams(OVERWINTER_BRANCH_ID, 10), nuparams(SAPLING_BRANCH_ID, 80)]
class SaplingRewindTest(BitcoinTestFramework):
def setup_chain(self):
@ -69,7 +69,8 @@ class SaplingRewindTest(BitcoinTestFramework):
self.nodes[0].generate(50) # generate into sapling
expected = self.nodes[0].getbestblockhash()
self.nodes[2].generate(100) # generate more on sprout
# generate blocks into sapling; if this is set to 60, the test passes.
self.nodes[2].generate(80)
self.sync_all()
assert_true(expected != self.nodes[2].getbestblockhash(), "Split chains have not diverged!")
@ -79,9 +80,9 @@ class SaplingRewindTest(BitcoinTestFramework):
self.nodes[2].stop()
bitcoind_processes[2].wait()
# Restart the nodes, reconnect, and sync the network
# Restart the nodes, reconnect, and sync the network. This succeeds if "-reindex" is passed.
logging.info("Reconnecting the network...")
self.nodes[2] = start_node(2, self.options.tmpdir, extra_args=HAS_SAPLING)
self.nodes[2] = start_node(2, self.options.tmpdir, extra_args=HAS_SAPLING) # + ["-reindex"])
connect_nodes_bi(self.nodes,1,2)
connect_nodes_bi(self.nodes,0,2)