def __init__(self, db_path: Path = None) -> None: if not db_path: raise TypeError("Please specifiy a valid path for your database.") try: with catch_and_ignore_import_warning(): import plyvel # noqa: F811 except ImportError: raise ImportError( "LevelDB requires the plyvel library which is not available for import." ) self.db_path = db_path self.db = plyvel.DB(str(db_path), create_if_missing=True, error_if_exists=False)
ReceiptNotFound, TransactionNotFound, ) from eth.db.header import BaseHeaderDB, HeaderDB from eth.db.backends.base import ( BaseAtomicDB, BaseDB, ) from eth.db.schema import SchemaV1 from eth.rlp.headers import ( BlockHeader, ) from eth.rlp.receipts import (Receipt) from eth.validation import ( validate_word, ) from eth._warnings import catch_and_ignore_import_warning with catch_and_ignore_import_warning(): import rlp from trie import ( HexaryTrie, ) from eth_utils import ( to_list, to_tuple, ValidationError, ) if TYPE_CHECKING: from eth.rlp.blocks import ( # noqa: F401 BaseBlock, BaseTransaction) class TransactionKey(rlp.Serializable):