mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-19 09:53:47 +01:00
test: Fix getblockstats test data generator
The getblockstats RPC functional test is using previously generated test data that is part of the repository. That test data can be regenerated by running the test file with `--gen-test-data` which invokes the `generate_test_data()` function. That function still relied on the old wallet behavior of having a default wallet to work. Because of this the function was broken and this change fixes this. The fact that this was broken did was not noticed previously because the function is not used by the automated test suite by default.
This commit is contained in:
parent
2ca5a496c2
commit
ba9d288b24
@ -43,6 +43,10 @@ class GetblockstatsTest(BitcoinTestFramework):
|
||||
def generate_test_data(self, filename):
|
||||
mocktime = 1525107225
|
||||
self.nodes[0].setmocktime(mocktime)
|
||||
self.nodes[0].createwallet(wallet_name='test')
|
||||
privkey = self.nodes[0].get_deterministic_priv_key().key
|
||||
self.nodes[0].importprivkey(privkey)
|
||||
|
||||
self.generate(self.nodes[0], COINBASE_MATURITY + 1)
|
||||
|
||||
address = self.nodes[0].get_deterministic_priv_key().address
|
||||
|
Loading…
Reference in New Issue
Block a user