Use receipts from `TransactionStatus`
Discussed in https://github.com/FuelLabs/fuels-ts/discussions/1588
Originally posted by nedsalk December 15, 2023
Post fuel-core v0.22.0, the node now returns receipts with a TransactionStatus, so we can use them right away instead of running another fetch. From my understanding, this will only become relevant after #1374 is merged, because we're currently using the getTransactionWithReceipts endpoint.
The way to go about implementing this is to use the TransactionRequest sent to the node in provider.sendTransaction because it contains the same transaction as the one that's fetched from the node inside of TransactionResponse via getTransactionWithReceipts, only that after fetching it from the node the receipts are there as well.
Because the receipts can now be received from the subscription directly, the same transaction summary can be generated based off of the TransactionRequest and the receipts received from the subscription. A working implementation can be found on this branch.
Blocked by merge #1615 and #1495.
The only utility for a discussion is to discuss something before it becomes an issue.
This was first an issue, but you wanted it turned it into a discussion because some things were unclear and I couldn't properly formulate how to introduce it into the code base at that time. The plan was to ask the frontend team's inputs on how to introduce it. In the meantime I figured out how to do it and turned it back into an issue. The discussion's purpose wasn't to figure out "Should we do this?" but "How do we do this?" When I realized how, I figured that it can be turned into an issue again.
So the discussion is not needed anymore.
Blocked by:
- https://github.com/FuelLabs/fuel-core/issues/1724
Unblocked by:
- https://github.com/FuelLabs/fuel-core/pull/2061