Skip to content

Commit db7551d

Browse files
authored
Merge pull request #741 from Adamant-im/trello.com/c/Aw0Vfnmd
[trello.com/c/Aw0Vfnmd] {Secret wallets} UI: Show Transactions 🔐 1️⃣
2 parents 0e3bc69 + 1155e52 commit db7551d

20 files changed

+86
-40
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
)
@@ -487,7 +488,8 @@ extension BtcWalletService {
487488
self.setState(.upToDate)
488489

489490
Task {
490-
self.update()
491+
await self.update()
492+
self.addTransactionObserver()
491493
}
492494

493495
guard storeInKVS else { return eWallet }
@@ -547,8 +549,6 @@ extension BtcWalletService: SwinjectDependentService {
547549
btcTransactionFactory = container.resolve(BitcoinKitTransactionFactoryProtocol.self)
548550
vibroService = container.resolve(VibroService.self)
549551
coreDataStack = container.resolve(CoreDataStack.self)
550-
551-
addTransactionObserver()
552552
}
553553
}
554554

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
)
@@ -345,7 +346,8 @@ extension DashWalletService {
345346
self.setState(.upToDate)
346347

347348
Task {
348-
self.update()
349+
await self.update()
350+
self.addTransactionObserver()
349351
}
350352

351353
guard storeInKVS else { return eWallet }
@@ -406,8 +408,6 @@ extension DashWalletService: SwinjectDependentService {
406408
dashApiService = container.resolve(DashApiService.self)
407409
vibroService = container.resolve(VibroService.self)
408410
coreDataStack = container.resolve(CoreDataStack.self)
409-
410-
addTransactionObserver()
411411
}
412412
}
413413

0 commit comments

Comments
 (0)