File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Sources/web3swift/Utils/ENS Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments