示例#1
0
文件: base.py 项目: 9nix00/py-evm
    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()
示例#2
0
文件: base.py 项目: zixuanzh/py-evm
    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
示例#3
0
文件: chain.py 项目: firefox0x/py-evm
    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()
示例#4
0
    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