diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 16069e522f..1cbadf0153 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -725,22 +725,22 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): pass def generate(self, generator, *args, sync_fun=None, **kwargs): - blocks = generator.generate(*args, invalid_call=False, **kwargs) + blocks = generator.generate(*args, called_by_framework=True, **kwargs) sync_fun() if sync_fun else self.sync_all() return blocks def generateblock(self, generator, *args, sync_fun=None, **kwargs): - blocks = generator.generateblock(*args, invalid_call=False, **kwargs) + blocks = generator.generateblock(*args, called_by_framework=True, **kwargs) sync_fun() if sync_fun else self.sync_all() return blocks def generatetoaddress(self, generator, *args, sync_fun=None, **kwargs): - blocks = generator.generatetoaddress(*args, invalid_call=False, **kwargs) + blocks = generator.generatetoaddress(*args, called_by_framework=True, **kwargs) sync_fun() if sync_fun else self.sync_all() return blocks def generatetodescriptor(self, generator, *args, sync_fun=None, **kwargs): - blocks = generator.generatetodescriptor(*args, invalid_call=False, **kwargs) + blocks = generator.generatetodescriptor(*args, called_by_framework=True, **kwargs) sync_fun() if sync_fun else self.sync_all() return blocks diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index d896a421d4..d67b5bc7a5 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -352,16 +352,16 @@ class TestNode(): self.log.debug("TestNode.generate() dispatches `generate` call to `generatetoaddress`") return self.generatetoaddress(nblocks=nblocks, address=self.get_deterministic_priv_key().address, maxtries=maxtries, **kwargs) - def generateblock(self, *args, invalid_call, **kwargs): - assert not invalid_call + def generateblock(self, *args, called_by_framework, **kwargs): + assert called_by_framework, "Direct call of this mining RPC is discouraged. Please use one of the self.generate* methods on the test framework, which sync the nodes to avoid intermittent test issues. You may use sync_fun=self.no_op to disable the sync explicitly." return self.__getattr__('generateblock')(*args, **kwargs) - def generatetoaddress(self, *args, invalid_call, **kwargs): - assert not invalid_call + def generatetoaddress(self, *args, called_by_framework, **kwargs): + assert called_by_framework, "Direct call of this mining RPC is discouraged. Please use one of the self.generate* methods on the test framework, which sync the nodes to avoid intermittent test issues. You may use sync_fun=self.no_op to disable the sync explicitly." return self.__getattr__('generatetoaddress')(*args, **kwargs) - def generatetodescriptor(self, *args, invalid_call, **kwargs): - assert not invalid_call + def generatetodescriptor(self, *args, called_by_framework, **kwargs): + assert called_by_framework, "Direct call of this mining RPC is discouraged. Please use one of the self.generate* methods on the test framework, which sync the nodes to avoid intermittent test issues. You may use sync_fun=self.no_op to disable the sync explicitly." return self.__getattr__('generatetodescriptor')(*args, **kwargs) def setmocktime(self, timestamp):