diff --git a/boa/contracts/abi/abi_contract.py b/boa/contracts/abi/abi_contract.py index 9f22b051..ed80084f 100644 --- a/boa/contracts/abi/abi_contract.py +++ b/boa/contracts/abi/abi_contract.py @@ -151,7 +151,15 @@ def __init__(self, functions: list[ABIFunction]): def name(self) -> str: return self.functions[0].name - def __call__(self, *args, disambiguate_signature=None, **kwargs): + def __call__( + self, + *args, + value=0, + gas=None, + sender=None, + disambiguate_signature=None, + **kwargs, + ): """ Call the function that matches the given arguments. :raises Exception: if a single function is not found @@ -166,7 +174,7 @@ def __call__(self, *args, disambiguate_signature=None, **kwargs): match matches: case [function]: - return function(*args, **kwargs) + return function(*args, value=value, gas=gas, sender=sender, **kwargs) case []: raise Exception( f"Could not find matching {self.name} function for given arguments." diff --git a/tests/integration/fork/test_abi_contract.py b/tests/integration/fork/test_abi_contract.py index c310b35b..9c20440d 100644 --- a/tests/integration/fork/test_abi_contract.py +++ b/tests/integration/fork/test_abi_contract.py @@ -1,6 +1,6 @@ import hypothesis.strategies as st import pytest -from hypothesis import given, example +from hypothesis import given import boa from boa import BoaError @@ -108,6 +108,7 @@ def test_stableswap_factory_ng(stableswap_factory_ng): def test_balances(addr, balance, crvusd): assert crvusd.balanceOf(addr) == balance + # test write 0 to fresh fork state def test_fork_write0(crvusd): n = balances[account_a] diff --git a/tests/unitary/test_abi.py b/tests/unitary/test_abi.py index 202955b3..6d079898 100644 --- a/tests/unitary/test_abi.py +++ b/tests/unitary/test_abi.py @@ -130,6 +130,7 @@ def test(a: uint128 = 0, b: uint128 = 0) -> uint128: assert c.test(a=1) == 1 assert c.test(1, 2) == 3 assert c.test(a=1, b=2) == 3 + assert c.test(a=1, b=2, value=0, gas=None) == 3 with pytest.raises(Exception) as exc_info: c.test(1, 2, 3)