def METHOD_NAME(
    chain, bytecode, bytecode_hash, address_with_bytecode
):
    # confirm test setup
    retrieved_bytecode = chain.get_vm().state.get_code(address_with_bytecode)
    assert retrieved_bytecode == bytecode
    assert bytecode == chain.chaindb.db[bytecode_hash]
    # manually remove bytecode from database
    del chain.chaindb.db[bytecode_hash]
    with pytest.raises(MissingBytecode) as excinfo:
        chain.get_vm().state.get_code(address_with_bytecode)
    raised_exception = excinfo.value
    assert raised_exception.missing_code_hash == bytecode_hash