-
Notifications
You must be signed in to change notification settings - Fork 5
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: migrate stacks generate txs, closes LEA-1732 #627
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #627 +/- ##
==========================================
- Coverage 23.73% 23.33% -0.41%
==========================================
Files 165 169 +4
Lines 6181 6309 +128
Branches 335 339 +4
==========================================
+ Hits 1467 1472 +5
- Misses 4714 4837 +123
|
apps/mobile/src/features/send/send-form/hooks/use-send-form-stx.tsx
Outdated
Show resolved
Hide resolved
apps/mobile/src/features/send/send-sheets/send-form-stx-sheet.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @fbwoolf 👍
There's some console logs + commented code to remove.
For the stacks
package work, maybe we could add some of the functions into smaller independent files and generate some unit tests for them also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @fbwoolf
Lots to discuss here though. I think there's some code, and general patterns here, we might want to reconsider bringing over if possible
apps/mobile/src/features/send/send-form/components/send-form-stacks-setter.tsx
Outdated
Show resolved
Hide resolved
apps/mobile/src/common/transactions/stacks-transactions.hooks.ts
Outdated
Show resolved
Hide resolved
apps/mobile/src/common/transactions/stacks-transactions.hooks.ts
Outdated
Show resolved
Hide resolved
I would investigate options where we do not even render the form components until we have this data loaded from the external source. Either the loader pattern, or some kind of route loader if Expo has those. |
Yep, agree, I was debating abt just doing a draft PR but wasn't sure how quickly we wanted to push the send form forward. I'll change this to draft and tackle some of the refactoring you pointed out. I mostly wanted to make sure I got feedback on effort here so far. 👍 |
f99a878
to
1f9ea83
Compare
apps/mobile/src/features/send/send-form/hooks/use-send-form-stx.tsx
Outdated
Show resolved
Hide resolved
9d90998
to
81d205b
Compare
81d205b
to
d869a60
Compare
This PR migrates code from the extension to generate the unsigned stacks tx for the STX send flow.
Approach here now uses a separate Provider for each chain/protocol form so that we can handle loading data in the provider. I also did a version using our loader pattern, which seemed ok too, but felt using this approach might be more straightforward with using React context for the forms. We can add a loading state later, etc.
I also removed any helper functions I wasn't directly using with generating the unsigned tx. I realized I had ported over some unnec functions for this work. I got rid of all the stacks connect types.
I did add two new money formatters that can eventually help to replace
stacksValue
, thought I didn't end up needing them anywhere for now.