Skip to content

Commit

Permalink
use different addr
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Jan 4, 2024
1 parent 5910a5d commit 116bb7d
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def bar(): payable
FOO: constant(Foo) = Foo(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF)
@external
def bar(a: uint256, b: Foo = Foo(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF)) -> Foo:
def bar(a: uint256, b: Foo = Foo(0xF5D4020dCA6a62bB1efFcC9212AAF3c9819E30D7)) -> Foo:
return b
@external
Expand All @@ -132,18 +132,15 @@ def faz(a: uint256, b: Foo = FOO) -> Foo:
"""
c = get_contract(code)

assert c.bar(1) == "0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF"
assert (
c.bar(1, "0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF")
== "0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF"
)
addr1 = "0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF"
addr2 = "0xF5D4020dCA6a62bB1efFcC9212AAF3c9819E30D7"

assert c.bar(1) == addr2
assert c.bar(1, addr1) == addr1
assert c.baz(1) is None
assert c.baz(1, "0x0000000000000000000000000000000000000000") is None
assert c.faz(1) == "0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF"
assert (
c.faz(1, "0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF")
== "0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF"
)
assert c.faz(1) == addr1
assert c.faz(1, addr1) == addr1


def test_default_param_internal_function(get_contract):
Expand Down

0 comments on commit 116bb7d

Please sign in to comment.