Пример #1
0
 def _get_head_state_root(db: DatabaseAPI) -> Hash32:
     try:
         head_state_root = db[SchemaV1.make_head_state_root_lookup_key()]
     except KeyError:
         raise HeadStateSlotNotFound("No head state slot found")
     return Hash32(head_state_root)
Пример #2
0
 def _add_head_state_root_lookup(self, root: Hash32) -> None:
     """
     Write head state root into the database.
     """
     self.db.set(SchemaV1.make_head_state_root_lookup_key(), root)