Skip to content

Commit 60560c3

Browse files
fix: swiftlint issues in ENSReverseRegistrar.swift
1 parent d3a427b commit 60560c3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/web3swift/Utils/ENS/ENSReverseRegistrar.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ public extension ENS {
1515
public let address: EthereumAddress
1616

1717
lazy var contract: Web3.Contract = {
18+
// swiftlint:disable force_unwrapping
1819
let contract = self.web3.contract(Web3.Utils.reverseRegistrarABI, at: self.address, abiVersion: 2)
1920
precondition(contract != nil)
2021
return contract!
22+
// swiftlint:enable force_unwrapping
2123
}()
2224

2325
lazy var defaultTransaction: CodableTransaction = {
@@ -53,15 +55,15 @@ public extension ENS {
5355
public func getReverseRecordName(address: EthereumAddress) async throws -> Data {
5456
guard let transaction = self.contract.createReadOperation("node", parameters: [address]) else { throw Web3Error.transactionSerializationError }
5557

56-
guard let result = try? await transaction.callContractMethod() else {throw Web3Error.processingError(desc: "Can't call transaction")}
58+
guard let result = try? await transaction.callContractMethod() else { throw Web3Error.processingError(desc: "Can't call transaction") }
5759
guard let name = result["0"] as? Data else { throw Web3Error.processingError(desc: "Can't get answer") }
5860
return name
5961
}
6062

6163
public func getDefaultResolver() async throws -> EthereumAddress {
6264
guard let transaction = self.contract.createReadOperation("defaultResolver") else { throw Web3Error.transactionSerializationError }
6365

64-
guard let result = try? await transaction.callContractMethod() else {throw Web3Error.processingError(desc: "Can't call transaction")}
66+
guard let result = try? await transaction.callContractMethod() else { throw Web3Error.processingError(desc: "Can't call transaction") }
6567
guard let address = result["0"] as? EthereumAddress else { throw Web3Error.processingError(desc: "Can't get answer") }
6668
return address
6769
}

0 commit comments

Comments
 (0)