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

feat(earn): prepare transactions and use on confirmation screen #6192

Merged
merged 163 commits into from
Nov 8, 2024

Conversation

MuckT
Copy link
Collaborator

@MuckT MuckT commented Oct 25, 2024

Description

Handles the preparation of all earn transactions via a shared hook that's used on both EarnEnterAmount.tsx & EarnConfirmationScreen.tsx.

Test plan

  • Tested locally on iOS
  • Tested locally on Andorid
  • Unit Tests updated

Related issues

Backwards compatibility

Yes

Network scalability

N/A

MuckT and others added 30 commits October 2, 2024 15:08
# Conflicts:
#	src/earn/EarnDepositBottomSheet.tsx
Co-authored-by: Finnian Jacobson-Schulte <140328381+finnian0826@users.noreply.github.com>
@@ -93,16 +92,22 @@ export async function prepareDepositTransactions({
}
}

export async function prepareWithdrawAndClaimTransactions({
pool,
export async function prepareWithdrawTransactionsWithSwap({
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@satish-ravi Tried a few ways to make this work without having this additional function but came up short.

Copy link
Contributor

@satish-ravi satish-ravi Nov 2, 2024

Choose a reason for hiding this comment

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

you can still avoid duplicating the fn by calling prepareWithdrawTransactions from this function and adjusting the response type right? Similar to how we did in our pairing session except we did it with an inline function in the hook instead of an exported function with explicit args

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Was able to make this change in 8cffb5b and it is a lot cleaner. I tried to do something similar with prepareWithdrawAndClaimTransactions, but ran into issues merging the prepareTransactionsResult objects.

src/earn/EarnConfirmationScreen.test.tsx Outdated Show resolved Hide resolved
src/earn/prepareTransactions.ts Outdated Show resolved Hide resolved
src/earn/hooks.ts Outdated Show resolved Hide resolved
@MuckT MuckT added this pull request to the merge queue Nov 8, 2024
Merged via the queue into main with commit 40d6606 Nov 8, 2024
15 checks passed
@MuckT MuckT deleted the tomm/act-1389-1 branch November 8, 2024 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants