MCPcopy
hub / github.com/jimmysong/programmingbitcoin / dump_cache

Method dump_cache

code-ch08/tx.py:65–69  ·  view source on GitHub ↗
(cls, filename)

Source from the content-addressed store, hash-verified

63
64 @classmethod
65 def dump_cache(cls, filename):
66 with open(filename, 'w') as f:
67 to_dump = {k: tx.serialize().hex() for k, tx in cls.cache.items()}
68 s = json.dumps(to_dump, sort_keys=True, indent=4)
69 f.write(s)
70
71
72class Tx:

Callers

nothing calls this directly

Calls 2

hexMethod · 0.45
serializeMethod · 0.45

Tested by

no test coverage detected