Skip to content

Commit

Permalink
Merge pull request #661 from rinat-enikeev/fix/support_multiple_methods
Browse files Browse the repository at this point in the history
Add support for multiple contract methods with same name
  • Loading branch information
JeneaVranceanu authored Nov 10, 2022
2 parents 173a3ba + bf2dd38 commit c6ec043
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Core/Contract/ContractProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ extension DefaultContractProtocol {
let method = Data.fromHex(method) == nil ? method : method.addHexPrefix().lowercased()

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

// Extra data just appends in the end of parameters data
Expand Down

0 comments on commit c6ec043

Please sign in to comment.