Пример #1
0
def test_missing_state_root():
    context = None
    state = FrontierState(MemoryDB(), context, b'\x0f' * 32)
    with pytest.raises(StateRootNotFound):
        state.apply_transaction(None)
Пример #2
0
        return b''
    elif block_number < 0:
        return b''
    elif block_number < self.block_number - 256:
        return b''
    else:
        return keccak(to_bytes(text="{0}".format(block_number)))


def get_prev_hashes_testing(self, last_block_hash, db):
    prev_hashes = []
    return prev_hashes


FrontierStateForTesting = FrontierState.configure(
    __name__='FrontierStateForTesting',
    get_ancestor_hash=get_block_hash_for_testing,
)
HomesteadStateForTesting = HomesteadState.configure(
    __name__='HomesteadStateForTesting',
    get_ancestor_hash=get_block_hash_for_testing,
)
TangerineWhistleStateForTesting = TangerineWhistleState.configure(
    __name__='TangerineWhistleStateForTesting',
    get_ancestor_hash=get_block_hash_for_testing,
)
SpuriousDragonStateForTesting = SpuriousDragonState.configure(
    __name__='SpuriousDragonStateForTesting',
    get_ancestor_hash=get_block_hash_for_testing,
)
ByzantiumStateForTesting = ByzantiumState.configure(
    __name__='ByzantiumStateForTesting',