From ff7a54f0fe76aa28fc8282f3258aee74a2db3cf6 Mon Sep 17 00:00:00 2001 From: Holyberry <666lynx666@mail.ru> Date: Thu, 14 Mar 2024 08:26:29 +0300 Subject: [PATCH] buildfix --- .../ReferendumStatusExtensions.swift | 24 ++++++++++++++++++ .../TransferTypeExtensions.swift | 0 Podfile.lock | 10 ++++---- novawallet.xcodeproj/project.pbxproj | 17 +++++++++++-- .../NotificationHandlers/Payload.swift | 25 ++----------------- 5 files changed, 46 insertions(+), 30 deletions(-) create mode 100644 NovaPushNotificationServiceExtension/Handlers/Extensions/ReferendumStatusExtensions.swift rename NovaPushNotificationServiceExtension/Handlers/{Transfers => Extensions}/TransferTypeExtensions.swift (100%) diff --git a/NovaPushNotificationServiceExtension/Handlers/Extensions/ReferendumStatusExtensions.swift b/NovaPushNotificationServiceExtension/Handlers/Extensions/ReferendumStatusExtensions.swift new file mode 100644 index 000000000..c434712cf --- /dev/null +++ b/NovaPushNotificationServiceExtension/Handlers/Extensions/ReferendumStatusExtensions.swift @@ -0,0 +1,24 @@ +import Foundation + +extension ReferendumStateUpdatePayload.Status { + func description(for locale: Locale?) -> String { + switch self { + case .created: + return R.string.localizable.pushNotificationReferendumCreated(preferredLanguages: locale?.rLanguages) + case .deciding: + return R.string.localizable.pushNotificationReferendumDeciding(preferredLanguages: locale?.rLanguages) + case .confirming: + return R.string.localizable.pushNotificationReferendumConfirming(preferredLanguages: locale?.rLanguages) + case .approved: + return R.string.localizable.pushNotificationReferendumApproved(preferredLanguages: locale?.rLanguages) + case .rejected: + return R.string.localizable.pushNotificationReferendumRejected(preferredLanguages: locale?.rLanguages) + case .cancelled: + return R.string.localizable.pushNotificationReferendumCancelled(preferredLanguages: locale?.rLanguages) + case .timedOut: + return R.string.localizable.pushNotificationReferendumTimedOut(preferredLanguages: locale?.rLanguages) + case .killed: + return R.string.localizable.pushNotificationReferendumKilled(preferredLanguages: locale?.rLanguages) + } + } +} diff --git a/NovaPushNotificationServiceExtension/Handlers/Transfers/TransferTypeExtensions.swift b/NovaPushNotificationServiceExtension/Handlers/Extensions/TransferTypeExtensions.swift similarity index 100% rename from NovaPushNotificationServiceExtension/Handlers/Transfers/TransferTypeExtensions.swift rename to NovaPushNotificationServiceExtension/Handlers/Extensions/TransferTypeExtensions.swift diff --git a/Podfile.lock b/Podfile.lock index 9b9a0f8bd..14f9b3703 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -936,7 +936,7 @@ DEPENDENCIES: - Kingfisher - R.swift - ReachabilitySwift - - RobinHood (from `https://github.com/ERussel/robinhood-ios.git`, commit `81b569e4c8b6b4b0fdf0696b4294b5e149eadaca`) + - RobinHood (from `https://github.com/ERussel/robinhood-ios.git`, tag `2.6.1`) - SnapKit (~> 5.0.0) - SoraFoundation (from `https://github.com/ERussel/Foundation-iOS.git`, tag `1.1.0`) - SoraKeystore (~> 1.0.0) @@ -1014,8 +1014,8 @@ EXTERNAL SOURCES: :git: https://github.com/novasamatech/hydra-math-swift.git :tag: '0.1' RobinHood: - :commit: 81b569e4c8b6b4b0fdf0696b4294b5e149eadaca :git: https://github.com/ERussel/robinhood-ios.git + :tag: 2.6.1 SoraFoundation: :git: https://github.com/ERussel/Foundation-iOS.git :tag: 1.1.0 @@ -1051,8 +1051,8 @@ CHECKOUT OPTIONS: :git: https://github.com/novasamatech/hydra-math-swift.git :tag: '0.1' RobinHood: - :commit: 81b569e4c8b6b4b0fdf0696b4294b5e149eadaca :git: https://github.com/ERussel/robinhood-ios.git + :tag: 2.6.1 SoraFoundation: :git: https://github.com/ERussel/Foundation-iOS.git :tag: 1.1.0 @@ -1138,6 +1138,6 @@ SPEC CHECKSUMS: ZMarkupParser: a92d31ba40695b790f1da5fec98c3d4505341aff ZNSTextAttachment: 1ddd53660a8d3c42dbb716bf6866ffce22c44181 -PODFILE CHECKSUM: 9c7ed411d8120369ce00dedc448ec27a4311a211 +PODFILE CHECKSUM: 3b521ee14d42ee2c4cb0b94d39d63cc62941a174 -COCOAPODS: 1.15.2 +COCOAPODS: 1.15.0 diff --git a/novawallet.xcodeproj/project.pbxproj b/novawallet.xcodeproj/project.pbxproj index 74e25bcae..45b8fd450 100644 --- a/novawallet.xcodeproj/project.pbxproj +++ b/novawallet.xcodeproj/project.pbxproj @@ -1154,6 +1154,7 @@ 77A6F5CF2A31C4D4004AFD1A /* Web3TransferRecipientRepositoryFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77A6F5CE2A31C4D4004AFD1A /* Web3TransferRecipientRepositoryFactory.swift */; }; 77A6F5D22A31DB8C004AFD1A /* JsonCanonicalizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77A6F5D12A31DB8C004AFD1A /* JsonCanonicalizer.swift */; }; 77A6F5D52A31E046004AFD1A /* JsonCanonicalizerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77A6F5D42A31E046004AFD1A /* JsonCanonicalizerTests.swift */; }; + 77A90E2B2BA2BFBD00A08A3E /* Referenda.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847A25C528D84BE2006AC9F5 /* Referenda.swift */; }; 77AAC3E52B70DB0300B8B89E /* firestore-settings.json in Resources */ = {isa = PBXBuildFile; fileRef = 77AAC3E42B70DB0300B8B89E /* firestore-settings.json */; }; 77AAD2992B1731D1007AD86F /* ReferendumsInitState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77AAD2982B1731D1007AD86F /* ReferendumsInitState.swift */; }; 77AAE2202AFB00CB006872CC /* OperationSwapModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77AAE21F2AFB00CB006872CC /* OperationSwapModel.swift */; }; @@ -1189,6 +1190,7 @@ 77AE4FAE2B90611000426519 /* DispatchQueueHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84F43C0E25DF016600AEDA56 /* DispatchQueueHelper.swift */; }; 77AE4FAF2B90611800426519 /* BaseOperation+Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843910C6253F56EA00E3C217 /* BaseOperation+Result.swift */; }; 77AE4FB02B90646100426519 /* BaseOperation+Cancellable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849C0670276516F900394C82 /* BaseOperation+Cancellable.swift */; }; + 77AF376B2BA2C1A800FD1A8E /* ReferendumStatusExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77AF376A2BA2C1A800FD1A8E /* ReferendumStatusExtensions.swift */; }; 77C35CE52B568ED100308F16 /* YourWalletsPresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77C35CE42B568ED100308F16 /* YourWalletsPresentable.swift */; }; 77C35CE72B56D07300308F16 /* ScanAddressPresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77C35CE62B56D07300308F16 /* ScanAddressPresentable.swift */; }; 77C35CE92B5A890500308F16 /* Web3NameServiceFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77C35CE82B5A890500308F16 /* Web3NameServiceFactory.swift */; }; @@ -5692,6 +5694,7 @@ 77AE4FB32B906B1B00426519 /* novawalletDev.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = novawalletDev.entitlements; sourceTree = ""; }; 77AE4FB42B906B2600426519 /* NovaPushNotificationServiceExtensionDev.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NovaPushNotificationServiceExtensionDev.entitlements; sourceTree = ""; }; 77AE4FB52B906B2E00426519 /* NovaPushNotificationServiceExtensionDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NovaPushNotificationServiceExtensionDebug.entitlements; sourceTree = ""; }; + 77AF376A2BA2C1A800FD1A8E /* ReferendumStatusExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReferendumStatusExtensions.swift; sourceTree = ""; }; 77C35CE42B568ED100308F16 /* YourWalletsPresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YourWalletsPresentable.swift; sourceTree = ""; }; 77C35CE62B56D07300308F16 /* ScanAddressPresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScanAddressPresentable.swift; sourceTree = ""; }; 77C35CE82B5A890500308F16 /* Web3NameServiceFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Web3NameServiceFactory.swift; sourceTree = ""; }; @@ -11400,7 +11403,6 @@ isa = PBXGroup; children = ( 778215C32B914DF8006C7D13 /* TransferHandler.swift */, - 77FC822E2BA1B99E00E7ED3C /* TransferTypeExtensions.swift */, ); path = Transfers; sourceTree = ""; @@ -11417,6 +11419,7 @@ 778215DA2B95A8F7006C7D13 /* Handlers */ = { isa = PBXGroup; children = ( + 77AF37692BA2C19500FD1A8E /* Extensions */, 778215C72B914E62006C7D13 /* Transfers */, 778215DB2B95AD67006C7D13 /* Governance */, 778215E52B95C42B006C7D13 /* Staking */, @@ -11539,6 +11542,15 @@ path = canonicalization; sourceTree = ""; }; + 77AF37692BA2C19500FD1A8E /* Extensions */ = { + isa = PBXGroup; + children = ( + 77FC822E2BA1B99E00E7ED3C /* TransferTypeExtensions.swift */, + 77AF376A2BA2C1A800FD1A8E /* ReferendumStatusExtensions.swift */, + ); + path = Extensions; + sourceTree = ""; + }; 77B011712B6CCCBB003A5868 /* Web3AlertService */ = { isa = PBXGroup; children = ( @@ -21618,6 +21630,7 @@ 77AE4FAC2B905EDB00426519 /* UInt64+TimeInterval.swift in Sources */, 77AE4F942B90595800426519 /* UserDataStorageFacade.swift in Sources */, 7778FE4C2B9107D20023E801 /* CompoundOperationWrapper+Dependency.swift in Sources */, + 77A90E2B2BA2BFBD00A08A3E /* Referenda.swift in Sources */, 7778FE612B910BD40023E801 /* GovernanceType.swift in Sources */, 7778FE542B9109430023E801 /* Observable.swift in Sources */, 7778FE432B90F8060023E801 /* CurrencyManager.swift in Sources */, @@ -21666,7 +21679,6 @@ 7778FE4D2B9107EC0023E801 /* CompoundOperationWrapper+Add.swift in Sources */, 77AE4FAD2B90604000426519 /* CancellableCallHelper.swift in Sources */, 77FC822F2BA1B99E00E7ED3C /* TransferTypeExtensions.swift in Sources */, - 7778FE772B910E040023E801 /* NovaTintImageProcessor.swift in Sources */, 77EDF9272B96DD8E003266B1 /* MetaAccountMapper.swift in Sources */, 77AE4F9A2B905B7500426519 /* LocalChainExternalApi.swift in Sources */, 7778FE452B90FA1C0023E801 /* OperationCombiningService.swift in Sources */, @@ -21679,6 +21691,7 @@ 7778FE582B910A760023E801 /* MoneyPresentable.swift in Sources */, 77AE4F982B905B5C00426519 /* AssetModel.swift in Sources */, 7778FE492B9104EE0023E801 /* PriceAssetInfoFactory.swift in Sources */, + 77AF376B2BA2C1A800FD1A8E /* ReferendumStatusExtensions.swift in Sources */, 0CCD18D42BA1F4550068D73A /* PrimitiveBalanceViewModelFactory.swift in Sources */, 77AE4FAB2B905E9B00426519 /* TimeInterval+Time.swift in Sources */, 77EDF9222B96D654003266B1 /* Web3Alert.swift in Sources */, diff --git a/novawallet/Modules/Notifications/NotificationHandlers/Payload.swift b/novawallet/Modules/Notifications/NotificationHandlers/Payload.swift index 66ca004de..ce8214aa2 100644 --- a/novawallet/Modules/Notifications/NotificationHandlers/Payload.swift +++ b/novawallet/Modules/Notifications/NotificationHandlers/Payload.swift @@ -11,7 +11,7 @@ struct NewReleasePayload: Codable { } struct NewReferendumPayload: Codable { - let referendumId: UInt + let referendumId: Referenda.ReferendumIndex var referendumNumber: String { "#\(referendumId)" @@ -25,7 +25,7 @@ struct ReferendumStateUpdatePayload: Codable { case toStatus = "to" } - let referendumId: UInt + let referendumId: Referenda.ReferendumIndex let fromStatus: Status? let toStatus: Status @@ -38,27 +38,6 @@ struct ReferendumStateUpdatePayload: Codable { case cancelled case timedOut case killed - - func description(for locale: Locale?) -> String { - switch self { - case .created: - return R.string.localizable.pushNotificationReferendumCreated(preferredLanguages: locale?.rLanguages) - case .deciding: - return R.string.localizable.pushNotificationReferendumDeciding(preferredLanguages: locale?.rLanguages) - case .confirming: - return R.string.localizable.pushNotificationReferendumConfirming(preferredLanguages: locale?.rLanguages) - case .approved: - return R.string.localizable.pushNotificationReferendumApproved(preferredLanguages: locale?.rLanguages) - case .rejected: - return R.string.localizable.pushNotificationReferendumRejected(preferredLanguages: locale?.rLanguages) - case .cancelled: - return R.string.localizable.pushNotificationReferendumCancelled(preferredLanguages: locale?.rLanguages) - case .timedOut: - return R.string.localizable.pushNotificationReferendumTimedOut(preferredLanguages: locale?.rLanguages) - case .killed: - return R.string.localizable.pushNotificationReferendumKilled(preferredLanguages: locale?.rLanguages) - } - } } var referendumNumber: String {