MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / load_test_data

Method load_test_data

test/functional/rpc_getblockstats.py:84–96  ·  view source on GitHub ↗
(self, filename)

Source from the content-addressed store, hash-verified

82 json.dump(to_dump, f, sort_keys=True, indent=2)
83
84 def load_test_data(self, filename):
85 with open(filename, 'r') as f:
86 d = json.load(f)
87 blocks = d['blocks']
88 mocktime = d['mocktime']
89 self.expected_stats = d['stats']
90
91 # Set the timestamps from the file so that the nodes can get out of Initial Block Download
92 self.nodes[0].setmocktime(mocktime)
93 self.sync_all()
94
95 for b in blocks:
96 self.nodes[0].submitblock(b)
97
98
99 def run_test(self):

Callers 1

run_testMethod · 0.95

Calls 3

setmocktimeMethod · 0.80
sync_allMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected