Skip to content

Commit

Permalink
Merge pull request #543 from nova-wallet/develop
Browse files Browse the repository at this point in the history
v5.1.0
  • Loading branch information
ERussel authored Jan 18, 2023
2 parents 93a152f + ff0f21b commit 8b6177c
Show file tree
Hide file tree
Showing 73 changed files with 2,746 additions and 161 deletions.
146 changes: 144 additions & 2 deletions novawallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions novawallet/Assets.xcassets/iconDesktopMode.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "desktop.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions novawallet/Assets.xcassets/iconUnfavorite.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "unfavorite-heart-outline.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ extension TimeInterval {

var seconds: TimeInterval { self / 1000 }
var minutesFromSeconds: Int { Int(self / Self.secondsInMinute) }
var secondsFromMinutes: TimeInterval { self * Self.secondsInMinute }
var daysFromSeconds: Int { Int(self / Self.secondsInDay) }
var fractionDaysFromSeconds: Decimal { Decimal(self) / Decimal(Self.secondsInDay) }
var secondsFromDays: TimeInterval { self * Self.secondsInDay }
Expand Down
5 changes: 5 additions & 0 deletions novawallet/Common/Extension/UIKit/Style/UILabel+Style.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,9 @@ extension UILabel.Style {
textColor: R.color.colorTextPrimary()!,
font: .boldTitle2
)

static let bottomSheetTitle = UILabel.Style(
textColor: R.color.colorTextPrimary()!,
font: .semiBoldBody
)
}
9 changes: 9 additions & 0 deletions novawallet/Common/Helpers/AccountRepositoryFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ protocol AccountRepositoryFactoryProtocol {
func createFavoriteDAppsRepository() -> AnyDataProviderRepository<DAppFavorite>

func createAuthorizedDAppsRepository(for metaId: String) -> AnyDataProviderRepository<DAppSettings>

func createDAppsGlobalSettingsRepository() -> AnyDataProviderRepository<DAppGlobalSettings>
}

extension AccountRepositoryFactoryProtocol {
Expand Down Expand Up @@ -76,6 +78,13 @@ final class AccountRepositoryFactory: AccountRepositoryFactoryProtocol {
return AnyDataProviderRepository(repository)
}

func createDAppsGlobalSettingsRepository() -> AnyDataProviderRepository<DAppGlobalSettings> {
let mapper = DAppGlobalSettingsMapper()
let repository = storageFacade.createRepository(mapper: AnyCoreDataMapper(mapper))

return AnyDataProviderRepository(repository)
}

func createAuthorizedDAppsRepository(for metaId: String) -> AnyDataProviderRepository<DAppSettings> {
let mapper = DAppSettingsMapper()
let filter = NSPredicate.filterAuthorizedDApps(by: metaId)
Expand Down
6 changes: 6 additions & 0 deletions novawallet/Common/Helpers/WeakWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ final class WeakWrapper {
self.target = target
}
}

extension Array where Element == WeakWrapper {
mutating func clearEmptyItems() {
self = filter { $0.target != nil }
}
}
3 changes: 3 additions & 0 deletions novawallet/Common/Migration/UserStorageVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ enum UserStorageVersion: String, CaseIterable {
case version5 = "MultiassetUserDataModel4"
case version6 = "MultiassetUserDataModel5"
case version7 = "MultiassetUserDataModel6"
case version8 = "MultiassetUserDataModel7"

static var current: UserStorageVersion {
guard let currentVersion = allCases.last else {
Expand All @@ -32,6 +33,8 @@ enum UserStorageVersion: String, CaseIterable {
case .version6:
return .version7
case .version7:
return .version8
case .version8:
return nil
}
}
Expand Down
6 changes: 2 additions & 4 deletions novawallet/Common/Protocols/AuthorizationPresentable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ extension AuthorizationPresentable {
return
}

guard let presentingController = UIApplication.shared.keyWindow?
.rootViewController?.topModalViewController
else {
guard let presentingController = UIApplication.shared.keyWindow?.rootViewController?.topModalViewController else {
return
}

Expand All @@ -103,7 +101,7 @@ extension AuthorizationPresentable {
self.authorizationView = authorizationView

authorizationView.controller.modalTransitionStyle = .crossDissolve
authorizationView.controller.modalPresentationStyle = .fullScreen
authorizationView.controller.modalPresentationStyle = .overFullScreen
presentingController.present(authorizationView.controller, animated: animated, completion: nil)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ final class ChainRegistryFactory {

let connectionPool = ConnectionPool(
connectionFactory: ConnectionFactory(logger: Logger.shared),
applicationHandler: ApplicationHandler(with: nil)
applicationHandler: SecurityLayerService.shared.applicationHandlingProxy.addApplicationHandler()
)

let mapper = ChainModelMapper()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>MultiassetUserDataModel6.xcdatamodel</string>
<string>MultiassetUserDataModel7.xcdatamodel</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="21512" systemVersion="22A400" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<entity name="CDChainAccount" representedClassName="CDChainAccount" syncable="YES" codeGenerationType="class">
<attribute name="accountId" attributeType="String"/>
<attribute name="chainId" attributeType="String"/>
<attribute name="cryptoType" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="publicKey" attributeType="Binary"/>
<relationship name="metaAccount" maxCount="1" deletionRule="Nullify" destinationEntity="CDMetaAccount" inverseName="chainAccounts" inverseEntity="CDMetaAccount"/>
</entity>
<entity name="CDChainSettings" representedClassName="CDChainSettings" syncable="YES" codeGenerationType="class">
<attribute name="autobalanced" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
<attribute name="chainId" attributeType="String"/>
</entity>
<entity name="CDCustomChainNode" representedClassName="CDCustomChainNode" syncable="YES" codeGenerationType="class">
<attribute name="name" optional="YES" attributeType="String"/>
<attribute name="url" attributeType="URI"/>
</entity>
<entity name="CDDAppFavorite" representedClassName="CDDAppFavorite" syncable="YES" codeGenerationType="class">
<attribute name="icon" optional="YES" attributeType="String"/>
<attribute name="identifier" optional="YES" attributeType="String"/>
<attribute name="label" optional="YES" attributeType="String"/>
</entity>
<entity name="CDDAppGlobalSettings" representedClassName="CDDAppGlobalSettings" syncable="YES" codeGenerationType="class">
<attribute name="desktopDisplayMode" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="identifier" optional="YES" attributeType="String"/>
</entity>
<entity name="CDDAppSettings" representedClassName="CDDAppSettings" syncable="YES" codeGenerationType="class">
<attribute name="identifier" optional="YES" attributeType="String"/>
<attribute name="metaId" optional="YES" attributeType="String"/>
</entity>
<entity name="CDMetaAccount" representedClassName="CDMetaAccount" syncable="YES" codeGenerationType="class">
<attribute name="ethereumAddress" optional="YES" attributeType="String"/>
<attribute name="ethereumPublicKey" optional="YES" attributeType="Binary"/>
<attribute name="isSelected" attributeType="Boolean" usesScalarValueType="YES"/>
<attribute name="metaId" attributeType="String"/>
<attribute name="name" attributeType="String"/>
<attribute name="order" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="substrateAccountId" optional="YES" attributeType="String"/>
<attribute name="substrateCryptoType" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="substratePublicKey" optional="YES" attributeType="Binary"/>
<attribute name="type" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
<relationship name="chainAccounts" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="CDChainAccount" inverseName="metaAccount" inverseEntity="CDChainAccount"/>
</entity>
</model>
2 changes: 1 addition & 1 deletion novawallet/Common/Storage/UserDataStorageFacade.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum UserStorageParams {
* - update mappings between CoreData Entities and App Models;
* - switch version of UserStorageParams.modelVersion;
*/
static let modelVersion: UserStorageVersion = .version7
static let modelVersion: UserStorageVersion = .version8
static let modelDirectory: String = "UserDataModel.momd"
static let databaseName = "UserDataModel.sqlite"

Expand Down
Loading

0 comments on commit 8b6177c

Please sign in to comment.