(cls, filename)
| 55 | |
| 56 | @classmethod |
| 57 | def dump_cache(cls, filename): |
| 58 | with open(filename, 'w') as f: |
| 59 | to_dump = {k: tx.serialize().hex() for k, tx in cls.cache.items()} |
| 60 | s = json.dumps(to_dump, sort_keys=True, indent=4) |
| 61 | f.write(s) |
| 62 | |
| 63 | |
| 64 | # tag::source1[] |
no test coverage detected