Skip to content

Commit 747ceab

Browse files
committed
Test for issue ethereum#3482
1 parent 9672113 commit 747ceab

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/core/contracts/test_contract_ambiguous_functions.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,32 @@ def test_functions_error_messages(w3, method, args, expected_message, expected_e
266266
getattr(contract, method)(*args)
267267

268268

269+
def test_ambiguous_functions_abi_element_identifier(w3):
270+
abi = [
271+
{
272+
"name": "isValidSignature",
273+
"type": "function",
274+
"inputs": [
275+
{"internalType": "bytes32", "name": "id", "type": "bytes32"},
276+
{"internalType": "bytes", "name": "id", "type": "bytes"},
277+
],
278+
},
279+
{
280+
"name": "isValidSignature",
281+
"type": "function",
282+
"inputs": [
283+
{"internalType": "bytes", "name": "id", "type": "bytes"},
284+
{"internalType": "bytes", "name": "id", "type": "bytes"},
285+
],
286+
},
287+
]
288+
contract = w3.eth.contract(abi=abi)
289+
fn_bytes = contract.get_function_by_signature("isValidSignature(bytes,bytes)")
290+
assert fn_bytes.abi_element_identifier == "isValidSignature(bytes,bytes)"
291+
fn_bytes32 = contract.get_function_by_signature("isValidSignature(bytes32,bytes)")
292+
assert fn_bytes32.abi_element_identifier == "isValidSignature(bytes32,bytes)"
293+
294+
269295
def test_contract_function_methods(string_contract):
270296
set_value_func = string_contract.get_function_by_signature("setValue(string)")
271297
get_value_func = string_contract.get_function_by_signature("getValue()")

0 commit comments

Comments
 (0)