From 71147b8cd25a5af1148fbdd00309a40198773ef7 Mon Sep 17 00:00:00 2001 From: Ghenadie <118184705+GhenadieVP@users.noreply.github.com> Date: Thu, 20 Feb 2025 10:12:21 +0200 Subject: [PATCH] 1.11.4 hotfixes (#1433) Co-authored-by: matiasbzurovski <164921079+matiasbzurovski@users.noreply.github.com> Co-authored-by: Alexander Cyon <116169792+CyonAlexRDX@users.noreply.github.com> Co-authored-by: Albert Perez --- Aux/Config/Common.xcconfig | 2 +- .../AccountPortfoliosClient+State.swift | 3 --- .../SharedModels/Assets/ResourceAmount.swift | 10 +++----- .../ResourceBalance/ResourceBalanceView.swift | 25 +++++-------------- .../Sections/Sections+ExecutionSummary.swift | 4 --- .../OnboardingCoordinator+Reducer.swift | 8 ++++++ .../PreAuthorizationReview.swift | 2 +- .../Stage1MigrateToSargon+Account.swift | 2 +- 8 files changed, 20 insertions(+), 36 deletions(-) diff --git a/Aux/Config/Common.xcconfig b/Aux/Config/Common.xcconfig index 7e043cc4b3..accde1e08b 100644 --- a/Aux/Config/Common.xcconfig +++ b/Aux/Config/Common.xcconfig @@ -1,7 +1,7 @@ // MARK: - Custom flags /// Application version shared across all targets and flavours -APP_VERSION = 1.11.3 +APP_VERSION = 1.11.5 /// App Icon base name APP_ICON = AppIcon diff --git a/RadixWallet/Clients/AccountPortfoliosClient/AccountPortfoliosClient+State.swift b/RadixWallet/Clients/AccountPortfoliosClient/AccountPortfoliosClient+State.swift index 30f5883b02..4e710baf96 100644 --- a/RadixWallet/Clients/AccountPortfoliosClient/AccountPortfoliosClient+State.swift +++ b/RadixWallet/Clients/AccountPortfoliosClient/AccountPortfoliosClient+State.swift @@ -271,9 +271,6 @@ extension ResourceAmount { case var .atLeast(exactAmount): exactAmount.fiatWorth = change(resourceAddress, exactAmount) self = .atLeast(exactAmount) - case var .atMost(exactAmount): - exactAmount.fiatWorth = change(resourceAddress, exactAmount) - self = .atMost(exactAmount) case var .between(minExactAmount, maxExactAmount): minExactAmount.fiatWorth = change(resourceAddress, minExactAmount) maxExactAmount.fiatWorth = change(resourceAddress, maxExactAmount) diff --git a/RadixWallet/Core/SharedModels/Assets/ResourceAmount.swift b/RadixWallet/Core/SharedModels/Assets/ResourceAmount.swift index 2507f60b1f..28d7703bfc 100644 --- a/RadixWallet/Core/SharedModels/Assets/ResourceAmount.swift +++ b/RadixWallet/Core/SharedModels/Assets/ResourceAmount.swift @@ -4,7 +4,6 @@ import Sargon enum ResourceAmount: Sendable, Hashable, Codable { case exact(ExactResourceAmount) case atLeast(ExactResourceAmount) - case atMost(ExactResourceAmount) case between(minimum: ExactResourceAmount, maximum: ExactResourceAmount) case predicted(predicted: ExactResourceAmount, guaranteed: ExactResourceAmount) case unknown @@ -15,13 +14,14 @@ enum ResourceAmount: Sendable, Hashable, Codable { self = .exact(amount) case let .atLeast(amount): self = .atLeast(.init(nominalAmount: amount)) - case let .atMost(amount): - self = .atMost(.init(nominalAmount: amount)) case let .between(minAmount, maxAmount): self = .between( minimum: .init(nominalAmount: minAmount), maximum: .init(nominalAmount: maxAmount) ) + case .atMost: + // AtMost is considered unknown in the Wallet as per https://radixdlt.atlassian.net/browse/ABW-4040 + self = .unknown case .unknownAmount: self = .unknown } @@ -74,8 +74,6 @@ extension ResourceAmount { return .exact(adjust(amount.nominalAmount)) case let .atLeast(amount): return .atLeast(.init(nominalAmount: adjust(amount.nominalAmount))) - case let .atMost(amount): - return .atMost(.init(nominalAmount: adjust(amount.nominalAmount))) case let .between(minAmount, maxAmount): let min = adjust(minAmount.nominalAmount) let max = adjust(maxAmount.nominalAmount) @@ -112,8 +110,6 @@ extension ResourceAmount: CustomDebugStringConvertible { amount.nominalAmount.formatted() case let .atLeast(amount): "At least \(amount.nominalAmount.formatted())" - case let .atMost(amount): - "No more than \(amount.nominalAmount.formatted())" case let .between(minAmount, maxAmount): "Min: \(minAmount.nominalAmount.formatted()); Max: \(maxAmount.nominalAmount.formatted())" case let .predicted(predicted, guaranteed): diff --git a/RadixWallet/Features/AssetsFeature/Components/HelperViews/ResourceBalance/ResourceBalanceView.swift b/RadixWallet/Features/AssetsFeature/Components/HelperViews/ResourceBalance/ResourceBalanceView.swift index d75992a88b..4eb5f131fb 100644 --- a/RadixWallet/Features/AssetsFeature/Components/HelperViews/ResourceBalance/ResourceBalanceView.swift +++ b/RadixWallet/Features/AssetsFeature/Components/HelperViews/ResourceBalance/ResourceBalanceView.swift @@ -517,12 +517,9 @@ extension ResourceBalanceView { } if case .unknown = amount { - StatusMessageView( - text: L10n.InteractionReview.Unknown.amount, - type: .warning, - useNarrowSpacing: true, - useSmallerFontSize: true - ) + Text(L10n.InteractionReview.Unknown.amount) + .textStyle(.body2HighImportance) + .foregroundStyle(.app.gray2) } } } @@ -566,12 +563,9 @@ extension ResourceBalanceView { } if case .unknown = amount { - StatusMessageView( - text: L10n.InteractionReview.Unknown.amount, - type: .warning, - useNarrowSpacing: true, - useSmallerFontSize: true - ) + Text(L10n.InteractionReview.Unknown.amount) + .textStyle(.body2HighImportance) + .foregroundStyle(.app.gray2) } } } @@ -653,13 +647,6 @@ extension ResourceBalanceView { appearance: appearance, symbol: symbol ) - case let .atMost(exactAmount): - SubAmountView( - title: L10n.InteractionReview.noMoreThan, - amount: exactAmount, - appearance: appearance, - symbol: symbol - ) case let .between(minAmount, maxAmount): VStack(alignment: alignment, spacing: .small3) { SubAmountView( diff --git a/RadixWallet/Features/InteractionReview/Sections/Sections+ExecutionSummary.swift b/RadixWallet/Features/InteractionReview/Sections/Sections+ExecutionSummary.swift index 6b13d1729e..4e952a1044 100644 --- a/RadixWallet/Features/InteractionReview/Sections/Sections+ExecutionSummary.swift +++ b/RadixWallet/Features/InteractionReview/Sections/Sections+ExecutionSummary.swift @@ -47,10 +47,6 @@ extension InteractionReview.Sections { return nil case .general, .transfer: - if summary.detailedClassification == .general { - guard !summary.deposits.isEmpty || !summary.withdrawals.isEmpty else { return nil } - } - let resourcesInfo = try await resourcesInfo(allAddresses.elements) let withdrawals = try await extractWithdrawals( accountWithdraws: summary.withdrawals, diff --git a/RadixWallet/Features/OnboardingFeature/Coordinator/OnboardingCoordinator+Reducer.swift b/RadixWallet/Features/OnboardingFeature/Coordinator/OnboardingCoordinator+Reducer.swift index fe2078d673..2bfec14f8e 100644 --- a/RadixWallet/Features/OnboardingFeature/Coordinator/OnboardingCoordinator+Reducer.swift +++ b/RadixWallet/Features/OnboardingFeature/Coordinator/OnboardingCoordinator+Reducer.swift @@ -94,6 +94,14 @@ struct OnboardingCoordinator: Sendable, FeatureReducer { _ = await radixConnectClient.loadP2PLinksAndConnectAll() } + case .createAccount(.delegate(.dismissed)): + return .run { _ in + // Clear out the ephemeral profile created on `setupNewUser` + try await SargonOS.shared.deleteWallet() + } catch: { error, _ in + errorQueue.schedule(error) + } + default: return .none } diff --git a/RadixWallet/Features/PreAuthorizationReview/PreAuthorizationReview.swift b/RadixWallet/Features/PreAuthorizationReview/PreAuthorizationReview.swift index 266f9d1919..3b032925e2 100644 --- a/RadixWallet/Features/PreAuthorizationReview/PreAuthorizationReview.swift +++ b/RadixWallet/Features/PreAuthorizationReview/PreAuthorizationReview.swift @@ -256,7 +256,7 @@ extension PreAuthorizationReview.State { var isExpired: Bool { switch expiration { case let .atTime(value): - value.date <= Date.now + value.date <= Date.now || secondsToExpiration == 0 case .afterDelay: false } diff --git a/RadixWallet/MIGRATE_TO_SARGON/Stage1/Stage1MigrateToSargon+Account.swift b/RadixWallet/MIGRATE_TO_SARGON/Stage1/Stage1MigrateToSargon+Account.swift index 82459e168a..a2e28126df 100644 --- a/RadixWallet/MIGRATE_TO_SARGON/Stage1/Stage1MigrateToSargon+Account.swift +++ b/RadixWallet/MIGRATE_TO_SARGON/Stage1/Stage1MigrateToSargon+Account.swift @@ -19,7 +19,7 @@ extension Account { var derivationIndex: HdPathComponent { guard let unsecuredControllingFactorInstance else { // TODO: Remove, temporary to accomodate securified state - return HdPathComponent.sample + return try! HdPathComponent.securifiedComponent(.init(localKeySpace: 0)) } return unsecuredControllingFactorInstance.derivationPath.lastPathComponent