def __init__(self, chaindb: AsyncChainDB, header: BlockHeader=None) -> None: if not self.vms_by_range: raise ValueError( "The Chain class cannot be instantiated with an empty `vms_by_range`" ) self.chaindb = chaindb # type: AsyncChainDB self.header = header if self.header is None: self.header = self.create_header_from_parent(self.get_canonical_head()) if self.gas_estimator is None: self.gas_estimator = get_gas_estimator()
def __init__(self, base_db: BaseDB) -> None: if not self.vm_configuration: raise ValueError( "The Chain class cannot be instantiated with an empty `vm_configuration`" ) else: validate_vm_configuration(self.vm_configuration) self.chaindb = self.get_chaindb_class()(base_db) self.headerdb = HeaderDB(base_db) if self.gas_estimator is None: self.gas_estimator = get_gas_estimator() # type: ignore
def __init__(self, chaindb: AsyncChainDB, header=None): if not self.vms_by_range: raise ValueError( "The Chain class cannot be instantiated with an empty `vms_by_range`" ) self.chaindb = chaindb # type: AsyncChainDB self.header = header if self.header is None: self.header = self.create_header_from_parent(self.get_canonical_head()) if self.gas_estimator is None: self.gas_estimator = get_gas_estimator()
def __init__(self, chaindb: BaseChainDB, header: BlockHeader=None) -> None: if not self.vm_configuration: raise ValueError( "The Chain class cannot be instantiated with an empty `vm_configuration`" ) else: validate_vm_configuration(self.vm_configuration) self.chaindb = chaindb self.header = header if self.header is None: self.header = self.create_header_from_parent(self.get_canonical_head()) if self.gas_estimator is None: self.gas_estimator = get_gas_estimator() # type: ignore