Esempio n. 1
0
    def __init__(self,
                 backend=None,
                 validator=None,
                 normalizer=None,
                 auto_mine_transactions=True,
                 fork_blocks=None):
        if backend is None:
            backend = get_chain_backend()

        if validator is None:
            validator = get_validator()

        if normalizer is None:
            normalizer = get_normalizer_backend()

        if fork_blocks is None:
            fork_blocks = get_default_fork_blocks()

        self.backend = backend
        self.validator = validator
        self.normalizer = normalizer

        self.auto_mine_transactions = auto_mine_transactions

        for fork_name, fork_block in fork_blocks.items():
            self.set_fork_block(fork_name, fork_block)

        self._reset_local_state()
Esempio n. 2
0
    def __init__(self,
                 backend=None,
                 validator=None,
                 normalizer=None,
                 auto_mine_transactions=True,
                 fork_blocks=None):
        if backend is None:
            backend = get_chain_backend()

        if validator is None:
            validator = get_validator()

        if normalizer is None:
            normalizer = get_normalizer_backend()

        self.backend = backend
        self.validator = validator
        self.normalizer = normalizer

        self.auto_mine_transactions = auto_mine_transactions

        if fork_blocks is None:
            fork_blocks = get_default_fork_blocks(self.get_supported_forks())

        unsupported_forks = set(fork_blocks.keys()).difference(self.get_supported_forks())
        if unsupported_forks:
            raise UnknownFork(
                "The following forks are not supported by the backend you are "
                "using: {0}".format(sorted(unsupported_forks))
            )

        for fork_name, fork_block in fork_blocks.items():
            self.set_fork_block(fork_name, fork_block)

        self._reset_local_state()
Esempio n. 3
0
    def __init__(self,
                 backend=None,
                 validator=None,
                 normalizer=None,
                 auto_mine_transactions=True):
        if backend is None:
            backend = get_chain_backend()

        if validator is None:
            validator = get_validator()

        if normalizer is None:
            normalizer = get_normalizer_backend()

        self.backend = backend
        self.validator = validator
        self.normalizer = normalizer

        self.auto_mine_transactions = auto_mine_transactions

        self._reset_local_state()