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

Method load_cache

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

Source from the content-addressed store, hash-verified

49
50 @classmethod
51 def load_cache(cls, filename):
52 disk_cache = json.loads(open(filename, 'r').read())
53 for k, raw_hex in disk_cache.items():
54 cls.cache[k] = Tx.parse(BytesIO(bytes.fromhex(raw_hex)))
55
56 @classmethod
57 def dump_cache(cls, filename):

Callers 1

setUpClassMethod · 0.45

Calls 2

readMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected