(self, filename)
| 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): |
no test coverage detected