Ejemplo n.º 1
0
 def __delitem__(self, key: bytes) -> None:
     hashed_slot = self._decode_key(key)
     write_trie = self._get_write_trie()
     try:
         del write_trie[hashed_slot]
     except trie_exceptions.MissingTrieNode as exc:
         raise MissingStorageTrieNode(
             exc.missing_node_hash,
             self._starting_root_hash,
             exc.requested_key,
             self._address,
         ) from exc
Ejemplo n.º 2
0
 def __getitem__(self, key: bytes) -> bytes:
     hashed_slot = self._decode_key(key)
     read_trie = self._get_read_trie()
     try:
         return read_trie[hashed_slot]
     except trie_exceptions.MissingTrieNode as exc:
         raise MissingStorageTrieNode(
             exc.missing_node_hash,
             self._starting_root_hash,
             exc.requested_key,
             exc.prefix,
             self._address,
         ) from exc