-
Notifications
You must be signed in to change notification settings - Fork 15
refactor: split nano contract send method into create and mine/push #660
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #660 +/- ##
===========================================
+ Coverage 62.61% 79.71% +17.09%
===========================================
Files 77 77
Lines 5856 5857 +1
Branches 1217 1217
===========================================
+ Hits 3667 4669 +1002
+ Misses 2093 1171 -922
+ Partials 96 17 -79 ☔ View full report in Codecov by Sentry. |
2abc5ba
to
5163609
Compare
src/nano_contracts/utils.ts
Outdated
* | ||
* @param tx Transaction to sign and send | ||
* @param pin Pin to decrypt data | ||
* @param storage Wallet storage object | ||
*/ | ||
export const signAndPushNCTransaction = async (tx: NanoContract, pin: string, storage: IStorage): Promise<Transaction> => { | ||
export const signAndCreateSendTransaction = async (tx: NanoContract, pin: string, storage: IStorage): Promise<SendTransaction> => { |
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.
suggestion(non-blocking): rename to prepareNanoSendTransaction
While the body of the function it is not nano specific the typing indicates that this is to be used with a nano contract transaction, maybe we should reflect this in the name as well.
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.
Makes sense! Done bb3c613
bb3c613
to
fa1b453
Compare
Motivation
The desktop wallet has a flow for sending tx that it expects the
SendTransaction
object because internally we handle the states of mine/push with the error handling and UI feedback for the user.Acceptance Criteria
SendTransaction
object and (ii) create, mine, and push.Security Checklist