Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
z80dev committed Feb 9, 2024
1 parent 8f62b15 commit 909d1d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 3 additions & 1 deletion dasy/parser/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ def parse_declaration(var, typ, value=None, attrs: Set[str] = set()):
def parse_defvars(expr):
if isinstance(expr[1], models.Keyword):
attrs = {expr[1].name}
return [parse_declaration(var, typ, attrs=attrs) for var, typ in pairwise(expr[2:])]
return [
parse_declaration(var, typ, attrs=attrs) for var, typ in pairwise(expr[2:])
]
return [parse_declaration(var, typ) for var, typ in pairwise(expr[1:])]


Expand Down
15 changes: 9 additions & 6 deletions tests/test_dasy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from boa.vyper.contract import VyperContract
import boa


def test_compare_venom_vyper():
c = compile("examples/venom.dasy")
v = boa.load("examples/venom_comp.vy")
Expand All @@ -10,6 +11,7 @@ def test_compare_venom_vyper():
assert contract.retOne() == 1
assert contract.addTwoNums(1, 2) == 3


# def test_merkle():
# leaf3 = 0xdca3326ad7e8121bf9cf9c12333e6b2271abe823ec9edfe42f813b1e768fa57b
# leaf_bytes = leaf3.to_bytes(32, 'big')
Expand All @@ -33,6 +35,7 @@ def test_compare_venom_vyper():

# assert vyper_merkle.verify([in1, in2], in3, leaf)


def compile_src(src: str, *args) -> VyperContract:
ast = dasy.compile(src, include_abi=True)
return VyperContract(ast, *args)
Expand Down Expand Up @@ -140,9 +143,9 @@ def test_if_expr():
def test_struct():
c = compile_src(
"""
(pragma :evm-version "cancun")
(defstruct Person
age :uint256)
age :uint256
name (string 100))
(defvars person (public Person))
(defn __init__ [] :external
(set (. self/person age) 12))
Expand All @@ -155,8 +158,8 @@ def test_struct():
"""
)
assert c.person()[0] == 12
assert c.memoryPerson() == (10,)
# assert c.literalPerson() == (100,"Foo")
assert c.memoryPerson() == (10, "")
assert c.literalPerson() == (100, "Foo")


def test_arrays():
Expand Down Expand Up @@ -400,8 +403,8 @@ def test_return_variable():
(defn foo [] :uint256 :external
(def x :uint256 5)
(return x))
""")

"""
)


def test_usub():
Expand Down

0 comments on commit 909d1d3

Please sign in to comment.