-
-
Notifications
You must be signed in to change notification settings - Fork 819
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- refactor print and _abi_encode builtins to use `_has_varargs` - rename _SimpleBuiltinFunction to BuiltinFunction - rename validate_inputs to process_inputs - move abi encoder and decoder tests
- Loading branch information
1 parent
2f5c585
commit 470c294
Showing
11 changed files
with
250 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import pytest | ||
|
||
from vyper import compiler | ||
|
||
valid_list = [ | ||
""" | ||
@external | ||
def foo(x: uint256): | ||
print(x) | ||
""", | ||
""" | ||
@external | ||
def foo(x: Bytes[1]): | ||
print(x) | ||
""", | ||
""" | ||
struct Foo: | ||
x: Bytes[128] | ||
@external | ||
def foo(foo: Foo): | ||
print(foo) | ||
""", | ||
""" | ||
struct Foo: | ||
x: uint256 | ||
@external | ||
def foo(foo: Foo): | ||
print(foo) | ||
""", | ||
""" | ||
BAR: constant(DynArray[uint256, 5]) = [1, 2, 3, 4, 5] | ||
@external | ||
def foo(): | ||
print(BAR) | ||
""", | ||
""" | ||
FOO: constant(uint256) = 1 | ||
BAR: constant(DynArray[uint256, 5]) = [1, 2, 3, 4, 5] | ||
@external | ||
def foo(): | ||
print(FOO, BAR) | ||
""", | ||
] | ||
|
||
|
||
@pytest.mark.parametrize("good_code", valid_list) | ||
def test_print_syntax(good_code): | ||
assert compiler.compile_code(good_code) is not None |
Oops, something went wrong.