Skip to content

Commit 7c35535

Browse files
Merge pull request #402 from Adamant-im/release/3.3.0
Release 3.3.0
2 parents 658288a + d2806cb commit 7c35535

File tree

467 files changed

+12640
-9207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

467 files changed

+12640
-9207
lines changed

Adamant.xcodeproj/project.pbxproj

Lines changed: 568 additions & 195 deletions
Large diffs are not rendered by default.

Adamant.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,17 @@
105105
"repositoryURL": "https://github.com/google/GoogleDataTransport.git",
106106
"state": {
107107
"branch": null,
108-
"revision": "98a00258d4518b7521253a70b7f70bb76d2120fe",
109-
"version": "9.2.4"
108+
"revision": "aae45a320fd0d11811820335b1eabc8753902a40",
109+
"version": "9.2.5"
110110
}
111111
},
112112
{
113113
"package": "GoogleUtilities",
114114
"repositoryURL": "https://github.com/google/GoogleUtilities.git",
115115
"state": {
116116
"branch": null,
117-
"revision": "4446686bc3714d49ce043d0f68318f42ed718cb6",
118-
"version": "7.11.4"
117+
"revision": "bc27fad73504f3d4af235de451f02ee22586ebd3",
118+
"version": "7.12.1"
119119
}
120120
},
121121
{
@@ -141,8 +141,8 @@
141141
"repositoryURL": "https://github.com/nathantannar4/InputBarAccessoryView",
142142
"state": {
143143
"branch": null,
144-
"revision": "039a9cb3ae8c5bc4d39242a6aa688b88023633d3",
145-
"version": "6.2.0"
144+
"revision": "17ced92a5dccb36512b408b6276353631d7cbe57",
145+
"version": "6.3.0"
146146
}
147147
},
148148
{
@@ -159,8 +159,8 @@
159159
"repositoryURL": "https://github.com/firebase/leveldb.git",
160160
"state": {
161161
"branch": null,
162-
"revision": "0706abcc6b0bd9cedfbb015ba840e4a780b5159b",
163-
"version": "1.22.2"
162+
"revision": "9d108e9112aa1d65ce508facf804674546116d9c",
163+
"version": "1.22.3"
164164
}
165165
},
166166
{
@@ -177,8 +177,8 @@
177177
"repositoryURL": "https://github.com/MessageKit/MessageKit.git",
178178
"state": {
179179
"branch": null,
180-
"revision": "14bfa7eb9f93267c3d7b8cdf58615bba27be672a",
181-
"version": "4.1.1"
180+
"revision": "1993e8e90d4e9a61b8d9bc8ceb733964ce943376",
181+
"version": "4.2.0"
182182
}
183183
},
184184
{
@@ -276,7 +276,7 @@
276276
"repositoryURL": "https://github.com/socketio/socket.io-client-swift",
277277
"state": {
278278
"branch": "master",
279-
"revision": "a1ed825835a2d8c2555938e96557ccc05e4bebf3",
279+
"revision": "175da8b5156f6b132436f0676cc84c2f6a766b6e",
280280
"version": null
281281
}
282282
},
@@ -285,17 +285,17 @@
285285
"repositoryURL": "https://github.com/daltoniam/Starscream",
286286
"state": {
287287
"branch": null,
288-
"revision": "df8d82047f6654d8e4b655d1b1525c64e1059d21",
289-
"version": "4.0.4"
288+
"revision": "ac6c0fc9da221873e01bd1a0d4818498a71eef33",
289+
"version": "4.0.6"
290290
}
291291
},
292292
{
293293
"package": "SwiftProtobuf",
294294
"repositoryURL": "https://github.com/apple/swift-protobuf.git",
295295
"state": {
296296
"branch": null,
297-
"revision": "ce20dc083ee485524b802669890291c0d8090170",
298-
"version": "1.22.1"
297+
"revision": "07f7f26ded8df9645c072f220378879c4642e063",
298+
"version": "1.25.1"
299299
}
300300
},
301301
{

Adamant/CoreData/Adamant.xcdatamodeld/Adamant.xcdatamodel/contents renamed to Adamant/Adamant.xcdatamodeld/Adamant.xcdatamodel/contents

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,10 @@
88
<attribute name="name" optional="YES" attributeType="String"/>
99
<relationship name="transfers" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="BaseTransaction" inverseName="partner" inverseEntity="BaseTransaction"/>
1010
</entity>
11-
<entity name="BaseTransaction" representedClassName="BaseTransaction" isAbstract="YES" syncable="YES">
12-
<attribute name="amount" optional="YES" attributeType="Decimal" defaultValueString="0"/>
13-
<attribute name="blockId" optional="YES" attributeType="String"/>
14-
<attribute name="confirmations" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
15-
<attribute name="date" attributeType="Date" usesScalarValueType="NO"/>
16-
<attribute name="fee" optional="YES" attributeType="Decimal" defaultValueString="0"/>
17-
<attribute name="height" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
18-
<attribute name="isConfirmed" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
19-
<attribute name="isOutgoing" attributeType="Boolean" usesScalarValueType="YES"/>
20-
<attribute name="recipientId" attributeType="String"/>
21-
<attribute name="senderId" attributeType="String"/>
11+
<entity name="BaseTransaction" representedClassName="BaseTransaction" isAbstract="YES" parentEntity="CoinTransaction" syncable="YES">
2212
<attribute name="senderPublicKey" optional="YES" attributeType="String"/>
23-
<attribute name="transactionId" attributeType="String"/>
2413
<attribute name="type" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
2514
<relationship name="partner" maxCount="1" deletionRule="Nullify" destinationEntity="BaseAccount" inverseName="transfers" inverseEntity="BaseAccount"/>
26-
<uniquenessConstraints>
27-
<uniquenessConstraint>
28-
<constraint value="transactionId"/>
29-
</uniquenessConstraint>
30-
</uniquenessConstraints>
3115
</entity>
3216
<entity name="Chatroom" representedClassName="Chatroom" syncable="YES">
3317
<attribute name="hasUnreadMessages" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
@@ -42,6 +26,7 @@
4226
</entity>
4327
<entity name="ChatTransaction" representedClassName="ChatTransaction" isAbstract="YES" parentEntity="BaseTransaction" syncable="YES">
4428
<attribute name="chatMessageId" attributeType="String"/>
29+
<attribute name="isFake" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
4530
<attribute name="isHidden" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
4631
<attribute name="isUnread" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
4732
<attribute name="showsChatroom" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
@@ -50,6 +35,27 @@
5035
<relationship name="chatroom" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Chatroom" inverseName="transactions" inverseEntity="Chatroom"/>
5136
<relationship name="lastIn" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Chatroom" inverseName="lastTransaction" inverseEntity="Chatroom"/>
5237
</entity>
38+
<entity name="CoinTransaction" representedClassName="CoinTransaction" isAbstract="YES" syncable="YES">
39+
<attribute name="amount" optional="YES" attributeType="Decimal" defaultValueString="0.0"/>
40+
<attribute name="blockchainType" attributeType="String" defaultValueString=""/>
41+
<attribute name="blockId" optional="YES" attributeType="String"/>
42+
<attribute name="coinId" optional="YES" attributeType="String"/>
43+
<attribute name="confirmations" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
44+
<attribute name="date" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
45+
<attribute name="fee" optional="YES" attributeType="Decimal" defaultValueString="0.0"/>
46+
<attribute name="height" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
47+
<attribute name="isConfirmed" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
48+
<attribute name="isOutgoing" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
49+
<attribute name="recipientId" attributeType="String" defaultValueString=""/>
50+
<attribute name="senderId" attributeType="String" defaultValueString=""/>
51+
<attribute name="transactionId" attributeType="String" defaultValueString=""/>
52+
<attribute name="transactionStatusRaw" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
53+
<uniquenessConstraints>
54+
<uniquenessConstraint>
55+
<constraint value="transactionId"/>
56+
</uniquenessConstraint>
57+
</uniquenessConstraints>
58+
</entity>
5359
<entity name="CoreDataAccount" representedClassName="CoreDataAccount" parentEntity="BaseAccount" syncable="YES">
5460
<attribute name="publicKey" attributeType="String"/>
5561
<relationship name="chatroom" maxCount="1" deletionRule="Cascade" destinationEntity="Chatroom" inverseName="partner" inverseEntity="Chatroom"/>

Adamant/AppDelegate.swift renamed to Adamant/App/AppDelegate.swift

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ extension StoreKey {
4040
class AppDelegate: UIResponder, UIApplicationDelegate {
4141
var window: UIWindow?
4242
var repeater: RepeaterService!
43-
var container: Container!
43+
var container: AppContainer!
44+
var screensFactory: ScreensFactory!
4445

4546
// MARK: Dependencies
4647
var accountService: AccountService!
@@ -57,8 +58,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
5758
KeychainStore.migrateIfNeeded()
5859

5960
// MARK: 1. Initiating Swinject
60-
container = Container()
61-
container.registerAdamantServices()
61+
container = AppContainer()
62+
screensFactory = AdamantScreensFactory(assembler: container.assembler)
6263
accountService = container.resolve(AccountService.self)
6364
notificationService = container.resolve(NotificationsService.self)
6465
dialogService = container.resolve(DialogService.self)
@@ -93,16 +94,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
9394
window.tintColor = UIColor.adamant.primary
9495

9596
// MARK: 3. Prepare pages
96-
guard let router = container.resolve(Router.self) else {
97-
fatalError("Failed to get Router")
98-
}
99-
10097
let chatList = UINavigationController(
101-
rootViewController: router.get(scene: AdamantScene.Chats.chatList)
98+
rootViewController: screensFactory.makeChatList()
10299
)
103100

104101
let account = UINavigationController(
105-
rootViewController: router.get(scene: AdamantScene.Account.account)
102+
rootViewController: screensFactory.makeAccount()
106103
)
107104

108105
let tabScreens: TabScreens = UIScreen.main.traitCollection.userInterfaceIdiom == .pad
@@ -156,15 +153,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
156153
dialogService.setup(window: window)
157154

158155
// MARK: 5. Show login
159-
let login = router.get(scene: AdamantScene.Login.login) as! LoginViewController
156+
let login = screensFactory.makeLogin()
160157
let welcomeIsShown = UserDefaults.standard.bool(forKey: StoreKey.application.welcomeScreensIsShown)
161158

162159
login.requestBiometryOnFirstTimeActive = welcomeIsShown
163160
login.modalPresentationStyle = .overFullScreen
164161
window.rootViewController?.present(login, animated: false, completion: nil)
165162

166163
if !welcomeIsShown {
167-
let welcome = router.get(scene: AdamantScene.Onboard.welcome)
164+
let welcome = screensFactory.makeOnboard()
168165
welcome.modalPresentationStyle = .overFullScreen
169166
login.present(welcome, animated: true, completion: nil)
170167
UserDefaults.standard.set(true, forKey: StoreKey.application.welcomeScreensIsShown)
@@ -205,7 +202,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
205202
}
206203

207204
// Setup transactions statuses observing
208-
if let service = container.resolve(RichTransactionStatusService.self) {
205+
if let service = container.resolve(TransactionStatusService.self) {
209206
Task { await service.startObserving() }
210207
}
211208

@@ -443,8 +440,7 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
443440
// MARK: - Background Fetch
444441
extension AppDelegate {
445442
func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
446-
let container = Container()
447-
container.registerAdamantServices()
443+
let container = AppContainer()
448444

449445
guard let notificationsService = container.resolve(NotificationsService.self) else {
450446
UIApplication.shared.setMinimumBackgroundFetchInterval(UIApplication.backgroundFetchIntervalNever)
@@ -621,11 +617,7 @@ extension AppDelegate {
621617
var chatList: UINavigationController?
622618
var chatDetail: ChatListViewController?
623619

624-
guard let tabbar = window?.rootViewController as? UITabBarController,
625-
let router = container.resolve(Router.self)
626-
else {
627-
return
628-
}
620+
guard let tabbar = window?.rootViewController as? UITabBarController else { return }
629621

630622
if let split = tabbar.viewControllers?.first as? UISplitViewController,
631623
let navigation = split.viewControllers.first as? UINavigationController,
@@ -652,7 +644,6 @@ extension AppDelegate {
652644
with: adamantAdr,
653645
chatList: chatList,
654646
tabbar: tabbar,
655-
router: router,
656647
chatDetail: chatDetail
657648
)
658649
}
@@ -663,17 +654,13 @@ extension AppDelegate {
663654
with adamantAdr: AdamantAddress,
664655
chatList: UINavigationController,
665656
tabbar: UITabBarController,
666-
router: Router,
667657
chatDetail: ChatListViewController
668658
) {
669659
chatList.popToRootViewController(animated: false)
670660
chatList.dismiss(animated: false, completion: nil)
671661
tabbar.selectedIndex = 0
672662

673-
let newChat = router.get(scene: AdamantScene.Chats.newChat) as? NewChatViewController
674-
675-
guard let newChat = newChat else { return }
676-
663+
let newChat = screensFactory.makeNewChat()
677664
newChat.delegate = chatDetail.self
678665

679666
if let split = chatDetail.splitViewController {

0 commit comments

Comments
 (0)