コード例 #1
0
 def _set_deletatable_state(
         db: BaseDB, deletable_state_roots: Iterable[Hash32]) -> None:
     """
     Set deletable_state_roots.
     """
     lookup_key = SchemaV1.make_deletable_state_roots_lookup_key()
     db.set(
         lookup_key,
         rlp.encode(deletable_state_roots, sedes=CountableList(hash32)),
     )
コード例 #2
0
    def _get_deletable_state_roots(db: BaseDB) -> Tuple[Hash32]:
        """
        Return deletable_state_roots.
        """
        lookup_key = SchemaV1.make_deletable_state_roots_lookup_key()
        if not db.exists(lookup_key):
            db.set(
                lookup_key,
                rlp.encode((), sedes=CountableList(hash32)),
            )
        deletable_state_roots = rlp.decode(db[lookup_key],
                                           sedes=CountableList(hash32))

        return deletable_state_roots