@@ -266,6 +266,32 @@ def test_functions_error_messages(w3, method, args, expected_message, expected_e
266
266
getattr (contract , method )(* args )
267
267
268
268
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
+
269
295
def test_contract_function_methods (string_contract ):
270
296
set_value_func = string_contract .get_function_by_signature ("setValue(string)" )
271
297
get_value_func = string_contract .get_function_by_signature ("getValue()" )
0 commit comments