From 96a146b2e1934b8c6cb426185329b6d47da1aeb0 Mon Sep 17 00:00:00 2001 From: Esenbek Date: Fri, 26 Apr 2024 15:31:25 +0600 Subject: [PATCH] Rerun swiftformat --- .../Settings/Appearance/AppearanceViewModel.swift | 2 +- .../Settings/Main/MainSettingsViewController.swift | 8 ++++---- .../Modules/WalletConnect/WalletConnectService.swift | 10 ++++------ .../WalletConnectSocketConnectionService.swift | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Appearance/AppearanceViewModel.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Appearance/AppearanceViewModel.swift index b268da18b7..05e7b835a1 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Appearance/AppearanceViewModel.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Appearance/AppearanceViewModel.swift @@ -1,7 +1,7 @@ +import Combine import MarketKit import SwiftUI import ThemeKit -import Combine class AppearanceViewModel: ObservableObject { private var cancellables = Set() diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewController.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewController.swift index 97c85091d1..987d13d549 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewController.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewController.swift @@ -49,7 +49,7 @@ class MainSettingsViewController: ThemeViewController { title = "settings.title".localized navigationItem.backBarButtonItem = UIBarButtonItem(title: title, style: .plain, target: nil, action: nil) - + tableView.registerHeaderFooter(forClass: HighlightedSubtitleHeaderFooterView.self) tableView.sectionDataSource = self @@ -283,7 +283,7 @@ class MainSettingsViewController: ThemeViewController { stat(page: .settings, event: .open(page: .appearance)) } - ) + ), ] } @@ -571,7 +571,8 @@ class HighlightedSubtitleHeaderFooterView: UITableViewHeaderFooterView { label.textColor = .themeGray } - required public init?(coder aDecoder: NSCoder) { + @available(*, unavailable) + public required init?(coder _: NSCoder) { fatalError("init(coder:) has not been implemented") } @@ -580,5 +581,4 @@ class HighlightedSubtitleHeaderFooterView: UITableViewHeaderFooterView { label.textColor = color backgroundView?.backgroundColor = backgroundColor } - } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectService.swift index bf358022b4..f790935e68 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectService.swift @@ -1,6 +1,7 @@ import Combine import CryptoSwift import Foundation +import HsCryptoKit import HsToolKit import RxRelay import RxSwift @@ -12,7 +13,6 @@ import WalletConnectRelay import WalletConnectSign import WalletConnectUtils import Web3Wallet -import HsCryptoKit extension Starscream.WebSocket: WebSocketConnecting {} @@ -73,7 +73,7 @@ class WalletConnectService { setUpAuthSubscribing() connectionService.relayClient = Networking.instance - + updateSessions() updatePairings() } @@ -192,7 +192,7 @@ extension WalletConnectService { // works with pending requests public var pendingRequests: [WalletConnectSign.Request] { - Web3Wallet.instance.getPendingRequests().map { $0.request } + Web3Wallet.instance.getPendingRequests().map(\.request) } public var pendingRequestsUpdatedObservable: Observable { @@ -383,13 +383,12 @@ extension WalletConnectSign.SocketConnectionStatus { } struct DefaultCryptoProvider: CryptoProvider { - public func recoverPubKey(signature: EthereumSignature, message: Data) throws -> Data { let signature = Data(signature.r + signature.s + [signature.v]) let messageHash = keccak256(message) var pubKey = HsCryptoKit.Crypto.ellipticPublicKey(signature: signature, of: messageHash, compressed: false) pubKey?.remove(at: 0) - + return pubKey ?? Data() } @@ -398,5 +397,4 @@ struct DefaultCryptoProvider: CryptoProvider { let hash = digest.calculate(for: [UInt8](data)) return Data(hash) } - } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectSocketConnectionService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectSocketConnectionService.swift index 03e2f15389..0b92997fa4 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectSocketConnectionService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectSocketConnectionService.swift @@ -4,11 +4,11 @@ import HsToolKit import RxCocoa import RxRelay import RxSwift +import UIKit import WalletConnectRelay import WalletConnectSign import WalletConnectUtils import Web3Wallet -import UIKit class WalletConnectSocketConnectionService { private static let retryInterval = 10