Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/functional/syntax/test_abi_encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ def foo(x: uint256) -> Bytes[36]:
""",
TypeMismatch, # len(method_id) must be greater than 3
),
(
"""
@external
def foo() -> Bytes[132]:
x: uint256 = 1
y: Bytes[32] = b"234"
return abi_encode(x, y, method_id=b"")
""",
InvalidLiteral, # len(method_id) must be 4
),
]


Expand Down Expand Up @@ -98,6 +108,11 @@ def foo(x: Bytes[1]) -> Bytes[68]:
return _abi_encode(x, ensure_tuple=False, method_id=0x12345678)
""",
"""
@external
def foo(x: Bytes[1]) -> Bytes[68]:
return _abi_encode(x, ensure_tuple=False, method_id=b"1234")
""",
"""
BAR: constant(DynArray[uint256, 5]) = [1, 2, 3, 4, 5]

@external
Expand Down