MCPcopy Index your code
hub / github.com/jimmysong/programmingbitcoin / dump_cache

Method dump_cache

code-ch13/tx.py:57–61  ·  view source on GitHub ↗
(cls, filename)

Source from the content-addressed store, hash-verified

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[]

Callers 1

tearDownClassMethod · 0.45

Calls 2

hexMethod · 0.45
serializeMethod · 0.45

Tested by

no test coverage detected