Skip to content

Commit ba9d288

Browse files
committed
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.
1 parent 2ca5a49 commit ba9d288

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/functional/rpc_getblockstats.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ def get_stats(self):
4343
def generate_test_data(self, filename):
4444
mocktime = 1525107225
4545
self.nodes[0].setmocktime(mocktime)
46+
self.nodes[0].createwallet(wallet_name='test')
47+
privkey = self.nodes[0].get_deterministic_priv_key().key
48+
self.nodes[0].importprivkey(privkey)
49+
4650
self.generate(self.nodes[0], COINBASE_MATURITY + 1)
4751

4852
address = self.nodes[0].get_deterministic_priv_key().address

0 commit comments

Comments
 (0)