Skip to content

Commit c6ec043

Browse files
Merge pull request #661 from rinat-enikeev/fix/support_multiple_methods
Add support for multiple contract methods with same name
2 parents 173a3ba + bf2dd38 commit c6ec043

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)