aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFabian Jahr <fjahr@protonmail.com>2021-04-11 19:52:10 +0200
committerFabian Jahr <fjahr@protonmail.com>2022-10-23 01:33:41 +0200
commitba9d288b2468f047e5a8e4637dd8749e247ff547 (patch)
treeb70f833ff55ec5df59616de42b5deca3fb3620a1 /test
parent2ca5a496c2f3cbcc63ea15fa05c1658e7f527bbc (diff)
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.
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/rpc_getblockstats.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/functional/rpc_getblockstats.py b/test/functional/rpc_getblockstats.py
index 1372cf95da..21fa4392f9 100755
--- a/test/functional/rpc_getblockstats.py
+++ b/test/functional/rpc_getblockstats.py
@@ -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