From f2aa770d7671a167ae54738ecd0d7ec3be2464ab Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Mon, 18 Nov 2024 09:01:28 +0100 Subject: [PATCH 1/9] [no ci] wip --- RadixWallet.xcodeproj/project.pbxproj | 90 ++++++------------- .../xcshareddata/swiftpm/Package.resolved | 11 +-- ...bugFactorInstancesCacheContents+View.swift | 27 ++++++ .../DebugFactorInstancesCacheContents.swift | 47 ++++++++++ .../DebugSettingsCoordinator+Reducer.swift | 16 +++- .../DebugSettingsCoordinator+View.swift | 21 ++++- 6 files changed, 138 insertions(+), 74 deletions(-) create mode 100644 RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift create mode 100644 RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift diff --git a/RadixWallet.xcodeproj/project.pbxproj b/RadixWallet.xcodeproj/project.pbxproj index 638757004b..8be61a3468 100644 --- a/RadixWallet.xcodeproj/project.pbxproj +++ b/RadixWallet.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 56; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ @@ -48,7 +48,6 @@ 488A42F02BCAF9AF00F285BC /* Stage2MigrateToSargon+DeviceFactorSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 488A42EF2BCAF9AF00F285BC /* Stage2MigrateToSargon+DeviceFactorSource.swift */; }; 488A42F42BCAFD4200F285BC /* AccountsRecoveredFromScanning.swift in Sources */ = {isa = PBXBuildFile; fileRef = 488A42F32BCAFD4200F285BC /* AccountsRecoveredFromScanning.swift */; }; 489122782B186F61005F2EEE /* AlternativeRectangularButtonStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 489122772B186F61005F2EEE /* AlternativeRectangularButtonStyle.swift */; }; - 489FEF912BDD0B80003EC10D /* Sargon in Frameworks */ = {isa = PBXBuildFile; productRef = 489FEF902BDD0B80003EC10D /* Sargon */; }; 489FEF932BDD0BA7003EC10D /* Signer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 489FEF922BDD0BA7003EC10D /* Signer.swift */; }; 489FEF952BDD0BEA003EC10D /* SigningPurpose.swift in Sources */ = {isa = PBXBuildFile; fileRef = 489FEF942BDD0BEA003EC10D /* SigningPurpose.swift */; }; 48AB4E842AE19F5B001B238E /* ProfileStore+AsyncSequence+Updates.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48AB4E832AE19F5B001B238E /* ProfileStore+AsyncSequence+Updates.swift */; }; @@ -63,7 +62,6 @@ 48AE39EC2B0CCA7600813CF3 /* RecoverWalletControlWithBDFSComplete+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48AE39EA2B0CCA7600813CF3 /* RecoverWalletControlWithBDFSComplete+View.swift */; }; 48AE39ED2B0CCA7600813CF3 /* RecoverWalletControlWithBDFSComplete.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48AE39EB2B0CCA7600813CF3 /* RecoverWalletControlWithBDFSComplete.swift */; }; 48AF19CE2BB71C1600796130 /* IntoSargon+Bridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48AF19CD2BB71C1600796130 /* IntoSargon+Bridge.swift */; }; - 48C845C72BEA6DC600F74DA7 /* Sargon in Frameworks */ = {isa = PBXBuildFile; productRef = 48C845C62BEA6DC600F74DA7 /* Sargon */; }; 48C845CA2BEA6E2000F74DA7 /* Stage0MigrateToSargon+Accounts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48C845C92BEA6E2000F74DA7 /* Stage0MigrateToSargon+Accounts.swift */; }; 48CFC23F2ADC10D900E77A5C /* PreferenceList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48CFBC6E2ADC10D800E77A5C /* PreferenceList.swift */; }; 48CFC2402ADC10D900E77A5C /* AccountPreferences+Reducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48CFBC6F2ADC10D800E77A5C /* AccountPreferences+Reducer.swift */; }; @@ -739,7 +737,6 @@ 5B3C48C32C874C8D00DB160D /* Dispatch+Extra.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B3C48C22C874C8D00DB160D /* Dispatch+Extra.swift */; }; 5B43B08B2BDAAD4B00AA1E92 /* AddressDetails+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B43B0892BDAAD4B00AA1E92 /* AddressDetails+View.swift */; }; 5B43B08C2BDAAD4B00AA1E92 /* AddressDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B43B08A2BDAAD4B00AA1E92 /* AddressDetails.swift */; }; - 5B447E0B2CAAFC2D0063AE39 /* Sargon in Frameworks */ = {isa = PBXBuildFile; productRef = 5B447E0A2CAAFC2D0063AE39 /* Sargon */; }; 5B45E2FA2BC45770007C4C84 /* FactorSourceAccess+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B45E2F82BC45770007C4C84 /* FactorSourceAccess+View.swift */; }; 5B45E2FB2BC45770007C4C84 /* FactorSourceAccess.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B45E2F92BC45770007C4C84 /* FactorSourceAccess.swift */; }; 5B45E2FE2BC59780007C4C84 /* SignWithFactorSource+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B45E2FC2BC59780007C4C84 /* SignWithFactorSource+View.swift */; }; @@ -755,7 +752,6 @@ 5B4A1AC42CC0125700679EE6 /* InteractionReview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B4A1AC32CC0123300679EE6 /* InteractionReview.swift */; }; 5B4A1AC62CC0151300679EE6 /* HeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B4A1AC52CC0150D00679EE6 /* HeaderView.swift */; }; 5B4E1D132CB421EB002FAC2E /* DepositStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B4E1D122CB421E3002FAC2E /* DepositStatus.swift */; }; - 5B4E1D1F2CB7FE8E002FAC2E /* Sargon in Frameworks */ = {isa = PBXBuildFile; productRef = 5B4E1D1E2CB7FE8E002FAC2E /* Sargon */; }; 5B526ADB2C876E7C00AF8B72 /* AccountLockerClaimDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B526ADA2C876E7C00AF8B72 /* AccountLockerClaimDetails.swift */; }; 5B526AEC2C89C3C200AF8B72 /* ResourcesVisibilityClient+Interface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B526AE82C89C3C200AF8B72 /* ResourcesVisibilityClient+Interface.swift */; }; 5B526AED2C89C3C200AF8B72 /* ResourcesVisibilityClient+Live.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B526AE92C89C3C200AF8B72 /* ResourcesVisibilityClient+Live.swift */; }; @@ -813,7 +809,6 @@ 830EA9E52AEB9088004C8051 /* DefaultValueDecodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 830EA9E42AEB9088004C8051 /* DefaultValueDecodable.swift */; }; 830EA9E72AEBA793004C8051 /* EntitiesVisibilityClient+Live.swift in Sources */ = {isa = PBXBuildFile; fileRef = 830EA9E62AEBA793004C8051 /* EntitiesVisibilityClient+Live.swift */; }; 830EA9E92AEBA7C5004C8051 /* EntitiesVisibilityClient+Test.swift in Sources */ = {isa = PBXBuildFile; fileRef = 830EA9E82AEBA7C5004C8051 /* EntitiesVisibilityClient+Test.swift */; }; - 831F0CED2C21819000D6F5BF /* Sargon in Frameworks */ = {isa = PBXBuildFile; productRef = 831F0CEC2C21819000D6F5BF /* Sargon */; }; 831F0CEF2C25728E00D6F5BF /* RadixConnectMobileSessionStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831F0CEE2C25728E00D6F5BF /* RadixConnectMobileSessionStorage.swift */; }; 831F0CF22C25897500D6F5BF /* DappInteractionOriginVerification+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831F0CF12C25897500D6F5BF /* DappInteractionOriginVerification+View.swift */; }; 831F0CF42C294BAA00D6F5BF /* DeepLinkHandlerClient+Live.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831F0CF32C294BAA00D6F5BF /* DeepLinkHandlerClient+Live.swift */; }; @@ -839,7 +834,6 @@ 8397D82D2B46ACB50016365A /* StakeUnitList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8397D82B2B46ACB50016365A /* StakeUnitList.swift */; }; 839B6C542B21D28400402651 /* ExpandableTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 839B6C532B21D28400402651 /* ExpandableTextView.swift */; }; 83AAAC6D2B483D1B00222B64 /* StakeSummaryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83AAAC6B2B483D1B00222B64 /* StakeSummaryView.swift */; }; - 83B783562C1764AE00AA7930 /* Sargon in Frameworks */ = {isa = PBXBuildFile; productRef = 83B783552C1764AE00AA7930 /* Sargon */; }; 83D663B02B271D0100D1AB9E /* TruncationMask.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83D663AF2B271D0100D1AB9E /* TruncationMask.swift */; }; 83D908AD2C931A7100822CC4 /* SargonSecureStorageDriver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83D908AC2C931A7100822CC4 /* SargonSecureStorageDriver.swift */; }; 83DFAF2E2B4E8A51008B70CE /* View+Extra.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83DFAF2D2B4E8A51008B70CE /* View+Extra.swift */; }; @@ -1190,7 +1184,9 @@ A4ECE27A2BEEB01800468BF6 /* CloudBackupClient+Live.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4ECE2762BEEB01800468BF6 /* CloudBackupClient+Live.swift */; }; A4ECE27B2BEEB01800468BF6 /* CloudBackupClient+Test.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4ECE2772BEEB01800468BF6 /* CloudBackupClient+Test.swift */; }; A4F30C942C7CA71400F983D6 /* WithNavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4F30C932C7CA71400F983D6 /* WithNavigationBar.swift */; }; - E60D5E1F2C2EFAA2008BCF1F /* Sargon in Frameworks */ = {isa = PBXBuildFile; productRef = E60D5E1E2C2EFAA2008BCF1F /* Sargon */; }; + E6027F1E2CE7887A0094139A /* Sargon in Frameworks */ = {isa = PBXBuildFile; productRef = E6027F1D2CE7887A0094139A /* Sargon */; }; + E622FF902CE7984B00489BA5 /* DebugFactorInstancesCacheContents+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = E622FF8F2CE7984B00489BA5 /* DebugFactorInstancesCacheContents+View.swift */; }; + E622FF912CE7984B00489BA5 /* DebugFactorInstancesCacheContents.swift in Sources */ = {isa = PBXBuildFile; fileRef = E622FF8E2CE7984B00489BA5 /* DebugFactorInstancesCacheContents.swift */; }; E62449D52AFBA61100272C67 /* Home+AccountRow+Reducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = E62449D32AFBA61100272C67 /* Home+AccountRow+Reducer.swift */; }; E62449D62AFBA61100272C67 /* Home+AccountRow+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = E62449D42AFBA61100272C67 /* Home+AccountRow+View.swift */; }; E62BB7632AEA856300D46DAC /* ImportMnemonicTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E62BB7622AEA856300D46DAC /* ImportMnemonicTests.swift */; }; @@ -1264,7 +1260,6 @@ E7A5AC982C09F44C006CB6EC /* ResetWalletClient+Live.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7A5AC972C09F44C006CB6EC /* ResetWalletClient+Live.swift */; }; E7A5AC9A2C09F453006CB6EC /* ResetWalletClient+Test.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7A5AC992C09F453006CB6EC /* ResetWalletClient+Test.swift */; }; E7A5AC9D2C108F2F006CB6EC /* WalletInteraction+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7A5AC9C2C108F2F006CB6EC /* WalletInteraction+Extensions.swift */; }; - E7AE2D052BF7844300830BAA /* Sargon in Frameworks */ = {isa = PBXBuildFile; productRef = E695F2DD2BECDD7C00761ACE /* Sargon */; }; E7AE2D0A2C05F39800830BAA /* ClaimWallet+Reducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7AE2D092C05F39800830BAA /* ClaimWallet+Reducer.swift */; }; E7AE2D0C2C05F39E00830BAA /* ClaimWallet+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7AE2D0B2C05F39E00830BAA /* ClaimWallet+View.swift */; }; E7AE2D0E2C07359500830BAA /* FullScreenOverlayCoordinator+Reducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7AE2D0D2C07359500830BAA /* FullScreenOverlayCoordinator+Reducer.swift */; }; @@ -2430,6 +2425,8 @@ A4ECE2762BEEB01800468BF6 /* CloudBackupClient+Live.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CloudBackupClient+Live.swift"; sourceTree = ""; }; A4ECE2772BEEB01800468BF6 /* CloudBackupClient+Test.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CloudBackupClient+Test.swift"; sourceTree = ""; }; A4F30C932C7CA71400F983D6 /* WithNavigationBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WithNavigationBar.swift; sourceTree = ""; }; + E622FF8E2CE7984B00489BA5 /* DebugFactorInstancesCacheContents.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugFactorInstancesCacheContents.swift; sourceTree = ""; }; + E622FF8F2CE7984B00489BA5 /* DebugFactorInstancesCacheContents+View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DebugFactorInstancesCacheContents+View.swift"; sourceTree = ""; }; E62449D32AFBA61100272C67 /* Home+AccountRow+Reducer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Home+AccountRow+Reducer.swift"; sourceTree = ""; }; E62449D42AFBA61100272C67 /* Home+AccountRow+View.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Home+AccountRow+View.swift"; sourceTree = ""; }; E62BB7622AEA856300D46DAC /* ImportMnemonicTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImportMnemonicTests.swift; sourceTree = ""; }; @@ -2534,13 +2531,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - E7AE2D052BF7844300830BAA /* Sargon in Frameworks */, 48FFFABE2ADC209100B2B213 /* NukeUI in Frameworks */, 48FFFAE72ADC223300B2B213 /* Overture in Frameworks */, 48FFFA9F2ADC1F2700B2B213 /* KeychainAccess in Frameworks */, 48FFFAF72ADC241A00B2B213 /* Collections in Frameworks */, 48FFFAF92ADC241A00B2B213 /* DequeModule in Frameworks */, - 489FEF912BDD0B80003EC10D /* Sargon in Frameworks */, 48FFFAAB2ADC1FE900B2B213 /* DependenciesAdditions in Frameworks */, 48FFFAA22ADC1F5D00B2B213 /* Algorithms in Frameworks */, 48FFFAC12ADC20C400B2B213 /* JSONPreview in Frameworks */, @@ -2548,10 +2543,7 @@ 48FFFADE2ADC21F500B2B213 /* FileLogging in Frameworks */, 48FFFACF2ADC216400B2B213 /* CollectionConcurrencyKit in Frameworks */, 48FFFAB12ADC203700B2B213 /* WebRTC in Frameworks */, - 5B4E1D1F2CB7FE8E002FAC2E /* Sargon in Frameworks */, - 831F0CED2C21819000D6F5BF /* Sargon in Frameworks */, 48FFFB0D2ADC744700B2B213 /* TextBuilder in Frameworks */, - 5B447E0B2CAAFC2D0063AE39 /* Sargon in Frameworks */, 48FFFB0A2ADC721800B2B213 /* Atomics in Frameworks */, 48FFFB002ADC25A200B2B213 /* BigInt in Frameworks */, A47571FF2B29B0860059A95D /* IOSSecuritySuite in Frameworks */, @@ -2563,15 +2555,13 @@ 48FFFAB72ADC207B00B2B213 /* NavigationTransitions in Frameworks */, 5B634A942C91D2A0004B2FBC /* ScreenshotPreventing in Frameworks */, 48FFFA992ADC1EEC00B2B213 /* AsyncExtensions in Frameworks */, - 83B783562C1764AE00AA7930 /* Sargon in Frameworks */, E63D123D2ADD1FC00001CBB1 /* SwiftUIIntrospect in Frameworks */, E6A0B04B2BF23C7000617DAC /* IdentifiedCollections in Frameworks */, 48FFFABC2ADC209100B2B213 /* NukeExtensions in Frameworks */, A41557502B757C5E0040AD4E /* ComposableArchitecture in Frameworks */, + E6027F1E2CE7887A0094139A /* Sargon in Frameworks */, 48FFFAFD2ADC241A00B2B213 /* HeapModule in Frameworks */, - 48C845C72BEA6DC600F74DA7 /* Sargon in Frameworks */, 48FFFAD52ADC21B900B2B213 /* LegibleError in Frameworks */, - E60D5E1F2C2EFAA2008BCF1F /* Sargon in Frameworks */, 48FFFB082ADC6FD300B2B213 /* SwiftUINavigationCore in Frameworks */, 48FFFAD82ADC21D200B2B213 /* NonEmpty in Frameworks */, 48FFFAE12ADC220F00B2B213 /* Tagged in Frameworks */, @@ -5401,6 +5391,7 @@ 48D5F3852BD8DDB9000DE964 /* Children */ = { isa = PBXGroup; children = ( + E6027F1F2CE797500094139A /* DebugFactorInstancesCacheContents */, 48D5F37B2BD8DDB9000DE964 /* DebugKeychainContents */, 48D5F37E2BD8DDB9000DE964 /* DebugKeychainTest */, 48D5F3812BD8DDB9000DE964 /* DebugManageFactorSourcesFeature */, @@ -6363,6 +6354,15 @@ path = CloudBackupClient; sourceTree = ""; }; + E6027F1F2CE797500094139A /* DebugFactorInstancesCacheContents */ = { + isa = PBXGroup; + children = ( + E622FF8E2CE7984B00489BA5 /* DebugFactorInstancesCacheContents.swift */, + E622FF8F2CE7984B00489BA5 /* DebugFactorInstancesCacheContents+View.swift */, + ); + path = DebugFactorInstancesCacheContents; + sourceTree = ""; + }; E634CA2C2AFD259000C43DB7 /* DebugKeychainContents */ = { isa = PBXGroup; children = ( @@ -7039,14 +7039,9 @@ A47571FE2B29B0860059A95D /* IOSSecuritySuite */, A415574F2B757C5E0040AD4E /* ComposableArchitecture */, 5B1C4FD42BBB0B0C00B9436F /* AppsFlyerLib-Strict */, - E695F2DD2BECDD7C00761ACE /* Sargon */, E6A0B04A2BF23C7000617DAC /* IdentifiedCollections */, - 83B783552C1764AE00AA7930 /* Sargon */, - 831F0CEC2C21819000D6F5BF /* Sargon */, - E60D5E1E2C2EFAA2008BCF1F /* Sargon */, 5B634A932C91D2A0004B2FBC /* ScreenshotPreventing */, - 5B447E0A2CAAFC2D0063AE39 /* Sargon */, - 5B4E1D1E2CB7FE8E002FAC2E /* Sargon */, + E6027F1D2CE7887A0094139A /* Sargon */, ); productName = RadixWallet; productReference = 48CFBC4F2ADC106300E77A5C /* Radix Wallet Dev.app */; @@ -7117,7 +7112,7 @@ 8318BB172BC8403800057BCB /* XCRemoteSwiftPackageReference "swift-custom-dump" */, E6A0B0492BF23C7000617DAC /* XCRemoteSwiftPackageReference "swift-identified-collections" */, 5B634A922C91D2A0004B2FBC /* XCRemoteSwiftPackageReference "ScreenshotPreventing-iOS" */, - 8322256C2CD3B9F8004A1CF4 /* XCRemoteSwiftPackageReference "sargon" */, + E6027F1C2CE7887A0094139A /* XCLocalSwiftPackageReference "../Sargon" */, ); productRefGroup = 48CFBC502ADC106300E77A5C /* Products */; projectDirPath = ""; @@ -7593,6 +7588,8 @@ 48CFC3142ADC10D900E77A5C /* CompletionMigrateOlympiaAccountsToBabylon.swift in Sources */, 8308184E2B9F16AD002D8351 /* TokenPriceClient+Mock.swift in Sources */, 48CFC2852ADC10D900E77A5C /* SubmitTransaction+View.swift in Sources */, + E622FF902CE7984B00489BA5 /* DebugFactorInstancesCacheContents+View.swift in Sources */, + E622FF912CE7984B00489BA5 /* DebugFactorInstancesCacheContents.swift in Sources */, A40815632C7E0D08005E65B9 /* AccountLockerVaultCollectionItemType.swift in Sources */, 48CFC47C2ADC10DA00E77A5C /* TransportProfileClient+Test.swift in Sources */, 48CFC2C92ADC10D900E77A5C /* FungibleResourceAsset+View.swift in Sources */, @@ -8945,6 +8942,13 @@ }; /* End XCConfigurationList section */ +/* Begin XCLocalSwiftPackageReference section */ + E6027F1C2CE7887A0094139A /* XCLocalSwiftPackageReference "../Sargon" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../Sargon; + }; +/* End XCLocalSwiftPackageReference section */ + /* Begin XCRemoteSwiftPackageReference section */ 48FFFA972ADC1EEC00B2B213 /* XCRemoteSwiftPackageReference "AsyncExtensions" */ = { isa = XCRemoteSwiftPackageReference; @@ -9194,14 +9198,6 @@ version = 1.3.0; }; }; - 8322256C2CD3B9F8004A1CF4 /* XCRemoteSwiftPackageReference "sargon" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/radixdlt/sargon"; - requirement = { - kind = exactVersion; - version = 1.1.50; - }; - }; A415574E2B757C5E0040AD4E /* XCRemoteSwiftPackageReference "swift-composable-architecture" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/pointfreeco/swift-composable-architecture"; @@ -9229,14 +9225,6 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 489FEF902BDD0B80003EC10D /* Sargon */ = { - isa = XCSwiftPackageProductDependency; - productName = Sargon; - }; - 48C845C62BEA6DC600F74DA7 /* Sargon */ = { - isa = XCSwiftPackageProductDependency; - productName = Sargon; - }; 48FFFA982ADC1EEC00B2B213 /* AsyncExtensions */ = { isa = XCSwiftPackageProductDependency; package = 48FFFA972ADC1EEC00B2B213 /* XCRemoteSwiftPackageReference "AsyncExtensions" */; @@ -9417,27 +9405,11 @@ package = 5B1C4FD32BBB0B0C00B9436F /* XCRemoteSwiftPackageReference "AppsFlyerFramework-Strict" */; productName = "AppsFlyerLib-Strict"; }; - 5B447E0A2CAAFC2D0063AE39 /* Sargon */ = { - isa = XCSwiftPackageProductDependency; - productName = Sargon; - }; - 5B4E1D1E2CB7FE8E002FAC2E /* Sargon */ = { - isa = XCSwiftPackageProductDependency; - productName = Sargon; - }; 5B634A932C91D2A0004B2FBC /* ScreenshotPreventing */ = { isa = XCSwiftPackageProductDependency; package = 5B634A922C91D2A0004B2FBC /* XCRemoteSwiftPackageReference "ScreenshotPreventing-iOS" */; productName = ScreenshotPreventing; }; - 831F0CEC2C21819000D6F5BF /* Sargon */ = { - isa = XCSwiftPackageProductDependency; - productName = Sargon; - }; - 83B783552C1764AE00AA7930 /* Sargon */ = { - isa = XCSwiftPackageProductDependency; - productName = Sargon; - }; A415574F2B757C5E0040AD4E /* ComposableArchitecture */ = { isa = XCSwiftPackageProductDependency; package = A415574E2B757C5E0040AD4E /* XCRemoteSwiftPackageReference "swift-composable-architecture" */; @@ -9448,7 +9420,7 @@ package = A47571FD2B29B0860059A95D /* XCRemoteSwiftPackageReference "IOSSecuritySuite" */; productName = IOSSecuritySuite; }; - E60D5E1E2C2EFAA2008BCF1F /* Sargon */ = { + E6027F1D2CE7887A0094139A /* Sargon */ = { isa = XCSwiftPackageProductDependency; productName = Sargon; }; @@ -9457,10 +9429,6 @@ package = 48FFFAB22ADC206300B2B213 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */; productName = SwiftUIIntrospect; }; - E695F2DD2BECDD7C00761ACE /* Sargon */ = { - isa = XCSwiftPackageProductDependency; - productName = Sargon; - }; E6A0B04A2BF23C7000617DAC /* IdentifiedCollections */ = { isa = XCSwiftPackageProductDependency; package = E6A0B0492BF23C7000617DAC /* XCRemoteSwiftPackageReference "swift-identified-collections" */; diff --git a/RadixWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/RadixWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 8c2fa3158c..5075818544 100644 --- a/RadixWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/RadixWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "7d3590b225945abb1bc0ab6c684b005c28c64bdc204afcc2d34c3e379ef8a3c8", + "originHash" : "60b889ccc513476448aa6483246b773f242561a612324e9d081205fc3041851f", "pins" : [ { "identity" : "anycodable", @@ -109,15 +109,6 @@ "version" : "11.6.4" } }, - { - "identity" : "sargon", - "kind" : "remoteSourceControl", - "location" : "https://github.com/radixdlt/sargon", - "state" : { - "revision" : "6af408a3252888560a9c401bf3be61512dba1035", - "version" : "1.1.50" - } - }, { "identity" : "screenshotpreventing-ios", "kind" : "remoteSourceControl", diff --git a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift new file mode 100644 index 0000000000..946ef88995 --- /dev/null +++ b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift @@ -0,0 +1,27 @@ +import SwiftUI + +// MARK: - DebugFactorInstancesCacheContents.View +extension DebugFactorInstancesCacheContents { + struct View: SwiftUI.View { + let store: StoreOf + + var body: some SwiftUI.View { + WithPerceptionTracking { + VStack(spacing: .small2) { + loadable(store.factorInstances) { + ProgressView() + } successContent: { factorInstances in + VStack { +// ForEach(factorInstances) { (factorSourceID, instancesForPresetsOfFactor) in +// Text("factorSourceID \(factorSourceID), #\(instancesForPresetsOfFactor.count)derivation presets") +// } + Text("Loaded πŸΆπŸŽ‰πŸ #\(factorInstances.count)") + } + } + } + }.task { + store.send(.view(.task)) + } + } + } +} diff --git a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift new file mode 100644 index 0000000000..2fd20de56e --- /dev/null +++ b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift @@ -0,0 +1,47 @@ +import Sargon + +public typealias Instances = [FactorSourceIDFromHash: [[HierarchicalDeterministicFactorInstance]]] + +// MARK: - DebugFactorInstancesCacheContents +@Reducer +struct DebugFactorInstancesCacheContents: Sendable, FeatureReducer { + @ObservableState + struct State: Sendable, Hashable { + var factorInstances: Loadable = .idle + init() {} + } + + typealias Action = FeatureAction + + enum ViewAction: Sendable, Equatable { + case task + } + + enum InternalAction: Sendable, Equatable { + case loadedInstances(Instances) + } + + var body: some ReducerOf { + Reduce(core) + } + + func reduce(into state: inout State, internalAction: InternalAction) -> Effect { + switch internalAction { + case let .loadedInstances(instances): + state.factorInstances = .success(instances) + return .none + } + } + + func reduce(into state: inout State, viewAction: ViewAction) -> Effect { + switch viewAction { + case .task: + state.factorInstances = .loading + return .run { send in + + let instances = await SargonOS.shared.factorInstancesInCache() + await send(.internal(.loadedInstances(instances))) + } + } + } +} diff --git a/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+Reducer.swift b/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+Reducer.swift index 755aa773bd..726ec7a201 100644 --- a/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+Reducer.swift +++ b/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+Reducer.swift @@ -23,6 +23,7 @@ struct DebugSettingsCoordinator: Sendable, FeatureReducer { case debugUserDefaultsContentsButtonTapped case debugTestKeychainButtonTapped case debugKeychainContentsButtonTapped + case debugFactorInstancesCacheContentsButtonTapped } enum InternalAction: Sendable, Equatable { @@ -36,7 +37,8 @@ struct DebugSettingsCoordinator: Sendable, FeatureReducer { case debugManageFactorSources(DebugManageFactorSources.State) #if DEBUG case debugKeychainTest(DebugKeychainTest.State) - case debugKeychainContents(DebugKeychainContents.State) + case debugKeychainContents(DebugKeychainContents.State) + case debugFactorInstancesCacheContents(DebugFactorInstancesCacheContents.State) #endif // DEBUG } @@ -45,7 +47,8 @@ struct DebugSettingsCoordinator: Sendable, FeatureReducer { case debugInspectProfile(DebugInspectProfile.Action) #if DEBUG case debugKeychainTest(DebugKeychainTest.Action) - case debugKeychainContents(DebugKeychainContents.Action) + case debugKeychainContents(DebugKeychainContents.Action) + case debugFactorInstancesCacheContents(DebugFactorInstancesCacheContents.Action) #endif // DEBUG case debugManageFactorSources(DebugManageFactorSources.Action) } @@ -64,6 +67,9 @@ struct DebugSettingsCoordinator: Sendable, FeatureReducer { Scope(state: /State.debugKeychainContents, action: /Action.debugKeychainContents) { DebugKeychainContents() } + Scope(state: /State.debugFactorInstancesCacheContents, action: /Action.debugFactorInstancesCacheContents) { + DebugFactorInstancesCacheContents() + } #endif // DEBUG Scope(state: /State.debugManageFactorSources, action: /Action.debugManageFactorSources) { DebugManageFactorSources() @@ -110,6 +116,12 @@ struct DebugSettingsCoordinator: Sendable, FeatureReducer { #endif // DEBUG return .none + case .debugFactorInstancesCacheContentsButtonTapped: + #if DEBUG + state.destination = .debugFactorInstancesCacheContents(.init()) + #endif // DEBUG + return .none + case .debugUserDefaultsContentsButtonTapped: state.destination = .debugUserDefaultsContents(.init()) return .none diff --git a/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+View.swift b/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+View.swift index 9d2939b5d5..3fbe6cf336 100644 --- a/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+View.swift +++ b/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+View.swift @@ -65,6 +65,12 @@ extension DebugSettingsCoordinator.View { icon: .systemImage("key"), action: .debugKeychainContentsButtonTapped ), + // ONLY DEBUG EVER + .model( + title: "FactorInstances Cache", + icon: .systemImage("key"), + action: .debugFactorInstancesCacheContentsButtonTapped + ), ] } } @@ -88,7 +94,8 @@ private extension View { .debugUserDefaultsContents(with: destinationStore) #if DEBUG .debugKeychainTest(with: destinationStore) - .debugKeychainContents(with: destinationStore) + .debugKeychainContents(with: destinationStore) + .debugFactorInstancesCacheContents(with: destinationStore) #endif .debugInspectProfile(with: destinationStore) } @@ -126,6 +133,18 @@ private extension View { destination: { DebugKeychainContents.View(store: $0) } ) } + + + private func debugFactorInstancesCacheContents( + with destinationStore: PresentationStoreOf + ) -> some View { + navigationDestination( + store: destinationStore, + state: /DebugSettingsCoordinator.Destination.State.debugFactorInstancesCacheContents, + action: DebugSettingsCoordinator.Destination.Action.debugFactorInstancesCacheContents, + destination: { DebugFactorInstancesCacheContents.View(store: $0) } + ) + } #endif // DEBUG private func factorSources( From e7671f36c469ca6461e5dadc11f65f1cca0e0e1d Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Mon, 18 Nov 2024 19:53:22 +0100 Subject: [PATCH 2/9] working --- RadixWallet/Clients/ProfileStore/ProfileStore.swift | 8 +++++++- .../Sections/Sections+ExecutionSummary.swift | 2 ++ .../Stage1/Stage1MigrateToSargon+Account.swift | 4 ++-- .../Stage2/Atoms/Stage2MigrateToSargon+Persona.swift | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/RadixWallet/Clients/ProfileStore/ProfileStore.swift b/RadixWallet/Clients/ProfileStore/ProfileStore.swift index 558e033fa2..8a5aefa07a 100644 --- a/RadixWallet/Clients/ProfileStore/ProfileStore.swift +++ b/RadixWallet/Clients/ProfileStore/ProfileStore.swift @@ -37,7 +37,13 @@ extension ProfileStore { extension ProfileStore { func createNewProfile() async throws { - try await SargonOS.shared.newWallet() + let shouldPrederiveInstances: Bool + #if DEBUG + shouldPrederiveInstances = true + #else + shouldPrederiveInstances = false + #endif + return try await SargonOS.shared.newWallet(shouldPrederiveInstances: shouldPrederiveInstances) } func finishOnboarding( diff --git a/RadixWallet/Features/InteractionReview/Sections/Sections+ExecutionSummary.swift b/RadixWallet/Features/InteractionReview/Sections/Sections+ExecutionSummary.swift index 08d0cf5423..d52fd41dae 100644 --- a/RadixWallet/Features/InteractionReview/Sections/Sections+ExecutionSummary.swift +++ b/RadixWallet/Features/InteractionReview/Sections/Sections+ExecutionSummary.swift @@ -273,6 +273,8 @@ extension InteractionReview.Sections { accountDepositSetting: accountDepositSetting, accountDepositExceptions: accountDepositExceptions ) + case .some(.deleteAccounts(accountAddresses: let accountAddresses)): + fatalError() } } diff --git a/RadixWallet/MIGRATE_TO_SARGON/Stage1/Stage1MigrateToSargon+Account.swift b/RadixWallet/MIGRATE_TO_SARGON/Stage1/Stage1MigrateToSargon+Account.swift index 6c0e643171..095ae7ba46 100644 --- a/RadixWallet/MIGRATE_TO_SARGON/Stage1/Stage1MigrateToSargon+Account.swift +++ b/RadixWallet/MIGRATE_TO_SARGON/Stage1/Stage1MigrateToSargon+Account.swift @@ -42,11 +42,11 @@ extension Account { } mutating func hide() { - flags.append(.deletedByUser) + flags.append(.hiddenByUser) } mutating func unhide() { - entityFlags.remove(.deletedByUser) + entityFlags.remove(.hiddenByUser) } } diff --git a/RadixWallet/MIGRATE_TO_SARGON/Stage2/Atoms/Stage2MigrateToSargon+Persona.swift b/RadixWallet/MIGRATE_TO_SARGON/Stage2/Atoms/Stage2MigrateToSargon+Persona.swift index e1bf1b54cd..7c5d6d0e2c 100644 --- a/RadixWallet/MIGRATE_TO_SARGON/Stage2/Atoms/Stage2MigrateToSargon+Persona.swift +++ b/RadixWallet/MIGRATE_TO_SARGON/Stage2/Atoms/Stage2MigrateToSargon+Persona.swift @@ -3,11 +3,11 @@ import Sargon extension Persona { mutating func hide() { - entityFlags.append(.deletedByUser) + entityFlags.append(.hiddenByUser) } mutating func unhide() { - entityFlags.remove(.deletedByUser) + entityFlags.remove(.hiddenByUser) } } From ade55e247b719c40f7229c0c60f5dc1b8e5b57c7 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Mon, 18 Nov 2024 20:37:43 +0100 Subject: [PATCH 3/9] WIP --- ...bugFactorInstancesCacheContents+View.swift | 77 +++++++++++++++++-- 1 file changed, 70 insertions(+), 7 deletions(-) diff --git a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift index 946ef88995..3f43f16e7f 100644 --- a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift +++ b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift @@ -1,4 +1,5 @@ import SwiftUI +import Sargon // MARK: - DebugFactorInstancesCacheContents.View extension DebugFactorInstancesCacheContents { @@ -10,18 +11,80 @@ extension DebugFactorInstancesCacheContents { VStack(spacing: .small2) { loadable(store.factorInstances) { ProgressView() - } successContent: { factorInstances in - VStack { -// ForEach(factorInstances) { (factorSourceID, instancesForPresetsOfFactor) in -// Text("factorSourceID \(factorSourceID), #\(instancesForPresetsOfFactor.count)derivation presets") -// } - Text("Loaded πŸΆπŸŽ‰πŸ #\(factorInstances.count)") - } + } successContent: { instances in + content(instances: instances) } } }.task { store.send(.view(.task)) } } + + @ViewBuilder + private func content(instances: Instances) -> some SwiftUI.View { + ScrollView { + VStack(alignment: .leading) { + ForEach(Array(instances.keys), id: \.self) { (key: FactorSourceIDFromHash) in + Section("Source `\(key.idPrefix())`") { + let listOfList: [[HierarchicalDeterministicFactorInstance]] = instances[key]! + ForEach(listOfList, id: \.self) { (instancesForFactorForPath: [HierarchicalDeterministicFactorInstance]) in + if let firstInstance = instancesForFactorForPath.first { + Section(firstInstance.indexAgnosticPath()) { + ForEach(instancesForFactorForPath, id: \.self) { (instance: HierarchicalDeterministicFactorInstance) in + VStack(alignment: .leading) { + Text("Index `\(instance.derivationEntityIndex())`") + + Text("PublicKey `\(instance.publicKeySuffix())`") + } + .border(Color.gray, width: 2) + .padding() + } + } + .padding() + } + + } + } + .padding() + } + } + } + } } } +extension FactorSourceIDFromHash { + fileprivate func idPrefix() -> String { + String(toString().prefix(10)) + } +} +extension HierarchicalDeterministicFactorInstance { + fileprivate func indexAgnosticPath() -> String { + publicKey.derivationPath.indexAgnosticPath() + } + fileprivate func derivationEntityIndex() -> String { + let index = publicKey.derivationPath.lastPathComponent.indexInLocalKeySpace() + return String(reflecting: index) + } + fileprivate func publicKeySuffix() -> String { + String(publicKey().suffix(6)) + } + fileprivate func publicKey() -> String { + publicKey.publicKey.hex + } +} +extension DerivationPath { + fileprivate func indexAgnosticPath() -> String { + let components = self.path.components + let network = components[2] + let entityKind = components[3] + let keyKind = components[4] + let entityIndex = components[5] + let keySpace = entityIndex.keySpace + let keySpaceStr = switch keySpace { + case .securified: "S" + case let .unsecurified(isHardened): isHardened ? "H" : "" + } + return "\(network)/\(entityKind)/\(keyKind)/\(keySpaceStr)?" + + } +} From e2b59b4a0d11f4acbefc4350b9d224932be8f559 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Tue, 19 Nov 2024 09:36:55 +0100 Subject: [PATCH 4/9] WIP --- .../DebugFactorInstancesCacheContents+View.swift | 4 ++++ .../DebugFactorInstancesCacheContents.swift | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift index 3f43f16e7f..0a709a9d7d 100644 --- a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift +++ b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift @@ -9,6 +9,10 @@ extension DebugFactorInstancesCacheContents { var body: some SwiftUI.View { WithPerceptionTracking { VStack(spacing: .small2) { + Button("Delete Cache File") { + store.send(.view(.deleteButtonTapped)) + } + .buttonStyle(.primaryRectangular(isDestructive: true)) loadable(store.factorInstances) { ProgressView() } successContent: { instances in diff --git a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift index 2fd20de56e..47e8d645fc 100644 --- a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift +++ b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift @@ -15,10 +15,12 @@ struct DebugFactorInstancesCacheContents: Sendable, FeatureReducer { enum ViewAction: Sendable, Equatable { case task + case deleteButtonTapped } enum InternalAction: Sendable, Equatable { case loadedInstances(Instances) + case failedToDelete(String) } var body: some ReducerOf { @@ -27,6 +29,12 @@ struct DebugFactorInstancesCacheContents: Sendable, FeatureReducer { func reduce(into state: inout State, internalAction: InternalAction) -> Effect { switch internalAction { + case let .failedToDelete(error): + struct Err: LocalizedError { + let localizedDescription: String + } + state.factorInstances = .failure(Err(localizedDescription: error)) + return .none case let .loadedInstances(instances): state.factorInstances = .success(instances) return .none @@ -35,6 +43,13 @@ struct DebugFactorInstancesCacheContents: Sendable, FeatureReducer { func reduce(into state: inout State, viewAction: ViewAction) -> Effect { switch viewAction { + case .deleteButtonTapped: + return .run { send in + try await FileSystem.shared.deleteFactorInstancesCache() + await send(.internal(.loadedInstances([:]))) + } catch: { error, send in + await send(.internal(.failedToDelete(error.localizedDescription))) + } case .task: state.factorInstances = .loading return .run { send in From ed289f98b070ee7f4d7b6555f009d893373f96ab Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Tue, 19 Nov 2024 12:36:53 +0100 Subject: [PATCH 5/9] wip --- ...bugFactorInstancesCacheContents+View.swift | 104 +++++++----------- .../DebugFactorInstancesCacheContents.swift | 39 ++++--- 2 files changed, 61 insertions(+), 82 deletions(-) diff --git a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift index 0a709a9d7d..341aa5e20a 100644 --- a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift +++ b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift @@ -1,94 +1,74 @@ -import SwiftUI import Sargon +import SwiftUI // MARK: - DebugFactorInstancesCacheContents.View extension DebugFactorInstancesCacheContents { - struct View: SwiftUI.View { - let store: StoreOf - - var body: some SwiftUI.View { - WithPerceptionTracking { - VStack(spacing: .small2) { + struct View: SwiftUI.View { + let store: StoreOf + + var body: some SwiftUI.View { + WithPerceptionTracking { + VStack(spacing: .small2) { Button("Delete Cache File") { store.send(.view(.deleteButtonTapped)) } .buttonStyle(.primaryRectangular(isDestructive: true)) - loadable(store.factorInstances) { - ProgressView() - } successContent: { instances in + loadable(store.factorInstances) { + ProgressView() + } successContent: { instances in content(instances: instances) - } - } - }.task { - store.send(.view(.task)) - } - } - + } + } + .padding() + .navigationTitle("FactorInstances cache") + }.task { + store.send(.view(.task)) + } + } + @ViewBuilder private func content(instances: Instances) -> some SwiftUI.View { ScrollView { VStack(alignment: .leading) { ForEach(Array(instances.keys), id: \.self) { (key: FactorSourceIDFromHash) in - Section("Source `\(key.idPrefix())`") { - let listOfList: [[HierarchicalDeterministicFactorInstance]] = instances[key]! - ForEach(listOfList, id: \.self) { (instancesForFactorForPath: [HierarchicalDeterministicFactorInstance]) in + Section { + let listOfList: [[FactorInstanceForDebugPurposes]] = instances[key]! + ForEach(listOfList, id: \.self) { (instancesForFactorForPath: [FactorInstanceForDebugPurposes]) in if let firstInstance = instancesForFactorForPath.first { - Section(firstInstance.indexAgnosticPath()) { - ForEach(instancesForFactorForPath, id: \.self) { (instance: HierarchicalDeterministicFactorInstance) in + Section { + ForEach(instancesForFactorForPath, id: \.self) { (instance: FactorInstanceForDebugPurposes) in VStack(alignment: .leading) { - Text("Index `\(instance.derivationEntityIndex())`") - - Text("PublicKey `\(instance.publicKeySuffix())`") + Text("Index `\(instance.derivationEntityIndex)`") + + Text("PublicKey `\(String(reflecting: instance.publicKeyHex.prefix(8)))`") } - .border(Color.gray, width: 2) - .padding() + .frame(maxWidth: .infinity) + .padding(.horizontal, .medium3) + .padding(.vertical, .small2) + .border(Color.gray, width: 1) + } + } header: { + VStack { + Text("Agnostic `\(firstInstance.indexAgnosticDerivationPath)`").font(.title) + Text("#\(instancesForFactorForPath.count) instances") } + .padding() } - .padding() } - } + } header: { + Text("Source `\(key.idPrefix())`") + .font(.largeTitle) } - .padding() } } } } - } + } } + extension FactorSourceIDFromHash { fileprivate func idPrefix() -> String { String(toString().prefix(10)) } } -extension HierarchicalDeterministicFactorInstance { - fileprivate func indexAgnosticPath() -> String { - publicKey.derivationPath.indexAgnosticPath() - } - fileprivate func derivationEntityIndex() -> String { - let index = publicKey.derivationPath.lastPathComponent.indexInLocalKeySpace() - return String(reflecting: index) - } - fileprivate func publicKeySuffix() -> String { - String(publicKey().suffix(6)) - } - fileprivate func publicKey() -> String { - publicKey.publicKey.hex - } -} -extension DerivationPath { - fileprivate func indexAgnosticPath() -> String { - let components = self.path.components - let network = components[2] - let entityKind = components[3] - let keyKind = components[4] - let entityIndex = components[5] - let keySpace = entityIndex.keySpace - let keySpaceStr = switch keySpace { - case .securified: "S" - case let .unsecurified(isHardened): isHardened ? "H" : "" - } - return "\(network)/\(entityKind)/\(keyKind)/\(keySpaceStr)?" - - } -} diff --git a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift index 47e8d645fc..086bcb4f36 100644 --- a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift +++ b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift @@ -1,13 +1,13 @@ import Sargon -public typealias Instances = [FactorSourceIDFromHash: [[HierarchicalDeterministicFactorInstance]]] +public typealias Instances = [FactorSourceIDFromHash: [[FactorInstanceForDebugPurposes]]] // MARK: - DebugFactorInstancesCacheContents @Reducer struct DebugFactorInstancesCacheContents: Sendable, FeatureReducer { @ObservableState struct State: Sendable, Hashable { - var factorInstances: Loadable = .idle + var factorInstances: Loadable = .idle init() {} } @@ -17,29 +17,29 @@ struct DebugFactorInstancesCacheContents: Sendable, FeatureReducer { case task case deleteButtonTapped } - - enum InternalAction: Sendable, Equatable { - case loadedInstances(Instances) + + enum InternalAction: Sendable, Equatable { + case loadedInstances(Instances) case failedToDelete(String) - } + } var body: some ReducerOf { Reduce(core) } - - func reduce(into state: inout State, internalAction: InternalAction) -> Effect { - switch internalAction { + + func reduce(into state: inout State, internalAction: InternalAction) -> Effect { + switch internalAction { case let .failedToDelete(error): struct Err: LocalizedError { let localizedDescription: String } state.factorInstances = .failure(Err(localizedDescription: error)) return .none - case let .loadedInstances(instances): - state.factorInstances = .success(instances) - return .none - } - } + case let .loadedInstances(instances): + state.factorInstances = .success(instances) + return .none + } + } func reduce(into state: inout State, viewAction: ViewAction) -> Effect { switch viewAction { @@ -51,12 +51,11 @@ struct DebugFactorInstancesCacheContents: Sendable, FeatureReducer { await send(.internal(.failedToDelete(error.localizedDescription))) } case .task: - state.factorInstances = .loading - return .run { send in - - let instances = await SargonOS.shared.factorInstancesInCache() - await send(.internal(.loadedInstances(instances))) - } + state.factorInstances = .loading + return .run { send in + let instances = await SargonOS.shared.debugFactorInstancesInCache() + await send(.internal(.loadedInstances(instances))) + } } } } From 5fee8e70280f05cf5ef4b4f17deff59c37189001 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Mon, 20 Jan 2025 10:01:55 +0100 Subject: [PATCH 6/9] [no ci] wip --- RadixWallet.xcodeproj/project.pbxproj | 27 ++++++++++++------- .../xcshareddata/swiftpm/Package.resolved | 11 +++++++- .../LedgerHardwareWalletClient+Live.swift | 2 +- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/RadixWallet.xcodeproj/project.pbxproj b/RadixWallet.xcodeproj/project.pbxproj index 8be61a3468..0e9691daf2 100644 --- a/RadixWallet.xcodeproj/project.pbxproj +++ b/RadixWallet.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 60; + objectVersion = 56; objects = { /* Begin PBXBuildFile section */ @@ -1203,6 +1203,7 @@ E66DCC402BD93EC000547CF4 /* Stage1MigrateToSargon+Header.swift in Sources */ = {isa = PBXBuildFile; fileRef = E66DCC3F2BD93EC000547CF4 /* Stage1MigrateToSargon+Header.swift */; }; E66EEB9B2B06694E007624BC /* RecoverWalletWithoutProfileStart+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = E66EEB992B06694E007624BC /* RecoverWalletWithoutProfileStart+View.swift */; }; E66EEB9C2B06694E007624BC /* RecoverWalletWithoutProfileStart.swift in Sources */ = {isa = PBXBuildFile; fileRef = E66EEB9A2B06694E007624BC /* RecoverWalletWithoutProfileStart.swift */; }; + E677C1512D3E47F900952E29 /* Sargon in Frameworks */ = {isa = PBXBuildFile; productRef = E677C1502D3E47F900952E29 /* Sargon */; }; E67F14452AE029BA00738BE1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E67F14442AE029BA00738BE1 /* Assets.xcassets */; }; E68878592BDBFD42003F3393 /* Stage2MigrateToSargon+LedgerHardwareWalletFactorSource+New.swift in Sources */ = {isa = PBXBuildFile; fileRef = E68878582BDBFD42003F3393 /* Stage2MigrateToSargon+LedgerHardwareWalletFactorSource+New.swift */; }; E6A0B04B2BF23C7000617DAC /* IdentifiedCollections in Frameworks */ = {isa = PBXBuildFile; productRef = E6A0B04A2BF23C7000617DAC /* IdentifiedCollections */; }; @@ -2573,6 +2574,7 @@ 48FFFABA2ADC209100B2B213 /* Nuke in Frameworks */, 48FFFAE42ADC222100B2B213 /* Validated in Frameworks */, 48FFFAED2ADC226B00B2B213 /* CodeScanner in Frameworks */, + E677C1512D3E47F900952E29 /* Sargon in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -7042,6 +7044,7 @@ E6A0B04A2BF23C7000617DAC /* IdentifiedCollections */, 5B634A932C91D2A0004B2FBC /* ScreenshotPreventing */, E6027F1D2CE7887A0094139A /* Sargon */, + E677C1502D3E47F900952E29 /* Sargon */, ); productName = RadixWallet; productReference = 48CFBC4F2ADC106300E77A5C /* Radix Wallet Dev.app */; @@ -7112,7 +7115,7 @@ 8318BB172BC8403800057BCB /* XCRemoteSwiftPackageReference "swift-custom-dump" */, E6A0B0492BF23C7000617DAC /* XCRemoteSwiftPackageReference "swift-identified-collections" */, 5B634A922C91D2A0004B2FBC /* XCRemoteSwiftPackageReference "ScreenshotPreventing-iOS" */, - E6027F1C2CE7887A0094139A /* XCLocalSwiftPackageReference "../Sargon" */, + E677C14F2D3E47F900952E29 /* XCRemoteSwiftPackageReference "sargon" */, ); productRefGroup = 48CFBC502ADC106300E77A5C /* Products */; projectDirPath = ""; @@ -8942,13 +8945,6 @@ }; /* End XCConfigurationList section */ -/* Begin XCLocalSwiftPackageReference section */ - E6027F1C2CE7887A0094139A /* XCLocalSwiftPackageReference "../Sargon" */ = { - isa = XCLocalSwiftPackageReference; - relativePath = ../Sargon; - }; -/* End XCLocalSwiftPackageReference section */ - /* Begin XCRemoteSwiftPackageReference section */ 48FFFA972ADC1EEC00B2B213 /* XCRemoteSwiftPackageReference "AsyncExtensions" */ = { isa = XCRemoteSwiftPackageReference; @@ -9214,6 +9210,14 @@ version = 1.9.11; }; }; + E677C14F2D3E47F900952E29 /* XCRemoteSwiftPackageReference "sargon" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/radixdlt/sargon"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 1.1.109; + }; + }; E6A0B0492BF23C7000617DAC /* XCRemoteSwiftPackageReference "swift-identified-collections" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/pointfreeco/swift-identified-collections"; @@ -9429,6 +9433,11 @@ package = 48FFFAB22ADC206300B2B213 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */; productName = SwiftUIIntrospect; }; + E677C1502D3E47F900952E29 /* Sargon */ = { + isa = XCSwiftPackageProductDependency; + package = E677C14F2D3E47F900952E29 /* XCRemoteSwiftPackageReference "sargon" */; + productName = Sargon; + }; E6A0B04A2BF23C7000617DAC /* IdentifiedCollections */ = { isa = XCSwiftPackageProductDependency; package = E6A0B0492BF23C7000617DAC /* XCRemoteSwiftPackageReference "swift-identified-collections" */; diff --git a/RadixWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/RadixWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 5075818544..54e6fc9399 100644 --- a/RadixWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/RadixWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "60b889ccc513476448aa6483246b773f242561a612324e9d081205fc3041851f", + "originHash" : "4eb650ade57061cd1cf989ce8f615547774e9303f591ff57a76f3f2c04cdbd07", "pins" : [ { "identity" : "anycodable", @@ -109,6 +109,15 @@ "version" : "11.6.4" } }, + { + "identity" : "sargon", + "kind" : "remoteSourceControl", + "location" : "https://github.com/radixdlt/sargon", + "state" : { + "revision" : "807564dba4dc6947c62677208e920ecbf88bd82e", + "version" : "1.1.109" + } + }, { "identity" : "screenshotpreventing-ios", "kind" : "remoteSourceControl", diff --git a/RadixWallet/Clients/LedgerHardwareWalletClient/LedgerHardwareWalletClient+Live.swift b/RadixWallet/Clients/LedgerHardwareWalletClient/LedgerHardwareWalletClient+Live.swift index a3a6a72ae3..4fba313081 100644 --- a/RadixWallet/Clients/LedgerHardwareWalletClient/LedgerHardwareWalletClient+Live.swift +++ b/RadixWallet/Clients/LedgerHardwareWalletClient/LedgerHardwareWalletClient+Live.swift @@ -216,7 +216,7 @@ extension LedgerHardwareWalletFactorSource { } return P2P.LedgerHardwareWallet.LedgerDevice( - name: NonEmptyString(maybeString: hint.name), + name: NonEmptyString(maybeString: hint.label), id: id.body.data.data.hex, model: model ) From 0906e06ee7e9358ee37c3d312db3481722d55579 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Mon, 20 Jan 2025 10:32:47 +0100 Subject: [PATCH 7/9] merge --- RadixWallet.xcodeproj/project.pbxproj | 61 ++++++------------- .../xcshareddata/swiftpm/Package.resolved | 11 +--- .../Clients/ProfileStore/ProfileStore.swift | 8 +-- .../DebugSettingsCoordinator+Reducer.swift | 36 ++++++----- 4 files changed, 44 insertions(+), 72 deletions(-) diff --git a/RadixWallet.xcodeproj/project.pbxproj b/RadixWallet.xcodeproj/project.pbxproj index 602e47ee18..59d2d55c81 100644 --- a/RadixWallet.xcodeproj/project.pbxproj +++ b/RadixWallet.xcodeproj/project.pbxproj @@ -666,7 +666,6 @@ 48FFFA9F2ADC1F2700B2B213 /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = 48FFFA9E2ADC1F2700B2B213 /* KeychainAccess */; }; 48FFFAA22ADC1F5D00B2B213 /* Algorithms in Frameworks */ = {isa = PBXBuildFile; productRef = 48FFFAA12ADC1F5D00B2B213 /* Algorithms */; }; 48FFFAA52ADC1F9600B2B213 /* AsyncAlgorithms in Frameworks */ = {isa = PBXBuildFile; productRef = 48FFFAA42ADC1F9600B2B213 /* AsyncAlgorithms */; }; - 48FFFAA82ADC1FBE00B2B213 /* Atomics in Frameworks */ = {isa = PBXBuildFile; productRef = 48FFFAA72ADC1FBE00B2B213 /* Atomics */; }; 48FFFAAB2ADC1FE900B2B213 /* DependenciesAdditions in Frameworks */ = {isa = PBXBuildFile; productRef = 48FFFAAA2ADC1FE900B2B213 /* DependenciesAdditions */; }; 48FFFAB12ADC203700B2B213 /* WebRTC in Frameworks */ = {isa = PBXBuildFile; productRef = 48FFFAB02ADC203700B2B213 /* WebRTC */; }; 48FFFABA2ADC209100B2B213 /* Nuke in Frameworks */ = {isa = PBXBuildFile; productRef = 48FFFAB92ADC209100B2B213 /* Nuke */; }; @@ -690,7 +689,6 @@ 48FFFAF92ADC241A00B2B213 /* DequeModule in Frameworks */ = {isa = PBXBuildFile; productRef = 48FFFAF82ADC241A00B2B213 /* DequeModule */; }; 48FFFAFB2ADC241A00B2B213 /* HashTreeCollections in Frameworks */ = {isa = PBXBuildFile; productRef = 48FFFAFA2ADC241A00B2B213 /* HashTreeCollections */; }; 48FFFAFD2ADC241A00B2B213 /* HeapModule in Frameworks */ = {isa = PBXBuildFile; productRef = 48FFFAFC2ADC241A00B2B213 /* HeapModule */; }; - 48FFFB0A2ADC721800B2B213 /* Atomics in Frameworks */ = {isa = PBXBuildFile; productRef = 48FFFB092ADC721800B2B213 /* Atomics */; }; 5B03E3CF2CC1223000E10A64 /* DisplayMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B03E3CE2CC1222D00E10A64 /* DisplayMode.swift */; }; 5B03E3D12CC127B100E10A64 /* RawManifestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B03E3D02CC127B100E10A64 /* RawManifestView.swift */; }; 5B03E3D32CC141D100E10A64 /* InteractionReview+Extra.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B03E3D22CC141C200E10A64 /* InteractionReview+Extra.swift */; }; @@ -782,7 +780,6 @@ 5B92AAC52D2ED0BE00486A9B /* ChooseFactorSourceKind+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B92AAC32D2ED0BE00486A9B /* ChooseFactorSourceKind+View.swift */; }; 5B92AAC82D302A0E00486A9B /* ChangeMainFactorSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B92AAC62D302A0E00486A9B /* ChangeMainFactorSource.swift */; }; 5B92AAC92D302A0E00486A9B /* ChangeMainFactorSource+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B92AAC72D302A0E00486A9B /* ChangeMainFactorSource+View.swift */; }; - 5B92AACC2D314CC400486A9B /* Sargon in Frameworks */ = {isa = PBXBuildFile; productRef = 5B92AACB2D314CC400486A9B /* Sargon */; }; 5B96DD372BD917B300722882 /* Text+Extra.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B96DD362BD917B300722882 /* Text+Extra.swift */; }; 5B9846BD2BBD5C8800E814F3 /* SensitiveInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5B9846BC2BBD5C8800E814F3 /* SensitiveInfo.plist */; }; 5B9846C02BBD5F0800E814F3 /* SensitiveInfoClient+Interface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B9846BF2BBD5F0800E814F3 /* SensitiveInfoClient+Interface.swift */; }; @@ -1214,7 +1211,6 @@ E66DCC402BD93EC000547CF4 /* Stage1MigrateToSargon+Header.swift in Sources */ = {isa = PBXBuildFile; fileRef = E66DCC3F2BD93EC000547CF4 /* Stage1MigrateToSargon+Header.swift */; }; E66EEB9B2B06694E007624BC /* RecoverWalletWithoutProfileStart+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = E66EEB992B06694E007624BC /* RecoverWalletWithoutProfileStart+View.swift */; }; E66EEB9C2B06694E007624BC /* RecoverWalletWithoutProfileStart.swift in Sources */ = {isa = PBXBuildFile; fileRef = E66EEB9A2B06694E007624BC /* RecoverWalletWithoutProfileStart.swift */; }; - E677C1512D3E47F900952E29 /* Sargon in Frameworks */ = {isa = PBXBuildFile; productRef = E677C1502D3E47F900952E29 /* Sargon */; }; E67F14452AE029BA00738BE1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E67F14442AE029BA00738BE1 /* Assets.xcassets */; }; E68878592BDBFD42003F3393 /* Stage2MigrateToSargon+LedgerHardwareWalletFactorSource+New.swift in Sources */ = {isa = PBXBuildFile; fileRef = E68878582BDBFD42003F3393 /* Stage2MigrateToSargon+LedgerHardwareWalletFactorSource+New.swift */; }; E6A0B04D2BF23D6E00617DAC /* IdentifiedArrayOf+Mutation+Position.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A0B04C2BF23D6E00617DAC /* IdentifiedArrayOf+Mutation+Position.swift */; }; @@ -1222,6 +1218,7 @@ E6A2D9E52AFA6C1E001857EC /* AccountWithInfoHolder.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A2D9E42AFA6C1E001857EC /* AccountWithInfoHolder.swift */; }; E6A2D9E72AFA7132001857EC /* Mnemonics+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A2D9E62AFA7132001857EC /* Mnemonics+Utils.swift */; }; E6A98FA82AE15324003953E2 /* BuildConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A98FA72AE15324003953E2 /* BuildConfiguration.swift */; }; + E6BD41012D3E4A1B00D210DF /* Sargon in Frameworks */ = {isa = PBXBuildFile; productRef = E6BD41002D3E4A1B00D210DF /* Sargon */; }; E6DBA3192ADEBFB300A38425 /* PackagesEncodingDecodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6DBA25A2ADEBFB200A38425 /* PackagesEncodingDecodingTests.swift */; }; E6DBA31A2ADEBFB300A38425 /* DataChannelClientTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6DBA25B2ADEBFB200A38425 /* DataChannelClientTests.swift */; }; E6DBA31C2ADEBFB300A38425 /* RadixConnectE2E.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6DBA25F2ADEBFB200A38425 /* RadixConnectE2E.swift */; }; @@ -2615,31 +2612,27 @@ 48FFFADE2ADC21F500B2B213 /* FileLogging in Frameworks */, 48FFFACF2ADC216400B2B213 /* CollectionConcurrencyKit in Frameworks */, 48FFFAB12ADC203700B2B213 /* WebRTC in Frameworks */, - 48FFFB0A2ADC721800B2B213 /* Atomics in Frameworks */, A47571FF2B29B0860059A95D /* IOSSecuritySuite in Frameworks */, 48FFFAFB2ADC241A00B2B213 /* HashTreeCollections in Frameworks */, 48FFFAC52ADC211700B2B213 /* JSONTesting in Frameworks */, 5B1C4FD52BBB0B0C00B9436F /* AppsFlyerLib-Strict in Frameworks */, 5B634A942C91D2A0004B2FBC /* ScreenshotPreventing in Frameworks */, + E6BD41012D3E4A1B00D210DF /* Sargon in Frameworks */, 48FFFA992ADC1EEC00B2B213 /* AsyncExtensions in Frameworks */, E63D123D2ADD1FC00001CBB1 /* SwiftUIIntrospect in Frameworks */, 48FFFABC2ADC209100B2B213 /* NukeExtensions in Frameworks */, A41557502B757C5E0040AD4E /* ComposableArchitecture in Frameworks */, - E6027F1E2CE7887A0094139A /* Sargon in Frameworks */, 48FFFAFD2ADC241A00B2B213 /* HeapModule in Frameworks */, 48FFFAD52ADC21B900B2B213 /* LegibleError in Frameworks */, 48FFFAD82ADC21D200B2B213 /* NonEmpty in Frameworks */, 48FFFAE12ADC220F00B2B213 /* Tagged in Frameworks */, 48FFFAD22ADC218400B2B213 /* Either in Frameworks */, 48FFFAA52ADC1F9600B2B213 /* AsyncAlgorithms in Frameworks */, - 48FFFAA82ADC1FBE00B2B213 /* Atomics in Frameworks */, - 5B92AACC2D314CC400486A9B /* Sargon in Frameworks */, 48FFFAF02ADC229900B2B213 /* AnyCodable in Frameworks */, 48FFFAF52ADC241A00B2B213 /* BitCollections in Frameworks */, 48FFFABA2ADC209100B2B213 /* Nuke in Frameworks */, 48FFFAE42ADC222100B2B213 /* Validated in Frameworks */, 48FFFAED2ADC226B00B2B213 /* CodeScanner in Frameworks */, - E677C1512D3E47F900952E29 /* Sargon in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -7215,7 +7208,6 @@ 48FFFA9E2ADC1F2700B2B213 /* KeychainAccess */, 48FFFAA12ADC1F5D00B2B213 /* Algorithms */, 48FFFAA42ADC1F9600B2B213 /* AsyncAlgorithms */, - 48FFFAA72ADC1FBE00B2B213 /* Atomics */, 48FFFAAA2ADC1FE900B2B213 /* DependenciesAdditions */, 48FFFAB02ADC203700B2B213 /* WebRTC */, 48FFFAB92ADC209100B2B213 /* Nuke */, @@ -7238,13 +7230,12 @@ 48FFFAF82ADC241A00B2B213 /* DequeModule */, 48FFFAFA2ADC241A00B2B213 /* HashTreeCollections */, 48FFFAFC2ADC241A00B2B213 /* HeapModule */, - 48FFFB092ADC721800B2B213 /* Atomics */, E63D123C2ADD1FC00001CBB1 /* SwiftUIIntrospect */, A47571FE2B29B0860059A95D /* IOSSecuritySuite */, A415574F2B757C5E0040AD4E /* ComposableArchitecture */, 5B1C4FD42BBB0B0C00B9436F /* AppsFlyerLib-Strict */, 5B634A932C91D2A0004B2FBC /* ScreenshotPreventing */, - 5B92AACB2D314CC400486A9B /* Sargon */, + E6BD41002D3E4A1B00D210DF /* Sargon */, ); productName = RadixWallet; productReference = 48CFBC4F2ADC106300E77A5C /* Radix Wallet Dev.app */; @@ -7285,7 +7276,6 @@ 48FFFA9D2ADC1F2700B2B213 /* XCRemoteSwiftPackageReference "KeychainAccess" */, 48FFFAA02ADC1F5D00B2B213 /* XCRemoteSwiftPackageReference "swift-algorithms" */, 48FFFAA32ADC1F9600B2B213 /* XCRemoteSwiftPackageReference "swift-async-algorithms" */, - 48FFFAA62ADC1FBE00B2B213 /* XCRemoteSwiftPackageReference "swift-atomics" */, 48FFFAA92ADC1FE900B2B213 /* XCRemoteSwiftPackageReference "swift-dependencies-additions" */, 48FFFAAF2ADC203700B2B213 /* XCRemoteSwiftPackageReference "WebRTC" */, 48FFFAB22ADC206300B2B213 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */, @@ -7308,7 +7298,7 @@ 5B1C4FD32BBB0B0C00B9436F /* XCRemoteSwiftPackageReference "AppsFlyerFramework-Strict" */, 8318BB172BC8403800057BCB /* XCRemoteSwiftPackageReference "swift-custom-dump" */, 5B634A922C91D2A0004B2FBC /* XCRemoteSwiftPackageReference "ScreenshotPreventing-iOS" */, - 5B2A0D7E2D3559100049C702 /* XCRemoteSwiftPackageReference "sargon" */, + E6BD40FF2D3E4A1B00D210DF /* XCRemoteSwiftPackageReference "sargon" */, ); productRefGroup = 48CFBC502ADC106300E77A5C /* Products */; projectDirPath = ""; @@ -9211,14 +9201,6 @@ version = 0.1.0; }; }; - 48FFFAA62ADC1FBE00B2B213 /* XCRemoteSwiftPackageReference "swift-atomics" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/apple/swift-atomics.git"; - requirement = { - kind = exactVersion; - version = 1.1.0; - }; - }; 48FFFAA92ADC1FE900B2B213 /* XCRemoteSwiftPackageReference "swift-dependencies-additions" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/tgrapperon/swift-dependencies-additions"; @@ -9363,14 +9345,6 @@ version = 6.13.2; }; }; - 5B2A0D7E2D3559100049C702 /* XCRemoteSwiftPackageReference "sargon" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/radixdlt/sargon/"; - requirement = { - kind = exactVersion; - version = 1.1.106; - }; - }; 5B634A922C91D2A0004B2FBC /* XCRemoteSwiftPackageReference "ScreenshotPreventing-iOS" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/Sajjon/ScreenshotPreventing-iOS"; @@ -9403,6 +9377,14 @@ version = 1.9.11; }; }; + E6BD40FF2D3E4A1B00D210DF /* XCRemoteSwiftPackageReference "sargon" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/radixdlt/sargon"; + requirement = { + kind = exactVersion; + version = 1.1.106; + }; + }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ @@ -9426,11 +9408,6 @@ package = 48FFFAA32ADC1F9600B2B213 /* XCRemoteSwiftPackageReference "swift-async-algorithms" */; productName = AsyncAlgorithms; }; - 48FFFAA72ADC1FBE00B2B213 /* Atomics */ = { - isa = XCSwiftPackageProductDependency; - package = 48FFFAA62ADC1FBE00B2B213 /* XCRemoteSwiftPackageReference "swift-atomics" */; - productName = Atomics; - }; 48FFFAAA2ADC1FE900B2B213 /* DependenciesAdditions */ = { isa = XCSwiftPackageProductDependency; package = 48FFFAA92ADC1FE900B2B213 /* XCRemoteSwiftPackageReference "swift-dependencies-additions" */; @@ -9541,11 +9518,6 @@ package = 48FFFAF32ADC241A00B2B213 /* XCRemoteSwiftPackageReference "swift-collections" */; productName = HeapModule; }; - 48FFFB092ADC721800B2B213 /* Atomics */ = { - isa = XCSwiftPackageProductDependency; - package = 48FFFAA62ADC1FBE00B2B213 /* XCRemoteSwiftPackageReference "swift-atomics" */; - productName = Atomics; - }; 5B1C4FD42BBB0B0C00B9436F /* AppsFlyerLib-Strict */ = { isa = XCSwiftPackageProductDependency; package = 5B1C4FD32BBB0B0C00B9436F /* XCRemoteSwiftPackageReference "AppsFlyerFramework-Strict" */; @@ -9556,10 +9528,6 @@ package = 5B634A922C91D2A0004B2FBC /* XCRemoteSwiftPackageReference "ScreenshotPreventing-iOS" */; productName = ScreenshotPreventing; }; - 5B92AACB2D314CC400486A9B /* Sargon */ = { - isa = XCSwiftPackageProductDependency; - productName = Sargon; - }; A415574F2B757C5E0040AD4E /* ComposableArchitecture */ = { isa = XCSwiftPackageProductDependency; package = A415574E2B757C5E0040AD4E /* XCRemoteSwiftPackageReference "swift-composable-architecture" */; @@ -9575,6 +9543,11 @@ package = 48FFFAB22ADC206300B2B213 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */; productName = SwiftUIIntrospect; }; + E6BD41002D3E4A1B00D210DF /* Sargon */ = { + isa = XCSwiftPackageProductDependency; + package = E6BD40FF2D3E4A1B00D210DF /* XCRemoteSwiftPackageReference "sargon" */; + productName = Sargon; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 48CFBC472ADC106300E77A5C /* Project object */; diff --git a/RadixWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/RadixWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index d4119cad3b..bbfae59dc3 100644 --- a/RadixWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/RadixWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "fa0ccc46105ce4506ee426a54025794ee1322cffb38f54c107e48179e492ab78", + "originHash" : "07ce6e755e876609763519b759f734223d793640b402e06aedef4571a7f65e19", "pins" : [ { "identity" : "anycodable", @@ -135,15 +135,6 @@ "version" : "0.1.0" } }, - { - "identity" : "swift-atomics", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-atomics.git", - "state" : { - "revision" : "6c89474e62719ddcc1e9614989fff2f68208fe10", - "version" : "1.1.0" - } - }, { "identity" : "swift-case-paths", "kind" : "remoteSourceControl", diff --git a/RadixWallet/Clients/ProfileStore/ProfileStore.swift b/RadixWallet/Clients/ProfileStore/ProfileStore.swift index 9069f44e6f..b93edc78e7 100644 --- a/RadixWallet/Clients/ProfileStore/ProfileStore.swift +++ b/RadixWallet/Clients/ProfileStore/ProfileStore.swift @@ -37,13 +37,13 @@ extension ProfileStore { extension ProfileStore { func createNewProfile() async throws { - let shouldPrederiveInstances: Bool + let shouldPreDeriveInstances: Bool #if DEBUG - shouldPrederiveInstances = true + shouldPreDeriveInstances = true #else - shouldPrederiveInstances = false + shouldPreDeriveInstances = false #endif - return try await SargonOS.shared.newWallet(shouldPrederiveInstances: shouldPrederiveInstances) + return try await SargonOS.shared.newWallet(shouldPreDeriveInstances: shouldPreDeriveInstances) } func finishOnboarding( diff --git a/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+Reducer.swift b/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+Reducer.swift index 726ec7a201..9f929435d6 100644 --- a/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+Reducer.swift +++ b/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+Reducer.swift @@ -23,7 +23,7 @@ struct DebugSettingsCoordinator: Sendable, FeatureReducer { case debugUserDefaultsContentsButtonTapped case debugTestKeychainButtonTapped case debugKeychainContentsButtonTapped - case debugFactorInstancesCacheContentsButtonTapped + case debugFactorInstancesCacheContentsButtonTapped } enum InternalAction: Sendable, Equatable { @@ -31,33 +31,41 @@ struct DebugSettingsCoordinator: Sendable, FeatureReducer { } struct Destination: DestinationReducer { + @CasePathable enum State: Sendable, Hashable { case debugUserDefaultsContents(DebugUserDefaultsContents.State) case debugInspectProfile(DebugInspectProfile.State) case debugManageFactorSources(DebugManageFactorSources.State) #if DEBUG case debugKeychainTest(DebugKeychainTest.State) - case debugKeychainContents(DebugKeychainContents.State) + case debugKeychainContents(DebugKeychainContents.State) case debugFactorInstancesCacheContents(DebugFactorInstancesCacheContents.State) #endif // DEBUG } + @CasePathable enum Action: Sendable, Equatable { case debugUserDefaultsContents(DebugUserDefaultsContents.Action) case debugInspectProfile(DebugInspectProfile.Action) #if DEBUG case debugKeychainTest(DebugKeychainTest.Action) - case debugKeychainContents(DebugKeychainContents.Action) + case debugKeychainContents(DebugKeychainContents.Action) case debugFactorInstancesCacheContents(DebugFactorInstancesCacheContents.Action) #endif // DEBUG case debugManageFactorSources(DebugManageFactorSources.Action) } var body: some ReducerOf { - Scope(state: /State.debugUserDefaultsContents, action: /Action.debugUserDefaultsContents) { + Scope( + state: \.debugUserDefaultsContents, + action: \.debugUserDefaultsContents + ) { DebugUserDefaultsContents() } - Scope(state: /State.debugInspectProfile, action: /Action.debugInspectProfile) { + Scope( + state: \.debugInspectProfile, + action: \.debugInspectProfile + ) { DebugInspectProfile() } #if DEBUG @@ -67,9 +75,9 @@ struct DebugSettingsCoordinator: Sendable, FeatureReducer { Scope(state: /State.debugKeychainContents, action: /Action.debugKeychainContents) { DebugKeychainContents() } - Scope(state: /State.debugFactorInstancesCacheContents, action: /Action.debugFactorInstancesCacheContents) { - DebugFactorInstancesCacheContents() - } + Scope(state: /State.debugFactorInstancesCacheContents, action: /Action.debugFactorInstancesCacheContents) { + DebugFactorInstancesCacheContents() + } #endif // DEBUG Scope(state: /State.debugManageFactorSources, action: /Action.debugManageFactorSources) { DebugManageFactorSources() @@ -116,12 +124,12 @@ struct DebugSettingsCoordinator: Sendable, FeatureReducer { #endif // DEBUG return .none - case .debugFactorInstancesCacheContentsButtonTapped: - #if DEBUG - state.destination = .debugFactorInstancesCacheContents(.init()) - #endif // DEBUG - return .none - + case .debugFactorInstancesCacheContentsButtonTapped: + #if DEBUG + state.destination = .debugFactorInstancesCacheContents(.init()) + #endif // DEBUG + return .none + case .debugUserDefaultsContentsButtonTapped: state.destination = .debugUserDefaultsContents(.init()) return .none From 321d161d3d790d1ed20cf607efb507e26e2c81ae Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Mon, 20 Jan 2025 10:33:04 +0100 Subject: [PATCH 8/9] format --- .../DebugSettingsCoordinator+View.swift | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+View.swift b/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+View.swift index 3fbe6cf336..8243f8913f 100644 --- a/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+View.swift +++ b/RadixWallet/Features/SettingsFeature/DebugSettings/Coordinator/DebugSettingsCoordinator+View.swift @@ -65,12 +65,12 @@ extension DebugSettingsCoordinator.View { icon: .systemImage("key"), action: .debugKeychainContentsButtonTapped ), - // ONLY DEBUG EVER - .model( - title: "FactorInstances Cache", - icon: .systemImage("key"), - action: .debugFactorInstancesCacheContentsButtonTapped - ), + // ONLY DEBUG EVER + .model( + title: "FactorInstances Cache", + icon: .systemImage("key"), + action: .debugFactorInstancesCacheContentsButtonTapped + ), ] } } @@ -94,7 +94,7 @@ private extension View { .debugUserDefaultsContents(with: destinationStore) #if DEBUG .debugKeychainTest(with: destinationStore) - .debugKeychainContents(with: destinationStore) + .debugKeychainContents(with: destinationStore) .debugFactorInstancesCacheContents(with: destinationStore) #endif .debugInspectProfile(with: destinationStore) @@ -133,18 +133,17 @@ private extension View { destination: { DebugKeychainContents.View(store: $0) } ) } - - - private func debugFactorInstancesCacheContents( - with destinationStore: PresentationStoreOf - ) -> some View { - navigationDestination( - store: destinationStore, - state: /DebugSettingsCoordinator.Destination.State.debugFactorInstancesCacheContents, - action: DebugSettingsCoordinator.Destination.Action.debugFactorInstancesCacheContents, - destination: { DebugFactorInstancesCacheContents.View(store: $0) } - ) - } + + private func debugFactorInstancesCacheContents( + with destinationStore: PresentationStoreOf + ) -> some View { + navigationDestination( + store: destinationStore, + state: /DebugSettingsCoordinator.Destination.State.debugFactorInstancesCacheContents, + action: DebugSettingsCoordinator.Destination.Action.debugFactorInstancesCacheContents, + destination: { DebugFactorInstancesCacheContents.View(store: $0) } + ) + } #endif // DEBUG private func factorSources( From 87f2df18acf92c152dfc5ecf6d9f1d01df733b9f Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Mon, 20 Jan 2025 11:22:42 +0100 Subject: [PATCH 9/9] add if DEBUG --- .../DebugFactorInstancesCacheContents+View.swift | 2 ++ .../DebugFactorInstancesCacheContents.swift | 2 ++ 2 files changed, 4 insertions(+) diff --git a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift index 341aa5e20a..5524a54327 100644 --- a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift +++ b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents+View.swift @@ -1,3 +1,4 @@ +#if DEBUG import Sargon import SwiftUI @@ -72,3 +73,4 @@ extension FactorSourceIDFromHash { String(toString().prefix(10)) } } +#endif // DEBUG diff --git a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift index 086bcb4f36..1d0965abee 100644 --- a/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift +++ b/RadixWallet/Features/SettingsFeature/DebugSettings/Children/DebugFactorInstancesCacheContents/DebugFactorInstancesCacheContents.swift @@ -1,3 +1,4 @@ +#if DEBUG import Sargon public typealias Instances = [FactorSourceIDFromHash: [[FactorInstanceForDebugPurposes]]] @@ -59,3 +60,4 @@ struct DebugFactorInstancesCacheContents: Sendable, FeatureReducer { } } } +#endif // DEBUG