def test_unknown_type_exception(bad_code):
    with raises(UnknownType):
        compiler.compile_code(bad_code)
Ejemplo n.º 2
0
def test_varname_validity_success(good_code):
    assert compiler.compile_code(good_code) is not None
def test_rlp_success(good_code):
    assert compiler.compile_code(good_code) is not None
Ejemplo n.º 4
0
def test_extract32_success(good_code):
    assert compiler.compile_code(good_code) is not None
Ejemplo n.º 5
0
def test_chain_success(good_code):
    assert compiler.compile_code(good_code, evm_version="istanbul") is not None
Ejemplo n.º 6
0
def test_as_wei_fail(bad_code, exc):
    with raises(exc):
        compiler.compile_code(bad_code)
Ejemplo n.º 7
0
def test_send_fail(bad_code, exc):
    with pytest.raises(exc):
        compiler.compile_code(bad_code)
Ejemplo n.º 8
0
def test_block_fail(bad_code):

    with raises(TypeMismatchException):
        compiler.compile_code(bad_code)
Ejemplo n.º 9
0
def test_address_code_compile_success(code: str):
    compiler.compile_code(code)
Ejemplo n.º 10
0
def test_missing_return(bad_code):
    with raises(FunctionDeclarationException):
        compiler.compile_code(bad_code)
Ejemplo n.º 11
0
def test_send_fail(bad_code):
    with raises(TypeMismatch):
        compiler.compile_code(bad_code)
Ejemplo n.º 12
0
def test_syntax_exception(bad_code):
    with raises(SyntaxException):
        compiler.compile_code(bad_code)
def test_variable_naming_fail(bad_code):

    with raises(FunctionDeclarationException):
        compiler.compile_code(bad_code)
def test_invalid_type_exception(bad_code):
    with raises(InvalidType):
        compiler.compile_code(bad_code)
Ejemplo n.º 15
0
def test_invalid_type_exception(bad_code):
    with pytest.raises(StructureException):
        compiler.compile_code(bad_code)
Ejemplo n.º 16
0
def test_invalid_literal_exception(bad_code):
    with raises(InvalidLiteral):
        compiler.compile_code(bad_code)
Ejemplo n.º 17
0
def test_as_wei_fail(bad_code):
    with raises(bad_code[1]):
        compiler.compile_code(bad_code[0])
Ejemplo n.º 18
0
def test_byte_string_success(good_code):
    assert compiler.compile_code(good_code) is not None
Ejemplo n.º 19
0
def test_raw_call_fail(bad_code, exc):

    with pytest.raises(exc):
        compiler.compile_code(bad_code)
Ejemplo n.º 20
0
def test_invalid_reference_exception(bad_code):
    with pytest.raises(InvalidReference):
        compiler.compile_code(bad_code)
Ejemplo n.º 21
0
def test_extract32_fail(bad_code):

    with raises(TypeMismatch):
        compiler.compile_code(bad_code)
Ejemplo n.º 22
0
def test_variable_declaration_exception(bad_code):
    with pytest.raises(VariableDeclarationException):
        compiler.compile_code(bad_code)
def test_conditional_return_code(good_code):
    assert compiler.compile_code(good_code) is not None
Ejemplo n.º 24
0
def test_varname_validity_fail(bad_code):
    with raises(FunctionDeclarationException):
        compiler.compile_code(bad_code)
Ejemplo n.º 25
0
def test_ann_assign_success(good_code):
    assert compiler.compile_code(good_code) is not None
Ejemplo n.º 26
0
def test_tuple_return_fail(bad_code):

    with pytest.raises(FunctionDeclarationException):
        compiler.compile_code(bad_code)
def test_type_mismatch_exception(bad_code):
    with raises((SyntaxException, ArgumentException)):
        compiler.compile_code(bad_code)
Ejemplo n.º 28
0
def test_constant_success(good_code):
    assert compiler.compile_code(good_code) is not None
Ejemplo n.º 29
0
def test_block_fail(bad_code):

    with pytest.raises(StructureException):
        compiler.compile_code(bad_code)
Ejemplo n.º 30
0
def test_block_fail(bad_code):

    with pytest.raises(InvalidType):
        compiler.compile_code(bad_code)