Skip to content

Commit 9d787ad

Browse files
author
Alex Vlasov
committed
Merge commit '75b7b916e3a7c04907dd09a119ccc836d5ed325c' into develop
* commit '75b7b916e3a7c04907dd09a119ccc836d5ed325c': Make 'removed' flag optional in EventLog Add publc initializer to EventFilter
2 parents d2b2bcf + 75b7b91 commit 9d787ad

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

web3swift/Contract/Classes/ContractProtocol.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ public struct EventFilter {
6666
}
6767
}
6868
}
69+
70+
public init(fromBlock: Block?, toBlock: Block?,
71+
addresses: [EthereumAddress]? = nil,
72+
parameterFilters: [[EventFilterable]?]? = nil) {
73+
self.fromBlock = fromBlock
74+
self.toBlock = toBlock
75+
self.addresses = addresses
76+
self.parameterFilters = parameterFilters
77+
}
78+
6979
public var fromBlock: Block?
7080
public var toBlock: Block?
7181
public var addresses: [EthereumAddress]?

web3swift/Web3/Classes/Web3+Structures.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public struct EventLog {
130130
guard let ad = json["address"] as? String else {return nil}
131131
guard let d = json["data"] as? String else {return nil}
132132
guard let li = json["logIndex"] as? String else {return nil}
133-
guard let rm = json["removed"] as? Int else {return nil}
133+
let rm = json["removed"] as? Int ?? 0
134134
guard let tpc = json["topics"] as? [String] else {return nil}
135135
guard let addr = EthereumAddress(ad) else {return nil}
136136
address = addr

0 commit comments

Comments
 (0)