Skip to content

Commit d1e5f30

Browse files
committed
try fix freeze
1 parent 6ef0c3a commit d1e5f30

File tree

7 files changed

+88
-38
lines changed

7 files changed

+88
-38
lines changed

Podfile.lock

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
PODS:
2+
- AppAuth (1.6.2):
3+
- AppAuth/Core (= 1.6.2)
4+
- AppAuth/ExternalUserAgent (= 1.6.2)
5+
- AppAuth/Core (1.6.2)
6+
- AppAuth/ExternalUserAgent (1.6.2):
7+
- AppAuth/Core
28
- BigInt (5.2.0)
39
- Charts (4.1.0):
410
- Charts/Core (= 4.1.0)
@@ -19,6 +25,23 @@ PODS:
1925
- Cuckoo/Swift (1.10.3)
2026
- FearlessKeys (0.1.1)
2127
- FireMock (3.1)
28+
- GoogleAPIClientForREST/Core (1.2.1):
29+
- GTMSessionFetcher (>= 1.1.7)
30+
- GoogleAPIClientForREST/Drive (1.2.1):
31+
- GoogleAPIClientForREST/Core
32+
- GTMSessionFetcher (>= 1.1.7)
33+
- GoogleSignIn (7.0.0):
34+
- AppAuth (~> 1.5)
35+
- GTMAppAuth (< 3.0, >= 1.3)
36+
- GTMSessionFetcher/Core (< 4.0, >= 1.1)
37+
- GTMAppAuth (2.0.0):
38+
- AppAuth/Core (~> 1.6)
39+
- GTMSessionFetcher/Core (< 4.0, >= 1.5)
40+
- GTMSessionFetcher (3.1.1):
41+
- GTMSessionFetcher/Full (= 3.1.1)
42+
- GTMSessionFetcher/Core (3.1.1)
43+
- GTMSessionFetcher/Full (3.1.1):
44+
- GTMSessionFetcher/Core
2245
- IrohaCrypto (0.10.0):
2346
- IrohaCrypto/BIP39 (= 0.10.0)
2447
- IrohaCrypto/blake2 (= 0.10.0)
@@ -123,6 +146,13 @@ PODS:
123146
- SSFNetwork
124147
- SSFRuntimeCodingService
125148
- SSFUtils
149+
- SSFCloudStorage (0.1.15):
150+
- GoogleAPIClientForREST/Drive (~> 1.2.1)
151+
- GoogleSignIn (~> 7.0.0)
152+
- IrohaCrypto/Scrypt
153+
- SSFModels
154+
- SSFUtils
155+
- TweetNacl (~> 1.0.0)
126156
- SSFCrypto (0.1.17):
127157
- IrohaCrypto/ed25519
128158
- IrohaCrypto/Scrypt
@@ -232,6 +262,7 @@ DEPENDENCIES:
232262
- Sourcery (~> 1.4)
233263
- SSFChainConnection (= 0.1.4)
234264
- SSFChainRegistry (= 0.1.4)
265+
- SSFCloudStorage
235266
- SSFCrypto (= 0.1.17)
236267
- SSFEraKit
237268
- SSFExtrinsicKit
@@ -252,13 +283,18 @@ DEPENDENCIES:
252283
- XNetworking (from `https://raw.githubusercontent.com/soramitsu/x-networking/0.0.37/AppCommonNetworking/XNetworking/XNetworking.podspec`)
253284

254285
SPEC REPOS:
255-
https://github.com/cocoapods/Specs.git:
286+
https://github.com/CocoaPods/Specs.git:
287+
- AppAuth
256288
- BigInt
257289
- Charts
258290
- CocoaLumberjack
259291
- CommonWallet
260292
- Cuckoo
261293
- FireMock
294+
- GoogleAPIClientForREST
295+
- GoogleSignIn
296+
- GTMAppAuth
297+
- GTMSessionFetcher
262298
- IrohaCrypto
263299
- keccak.c
264300
- Kingfisher
@@ -284,6 +320,7 @@ SPEC REPOS:
284320
- FearlessKeys
285321
- SSFChainConnection
286322
- SSFChainRegistry
323+
- SSFCloudStorage
287324
- SSFCrypto
288325
- SSFEraKit
289326
- SSFExtrinsicKit
@@ -322,13 +359,18 @@ CHECKOUT OPTIONS:
322359
:tag: 4.0.8
323360

324361
SPEC CHECKSUMS:
362+
AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570
325363
BigInt: f668a80089607f521586bbe29513d708491ef2f7
326364
Charts: ce0768268078eee0336f122c3c4ca248e4e204c5
327365
CocoaLumberjack: 5c7e64cdb877770859bddec4d3d5a0d7c9299df9
328366
CommonWallet: 3c67d5fd85593a20f6b55777c2660ff886fc4148
329367
Cuckoo: 930598bd4ae95860c658b3eea30903d946ebef36
330368
FearlessKeys: 5248fbd49df75338e61901c89880ae4e9f99c054
331369
FireMock: 3eed872059c12f94855413347da83b9d6d1a6fac
370+
GoogleAPIClientForREST: a8b95a252014ce2e618df6b75dc72eca2c00b4af
371+
GoogleSignIn: b232380cf495a429b8095d3178a8d5855b42e842
372+
GTMAppAuth: 99fb010047ba3973b7026e45393f51f27ab965ae
373+
GTMSessionFetcher: e8647203b65cee28c5f73d0f473d096653945e72
332374
IrohaCrypto: eb3772088068d8938198205b62b0a9dc5b8ce005
333375
keccak.c: 859583afdaccb4e4fcc0f0096064d101580313f4
334376
Kingfisher: 1d14e9f59cbe19389f591c929000332bf70efd32
@@ -347,6 +389,7 @@ SPEC CHECKSUMS:
347389
Sourcery: 179539341c2261068528cd15a31837b7238fd901
348390
SSFChainConnection: 760f0bbe0d711cc0f184b951dea9e840a2962346
349391
SSFChainRegistry: adfcfa6f8e7dae4730e258989c2a58ee674bf1e1
392+
SSFCloudStorage: 37fbba3ad3e93a637d9c1a9b85910f4fa29596de
350393
SSFCrypto: 7ea544e61213538744ef8fd075e5e4487b7cf502
351394
SSFEraKit: a6f2a8bdefcdfa3ad8ff8f48b242000ea50744cd
352395
SSFExtrinsicKit: f5ab32700622894d2e7a5fca254a3f659d3a6a9f
@@ -369,6 +412,6 @@ SPEC CHECKSUMS:
369412
XNetworking: 516d982bd74ff208222381d27e07052a5d897aaf
370413
xxHash-Swift: 30bd6a7507b3b7348a277c49b1cb6346c2905ec7
371414

372-
PODFILE CHECKSUM: 53383695a0656421c77d79fb7a06bd1be3926011
415+
PODFILE CHECKSUM: c4e802ef4df1a83d5af2e0466c71b18abb869ed5
373416

374417
COCOAPODS: 1.11.3

fearless/ApplicationLayer/Services/NFT/Ethereum/AlchemyNftFetchingService.swift

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,21 @@ final class AlchemyNftFetchingService: BaseNftFetchingService {
4141
throw AddressFactoryError.unexpectedAddress
4242
}
4343

44-
return try await withCheckedThrowingContinuation { continuation in
45-
let fetchNftsOperation = operationFactory.fetchNFTs(chain: chain, address: address)
46-
47-
fetchNftsOperation.targetOperation.completionBlock = {
48-
do {
49-
let nfts = try fetchNftsOperation.targetOperation.extractNoCancellableResultData()
50-
continuation.resume(with: .success(nfts))
51-
} catch {
52-
continuation.resume(with: .failure(error))
53-
}
54-
}
55-
56-
self.operationQueue.addOperations(fetchNftsOperation.allOperations, waitUntilFinished: true)
57-
}
44+
return nil
45+
// return try await withCheckedThrowingContinuation { continuation in
46+
// let fetchNftsOperation = operationFactory.fetchNFTs(chain: chain, address: address)
47+
//
48+
// fetchNftsOperation.targetOperation.completionBlock = {
49+
// do {
50+
// let nfts = try fetchNftsOperation.targetOperation.extractNoCancellableResultData()
51+
// continuation.resume(with: .success(nfts))
52+
// } catch {
53+
// continuation.resume(with: .failure(error))
54+
// }
55+
// }
56+
//
57+
// self.operationQueue.addOperations(fetchNftsOperation.allOperations, waitUntilFinished: true)
58+
// }
5859
}
5960
}
6061

fearless/Common/ChainIssuesCenter/ChainIssuesCenter.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,8 @@ extension ChainsIssuesCenter: NetworkIssuesCenterListener {
112112
}
113113

114114
extension ChainsIssuesCenter: EventVisitorProtocol {
115-
func processSelectedAccountChanged(event _: SelectedAccountChanged) {
116-
guard let wallet = SelectedWalletSettings.shared.value else {
117-
return
118-
}
119-
self.wallet = wallet
115+
func processSelectedAccountChanged(event: SelectedAccountChanged) {
116+
wallet = event.account
120117

121118
missingAccountFetcher.fetchMissingAccounts(for: wallet) { [weak self] missingAccounts in
122119
self?.missingAccountsChains = missingAccounts

fearless/Common/Operation/OperationManagerFacade.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,12 @@ final class OperationManagerFacade {
1818
return operationQueue
1919
}()
2020

21+
static let persistentQueue: OperationQueue = {
22+
let operationQueue = OperationQueue()
23+
operationQueue.qualityOfService = .userInitiated
24+
operationQueue.maxConcurrentOperationCount = 20
25+
return operationQueue
26+
}()
27+
2128
static let sharedManager = OperationManager(operationQueue: sharedDefaultQueue)
2229
}

fearless/Common/Storage/SelectedWalletSettings.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import RobinHood
44
final class SelectedWalletSettings: PersistentValueSettings<MetaAccountModel> {
55
static let shared = SelectedWalletSettings(
66
storageFacade: UserDataStorageFacade.shared,
7-
operationQueue: OperationManagerFacade.sharedDefaultQueue
7+
operationQueue: OperationManagerFacade.persistentQueue
88
)
99

1010
let operationQueue: OperationQueue
11+
let mapper = ManagedMetaAccountMapper()
12+
lazy var repository = storageFacade.createRepository(mapper: AnyCoreDataMapper(mapper))
1113

1214
init(storageFacade: StorageFacadeProtocol, operationQueue: OperationQueue) {
1315
self.operationQueue = operationQueue
@@ -42,9 +44,6 @@ final class SelectedWalletSettings: PersistentValueSettings<MetaAccountModel> {
4244
value: MetaAccountModel,
4345
completionClosure: @escaping (Result<MetaAccountModel, Error>) -> Void
4446
) {
45-
let mapper = ManagedMetaAccountMapper()
46-
let repository = storageFacade.createRepository(mapper: AnyCoreDataMapper(mapper))
47-
4847
let options = RepositoryFetchOptions(includesProperties: true, includesSubentities: true)
4948
let maybeCurrentAccountOperation = internalValue.map {
5049
repository.fetchOperation(by: $0.identifier, options: options)

fearless/Modules/WalletsManagment/WalletsManagmentAssembly.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ final class WalletsManagmentAssembly {
1111
contextTag: Int = 0,
1212
moduleOutput: WalletsManagmentModuleOutput?
1313
) -> WalletsManagmentModuleCreationResult? {
14-
guard let wallet = SelectedWalletSettings.shared.value else { return nil }
1514
let sharedDefaultQueue = OperationManagerFacade.sharedDefaultQueue
1615
let localizationManager = LocalizationManager.shared
1716
let eventCenter = EventCenter.shared

fearless/Modules/WalletsManagment/WalletsManagmentInteractor.swift

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,24 @@ extension WalletsManagmentInteractor: WalletsManagmentInteractorInput {
7474
output?.didCompleteSelection()
7575
return
7676
}
77-
let oldMetaAccount = settings.value
77+
DispatchQueue.global().async {
78+
let oldMetaAccount = self.settings.value
7879

79-
guard wallet.info.identifier != oldMetaAccount?.identifier else {
80-
output?.didCompleteSelection()
81-
return
82-
}
80+
guard wallet.info.identifier != oldMetaAccount?.identifier else {
81+
DispatchQueue.main.async {
82+
self.output?.didCompleteSelection()
83+
}
84+
return
85+
}
8386

84-
settings.save(value: wallet.info, runningCompletionIn: .main) { [weak self] result in
85-
switch result {
86-
case .success:
87-
self?.eventCenter.notify(with: SelectedAccountChanged(account: wallet.info))
88-
self?.output?.didCompleteSelection()
89-
case let .failure(error):
90-
self?.output?.didReceive(error: error)
87+
self.settings.save(value: wallet.info, runningCompletionIn: .main) { [weak self] result in
88+
switch result {
89+
case .success:
90+
self?.eventCenter.notify(with: SelectedAccountChanged(account: wallet.info))
91+
self?.output?.didCompleteSelection()
92+
case let .failure(error):
93+
self?.output?.didReceive(error: error)
94+
}
9195
}
9296
}
9397
}

0 commit comments

Comments
 (0)