Esempio n. 1
0
class ChainProxy(BaseProxy):
    coro_import_block = async_method('import_block')
    coro_validate_chain = async_method('validate_chain')
    get_vm_configuration = sync_method('get_vm_configuration')
    get_vm_class = sync_method('get_vm_class')
    get_vm_class_for_block_number = sync_method(
        'get_vm_class_for_block_number')
Esempio n. 2
0
class ChainDBProxy(BaseProxy):
    coro_get = async_method('get')
    coro_get_block_header_by_hash = async_method('get_block_header_by_hash')
    coro_get_canonical_head = async_method('get_canonical_head')
    coro_get_score = async_method('get_score')
    coro_header_exists = async_method('header_exists')
    coro_get_canonical_block_hash = async_method('get_canonical_block_hash')
    coro_get_canonical_block_header_by_number = async_method(
        'get_canonical_block_header_by_number')
    coro_persist_header = async_method('persist_header')
    coro_persist_block = async_method('persist_block')
    coro_persist_uncles = async_method('persist_uncles')
    coro_persist_trie_data_dict = async_method('persist_trie_data_dict')
    coro_get_block_transactions = async_method('get_block_transactions')
    coro_get_block_uncles = async_method('get_block_uncles')
    coro_get_receipts = async_method('get_receipts')

    get = sync_method('get')
    get_block_header_by_hash = sync_method('get_block_header_by_hash')
    get_canonical_head = sync_method('get_canonical_head')
    get_score = sync_method('get_score')
    header_exists = sync_method('header_exists')
    get_canonical_block_hash = sync_method('get_canonical_block_hash')
    persist_header = sync_method('persist_header')
    persist_uncles = sync_method('persist_uncles')
    persist_trie_data_dict = sync_method('persist_trie_data_dict')
Esempio n. 3
0
class AsyncHeaderChainProxy(BaseProxy, BaseAsyncHeaderChain, BaseHeaderChain):
    @classmethod
    def from_genesis_header(cls,
                            basedb: BaseDB,
                            genesis_header: BlockHeader) -> 'BaseHeaderChain':
        raise NotImplementedError("Chain classes must implement this method")

    @classmethod
    def get_headerdb_class(cls) -> BaseDB:
        raise NotImplementedError("Chain classes must implement this method")

    coro_get_block_header_by_hash = async_method('get_block_header_by_hash')
    coro_get_canonical_block_header_by_number = async_method('get_canonical_block_header_by_number')
    coro_get_canonical_head = async_method('get_canonical_head')
    coro_import_header = async_method('import_header')
    coro_header_exists = async_method('header_exists')

    get_block_header_by_hash = sync_method('get_block_header_by_hash')
    get_canonical_block_header_by_number = sync_method('get_canonical_block_header_by_number')
    get_canonical_head = sync_method('get_canonical_head')
    import_header = sync_method('import_header')
    header_exists = sync_method('header_exists')
Esempio n. 4
0
class AsyncHeaderDBProxy(BaseProxy, BaseAsyncHeaderDB, BaseHeaderDB):
    coro_get_block_header_by_hash = async_method('get_block_header_by_hash')
    coro_get_canonical_block_hash = async_method('get_canonical_block_hash')
    coro_get_canonical_block_header_by_number = async_method(
        'get_canonical_block_header_by_number')
    coro_get_canonical_head = async_method('get_canonical_head')
    coro_get_score = async_method('get_score')
    coro_header_exists = async_method('header_exists')
    coro_get_canonical_block_hash = async_method('get_canonical_block_hash')
    coro_persist_header = async_method('persist_header')
    coro_persist_header_chain = async_method('persist_header_chain')

    get_block_header_by_hash = sync_method('get_block_header_by_hash')
    get_canonical_block_hash = sync_method('get_canonical_block_hash')
    get_canonical_block_header_by_number = sync_method(
        'get_canonical_block_header_by_number')
    get_canonical_head = sync_method('get_canonical_head')
    get_score = sync_method('get_score')
    header_exists = sync_method('header_exists')
    get_canonical_block_hash = sync_method('get_canonical_block_hash')
    persist_header = sync_method('persist_header')
    persist_header_chain = sync_method('persist_header_chain')
Esempio n. 5
0
class ChainProxy(BaseProxy):
    coro_import_block = async_method('import_block')
    get_vm_configuration = sync_method('get_vm_configuration')