Skip to content

Commit bf2dd38

Browse files
committed
add support for multiple contract methods with same name
1 parent 9c9fca4 commit bf2dd38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Core/Contract/ContractProtocol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ extension DefaultContractProtocol {
263263
let method = Data.fromHex(method) == nil ? method : method.addHexPrefix().lowercased()
264264

265265
// MARK: - Encoding ABI Data flow
266-
guard let abiMethod = methods[method]?.first,
266+
guard let abiMethod = methods[method]?.first(where: { $0.inputs.count == parameters.count }),
267267
var encodedData = abiMethod.encodeParameters(parameters) else { return nil }
268268

269269
// Extra data just appends in the end of parameters data

0 commit comments

Comments
 (0)