Skip to content

Commit 7b46536

Browse files
committed
[trello.com/c/Aw0Vfnmd] {Secret wallets} UI: Show Transactions 🔐 1️⃣
1 parent ae0a2e3 commit 7b46536

20 files changed

+61
-35
lines changed

Adamant/Adamant.xcdatamodeld/Adamant.xcdatamodel/contents

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="23605" systemVersion="24D81" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
2+
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="23605" systemVersion="24D70" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
33
<entity name="BaseAccount" representedClassName="BaseAccount" isAbstract="YES" syncable="YES">
44
<attribute name="address" attributeType="String"/>
55
<attribute name="avatar" optional="YES" attributeType="String"/>
@@ -53,6 +53,7 @@
5353
<attribute name="timestampMs" optional="YES" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
5454
<attribute name="transactionId" attributeType="String" defaultValueString=""/>
5555
<attribute name="transactionStatusRaw" attributeType="String" defaultValueString=""/>
56+
<attribute name="uniqueId" optional="YES" attributeType="String"/>
5657
<uniquenessConstraints>
5758
<uniquenessConstraint>
5859
<constraint value="transactionId"/>

Adamant/Models/CoreData/CoinTransaction+CoreDataProperties.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ extension CoinTransaction {
1919
@NSManaged public var amount: NSDecimalNumber?
2020
@NSManaged public var transactionId: String
2121
@NSManaged public var coinId: String?
22+
@NSManaged public var uniqueId: String?
2223
@NSManaged public var senderId: String?
2324
@NSManaged public var recipientId: String?
2425
@NSManaged public var date: NSDate?

Adamant/Modules/Wallets/Adamant/AdmTransactionsViewController.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ final class AdmTransactionsViewController: TransactionsListViewControllerBase {
4242
screensFactory: ScreensFactory,
4343
addressBookService: AddressBookService,
4444
walletService: WalletService,
45-
reachabilityMonitor: ReachabilityMonitor
45+
reachabilityMonitor: ReachabilityMonitor,
46+
secretWalletsViewModel: SecretWalletsViewModel
4647
) {
4748
self.accountService = accountService
4849
self.transfersProvider = transfersProvider
@@ -54,7 +55,8 @@ final class AdmTransactionsViewController: TransactionsListViewControllerBase {
5455
walletService: walletService,
5556
dialogService: dialogService,
5657
reachabilityMonitor: reachabilityMonitor,
57-
screensFactory: screensFactory
58+
screensFactory: screensFactory,
59+
secretWalletsViewModel: secretWalletsViewModel
5860
)
5961
}
6062

Adamant/Modules/Wallets/Adamant/AdmWalletFactory.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ struct AdmWalletFactory: WalletFactory {
3838
screensFactory: screensFactory,
3939
addressBookService: assembler.resolve(AddressBookService.self)!,
4040
walletService: service,
41-
reachabilityMonitor: assembler.resolve(ReachabilityMonitor.self)!
41+
reachabilityMonitor: assembler.resolve(ReachabilityMonitor.self)!,
42+
secretWalletsViewModel: assembler.resolve(SecretWalletsViewModel.self)!
4243
)
4344
}
4445

Adamant/Modules/Wallets/Adamant/AdmWalletService.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ final class AdmWalletService: NSObject, WalletCoreProtocol, WalletStaticCoreProt
117117

118118
private(set) lazy var coinStorage: CoinStorageService = AdamantCoinStorageService(
119119
coinId: tokenUniqueID,
120+
coinAddress: wallet?.address ?? "",
120121
coreDataStack: coreDataStack,
121122
blockchainType: richMessageType
122123
)

Adamant/Modules/Wallets/Bitcoin/BtcTransactionsViewController.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ final class BtcTransactionsViewController: TransactionsListViewControllerBase {
2323
dialogService: DialogService,
2424
reachabilityMonitor: ReachabilityMonitor,
2525
screensFactory: ScreensFactory,
26-
addressBook: AddressBookService
26+
addressBook: AddressBookService,
27+
secretWalletsViewModel: SecretWalletsViewModel
2728
) {
2829
self.addressBook = addressBook
2930

3031
super.init(
3132
walletService: walletService,
3233
dialogService: dialogService,
3334
reachabilityMonitor: reachabilityMonitor,
34-
screensFactory: screensFactory
35+
screensFactory: screensFactory,
36+
secretWalletsViewModel: secretWalletsViewModel
3537
)
3638
}
3739

Adamant/Modules/Wallets/Bitcoin/BtcWalletFactory.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ struct BtcWalletFactory: WalletFactory {
3434
dialogService: assembler.resolve(DialogService.self)!,
3535
reachabilityMonitor: assembler.resolve(ReachabilityMonitor.self)!,
3636
screensFactory: screensFactory,
37-
addressBook: assembler.resolve(AddressBookService.self)!
37+
addressBook: assembler.resolve(AddressBookService.self)!,
38+
secretWalletsViewModel: assembler.resolve(SecretWalletsViewModel.self)!
3839
)
3940
}
4041

Adamant/Modules/Wallets/Bitcoin/BtcWalletService.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ final class BtcWalletService: WalletCoreProtocol, WalletStaticCoreProtocol, @unc
202202

203203
private(set) lazy var coinStorage: CoinStorageService = AdamantCoinStorageService(
204204
coinId: tokenUniqueID,
205+
coinAddress: wallet?.address ?? "",
205206
coreDataStack: coreDataStack,
206207
blockchainType: richMessageType
207208
)
@@ -485,7 +486,8 @@ extension BtcWalletService {
485486
self.setState(.upToDate)
486487

487488
Task {
488-
self.update()
489+
await self.update()
490+
self.addTransactionObserver()
489491
}
490492

491493
guard storeInKVC else { return eWallet }
@@ -545,8 +547,6 @@ extension BtcWalletService: SwinjectDependentService {
545547
btcTransactionFactory = container.resolve(BitcoinKitTransactionFactoryProtocol.self)
546548
vibroService = container.resolve(VibroService.self)
547549
coreDataStack = container.resolve(CoreDataStack.self)
548-
549-
addTransactionObserver()
550550
}
551551
}
552552

Adamant/Modules/Wallets/Dash/DashWalletFactory.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ struct DashWalletFactory: WalletFactory {
3333
walletService: service,
3434
dialogService: assembler.resolve(DialogService.self)!,
3535
reachabilityMonitor: assembler.resolve(ReachabilityMonitor.self)!,
36-
screensFactory: screensFactory
36+
screensFactory: screensFactory,
37+
secretWalletsViewModel: assembler.resolve(SecretWalletsViewModel.self)!
3738
)
3839
}
3940

Adamant/Modules/Wallets/Dash/DashWalletService.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ final class DashWalletService: WalletCoreProtocol, WalletStaticCoreProtocol, @un
149149

150150
private(set) lazy var coinStorage: CoinStorageService = AdamantCoinStorageService(
151151
coinId: tokenUniqueID,
152+
coinAddress: wallet?.address ?? "",
152153
coreDataStack: coreDataStack,
153154
blockchainType: richMessageType
154155
)
@@ -342,7 +343,8 @@ extension DashWalletService {
342343
self.setState(.upToDate)
343344

344345
Task {
345-
self.update()
346+
await self.update()
347+
self.addTransactionObserver()
346348
}
347349

348350
guard storeInKVC else { return eWallet }
@@ -403,8 +405,6 @@ extension DashWalletService: SwinjectDependentService {
403405
dashApiService = container.resolve(DashApiService.self)
404406
vibroService = container.resolve(VibroService.self)
405407
coreDataStack = container.resolve(CoreDataStack.self)
406-
407-
addTransactionObserver()
408408
}
409409
}
410410

0 commit comments

Comments
 (0)