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:
Fabian Jahr 2021-04-11 19:52:10 +02:00
parent 2ca5a496c2
commit ba9d288b24
No known key found for this signature in database
GPG Key ID: F13D1E9D890798CD

View File

@ -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