docs: Fullnode Typings [12] - SendTransaction#1014
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #1014 +/- ##
=======================================
Coverage 67.39% 67.39%
=======================================
Files 114 114
Lines 8644 8644
Branches 1933 1933
=======================================
Hits 5826 5826
Misses 2790 2790
Partials 28 28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| await addCreatedTokenFromTx(transaction as CreateTokenTransaction, storage); | ||
| // Add new transaction to the wallet's storage. | ||
| wallet.enqueueOnNewTx({ history: historyTx }); | ||
| wallet.enqueueOnNewTx({ type: '', history: historyTx }); // FIXME: Add a type here |
There was a problem hiding this comment.
Why? This function does not require a type
The type it expexts is { history: IHistoryTx[]} (IHistoryTx).
The handleWebsocketMsg requires a type, but not the enqueueOnNewTx
There was a problem hiding this comment.
This may be our desired end result, but as of now handleWebsocketMsg calls enqueueOnNewTx passing the entire websocket object ( see #1013 , which adds explicit typing for this part of the code ).
Changing the type here would require a refactor, which is outside my current scope. The "Fixme" and empty string are meant to reinforce that this needs to be improved in a future refactor.
There was a problem hiding this comment.
Accepted this suggestion and closed this PR.
|
|
||
| export interface ISendTokenOutput { | ||
| type: OutputType.P2PKH | OutputType.P2SH; | ||
| type: OutputType.P2PKH | OutputType.P2SH; // XXX: This type is ignored in the only place it is used |
There was a problem hiding this comment.
The idea is that the ISendOutput is a combination of the ISendDataOutput and ISendTokenOutput which can be checked through the type field.
Originally (before moving to typescript) the type field was only present on the data output which is why we don't use the others.
There was a problem hiding this comment.
What's your point here? I didn't follow
There was a problem hiding this comment.
Sorry, this was an "information only" comment, not trying to request any changes
Depends on #1013
Acceptance Criteria
Security Checklist