Skip to content

Persist txReceipt on txMeta for confirmed txs#1592

Merged
OGPoyraz merged 8 commits intomainfrom
1079-add-txreceipt-to-transaction-state-in-core-transaction-controller
Aug 23, 2023
Merged

Persist txReceipt on txMeta for confirmed txs#1592
OGPoyraz merged 8 commits intomainfrom
1079-add-txreceipt-to-transaction-state-in-core-transaction-controller

Conversation

@OGPoyraz
Copy link
Copy Markdown
Member

Explanation

This PR aims to persist txReceipt on txMeta after checking blockchain for confirmed transaction.

Changelog

@metamask/transaction-controller

  • ADDED: Persist txReceipt on txMeta for confirmed txs

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@OGPoyraz OGPoyraz requested a review from a team as a code owner August 17, 2023 11:09
vinistevam
vinistevam previously approved these changes Aug 18, 2023
@OGPoyraz OGPoyraz force-pushed the 1079-add-txreceipt-to-transaction-state-in-core-transaction-controller branch from b2b249b to 696c007 Compare August 22, 2023 08:43
*/
export interface TransactionReceipt {
/**
* The block hash of the block that this transaction was included in
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As mentioned on one of the other PRs, can we go with . at the end of these descriptions so it's easier to use punctuation like commas for example?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

* @type TransactionReceipt
*
* Following properties are not included in the type definition but are returned by the API:
* @property byzantium - True if the block is in a post-Byzantium Hard Fork block.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If these are consistently returned and we're documenting them anyway, is it cleaner to just include them as standard properties with inline descriptions?

Copy link
Copy Markdown
Member Author

@OGPoyraz OGPoyraz Aug 22, 2023

Choose a reason for hiding this comment

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

I don't think all of them consistently returned from the API, moreover I see some differences in the TxReceipt type between versions of provider. Since provider (actually the object we use for the queries) is passed over while instance creation, this type is coupled with the version of that. In this situation, we cant keep track of these API additions in long term tbh.
I've added this list but now I feel like remove unused properties completely.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Definitely agree, I think it adds too much ambiguity if we have two sets of values and descriptions.

Shall we just remove these JSDoc properties and just stick with the inline properties and descriptions we have?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed

}

/**
* @type TransactionReceipt
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we need this type parameter, but just a little description for the type like Standard data concerning a transaction processed by the blockchain for example.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

}

/**
* @type Log
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here, should we just include the description?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

@OGPoyraz OGPoyraz force-pushed the 1079-add-txreceipt-to-transaction-state-in-core-transaction-controller branch from adc7a9e to 7c5b84e Compare August 22, 2023 12:46
vinistevam
vinistevam previously approved these changes Aug 23, 2023
@OGPoyraz OGPoyraz merged commit e2ec522 into main Aug 23, 2023
@OGPoyraz OGPoyraz deleted the 1079-add-txreceipt-to-transaction-state-in-core-transaction-controller branch August 23, 2023 12:25
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.

3 participants