Skip to content

Commit

Permalink
fix: break strong reference cycle between contract and functions (#157)
Browse files Browse the repository at this point in the history
* fix: break strong reference cycle between web3 and its provider

* fix: more retain cycles
  • Loading branch information
koraykoska authored Mar 24, 2023
1 parent beec817 commit ea0225a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/ContractABI/Contract/SolidityFunction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class SolidityConstantFunction: SolidityFunction {
public let inputs: [SolidityFunctionParameter]
public let outputs: [SolidityFunctionParameter]?

public let handler: SolidityFunctionHandler
public unowned let handler: SolidityFunctionHandler

public required init?(abiObject: ABIObject, handler: SolidityFunctionHandler) {
guard abiObject.type == .function, abiObject.stateMutability?.isConstant == true else { return nil }
Expand Down Expand Up @@ -120,7 +120,7 @@ public class SolidityPayableFunction: SolidityFunction {
public let inputs: [SolidityFunctionParameter]
public let outputs: [SolidityFunctionParameter]? = nil

public let handler: SolidityFunctionHandler
public unowned let handler: SolidityFunctionHandler

public required init?(abiObject: ABIObject, handler: SolidityFunctionHandler) {
guard abiObject.type == .function, abiObject.stateMutability == .payable else { return nil }
Expand All @@ -147,7 +147,7 @@ public class SolidityNonPayableFunction: SolidityFunction {
public let inputs: [SolidityFunctionParameter]
public let outputs: [SolidityFunctionParameter]? = nil

public let handler: SolidityFunctionHandler
public unowned let handler: SolidityFunctionHandler

public required init?(abiObject: ABIObject, handler: SolidityFunctionHandler) {
guard abiObject.type == .function, abiObject.stateMutability == .nonpayable else { return nil }
Expand All @@ -171,7 +171,7 @@ public class SolidityNonPayableFunction: SolidityFunction {
/// Represents a function that creates a contract
public class SolidityConstructor {
public let inputs: [SolidityFunctionParameter]
public let handler: SolidityFunctionHandler
public unowned let handler: SolidityFunctionHandler
public let payable: Bool

public init?(abiObject: ABIObject, handler: SolidityFunctionHandler) {
Expand Down

0 comments on commit ea0225a

Please sign in to comment.