From 41378d2384e67de8570644b15ebf65fcb3650c62 Mon Sep 17 00:00:00 2001 From: Franklin Schrans Date: Thu, 17 May 2018 17:44:37 +0100 Subject: [PATCH] Don't include non-public functions in selector --- Sources/IRGen/IULIAContract.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/IRGen/IULIAContract.swift b/Sources/IRGen/IULIAContract.swift index 85f5c258..a45ca857 100644 --- a/Sources/IRGen/IULIAContract.swift +++ b/Sources/IRGen/IULIAContract.swift @@ -34,8 +34,10 @@ struct IULIAContract { let functionsCode = functions.map({ $0.rendered() }).joined(separator: "\n\n").indented(by: 6) + let publicFunctions = functions.filter { $0.functionDeclaration.isPublic } + // Create a function selector, to determine which function is called in the Ethereum transaction. - let functionSelector = IULIAFunctionSelector(functions: functions) + let functionSelector = IULIAFunctionSelector(functions: publicFunctions) let selectorCode = functionSelector.rendered().indented(by: 6) // Generate code for each function in the structs.