mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-26 15:36:19 +01:00
test: improve rogue calls in mining functions
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user