mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 11:27:28 -03:00
Merge 1b51616f2e
into 66aa6a47bd
This commit is contained in:
commit
b437a3a1ad
2 changed files with 10 additions and 10 deletions
|
@ -716,22 +716,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
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue