Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ABW-3759] Claim account lockers #1323

Merged
merged 17 commits into from
Sep 10, 2024

Conversation

matiasbzurovski
Copy link
Contributor

@matiasbzurovski matiasbzurovski commented Sep 6, 2024

Jira ticket: ABW-3759

Complements: [ABW-3762 Account lock claim status](#1312)

Description

This PR allows the user to claim an account locker deposit.

Co-authored-by: Ghenadie Vasiliev-Pusca <[email protected]>
@@ -56,6 +57,10 @@ extension Home {
.send(.delegate(.openDetails))
case .securityProblemsTapped:
.send(.delegate(.openSecurityCenter))
case let .accountLockerClaimTapped(details):
.run { _ in
try await accountLockersClient.claimContent(details)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont care about errors? maybe the client logs errors? otherwise we might wanna log errors here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding some logs here just to consider the case the given method throws an error. However, this won't be the case for the edge case discussed last Friday, where user attempts to claim an outdated locker (which no longer has the resources available). In such case, the failure would be at TransactionReview level, which will add logs as the following.

2024-09-09T12:31:47+0200 🟥 error com.radixpublishing : Transaction preview failed, error: failedToPrepareTXReview(Radix_Wallet_Dev.TransactionFailure.FailedToPreviewTXReview.failedToRetrieveTXReceipt("ApplicationError(VaultError(ResourceError(InsufficientBalance { requested: 3, actual: 1 })))"))
2024-09-09T12:31:47+0200 🟥 error com.radixpublishing : An error occurred: TransactionReviewFailure(underylying: Radix_Wallet_Dev.TransactionFailure.failedToPrepareTXReview(Radix_Wallet_Dev.TransactionFailure.FailedToPreviewTXReview.failedToRetrieveTXReceipt("ApplicationError(VaultError(ResourceError(InsufficientBalance { requested: 3, actual: 1 })))")))

@@ -180,4 +187,8 @@ extension SubmitTransaction.State.TXStatus {
case .notYetSubmitted, .submitting, .submitted, .committedSuccessfully: false
}
}

var isFinal: Bool {
!isInProgress
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm this says that temporarilyRejected is final, which sounds like an oxymoron to me. Perhaps not crucial but might be a minor thing you wanna check. I think David Edey is a good person to ask about the meaning of "temporarilyRejected" status, we have not worked to much with it in the past I think (As in Wallet does not use that state a lot).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this ended up being removed since we no longer force refresh on final status updates, but inside the AccountLockerClient after awaiting for TX.

Anyway, good to know about this temporarilyRejected status to take it into consideration next time.

# Conflicts:
#	RadixWallet.xcodeproj/project.pbxproj
#	RadixWallet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@matiasbzurovski matiasbzurovski merged commit 1cfcd11 into ABW-3762-claim-status Sep 10, 2024
6 checks passed
@matiasbzurovski matiasbzurovski deleted the ABW-3759-claim-content branch September 10, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants