Пример #1
0
def test_chaindb_get_block_by_root(chaindb, block):
    chaindb.persist_block(block, block.__class__)
    result_block = chaindb.get_block_by_root(block.root, block.__class__)
    validate_rlp_equal(result_block, block)
Пример #2
0
from eth_utils import (
    replace_exceptions,
    ValidationError,
)

from eth._utils.rlp import (
    validate_rlp_equal,
)


assert_imported_genesis_header_unchanged = replace_exceptions({
    ValidationError: AssertionError,
})(validate_rlp_equal(obj_a_name='genesis header', obj_b_name='imported header'))


assert_mined_block_unchanged = replace_exceptions({
    ValidationError: AssertionError,
})(validate_rlp_equal(obj_a_name='provided block', obj_b_name='executed block'))


assert_headers_eq = replace_exceptions({
    ValidationError: AssertionError,
})(validate_rlp_equal(obj_a_name='expected', obj_b_name='actual'))
Пример #3
0
from eth_utils import (
    replace_exceptions,
    ValidationError,
)

from eth._utils.rlp import (
    validate_rlp_equal, )

assert_mined_block_unchanged = replace_exceptions({
    ValidationError:
    AssertionError,
})(validate_rlp_equal(obj_a_name='provided block',
                      obj_b_name='executed block'))

assert_headers_eq = replace_exceptions({
    ValidationError: AssertionError,
})(validate_rlp_equal(obj_a_name='expected', obj_b_name='actual'))