Skip to content
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

Add method to get transactions #2065

Merged
merged 7 commits into from
Nov 22, 2023
Merged

Conversation

matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Nov 20, 2023

Explanation

Add multiple fixes to support usage by the extension, including:

  • Add getTransactions method to search transactions using the specified criteria and options.
  • Re-add initApprovals method to allow client to finish initialisation before creating approvals.
  • Remove unnecessary gas property update during initialisation since transactions are not added to the state until gas properties are updated.
  • Normalise the gas fee values provided to speedUpTransaction and stopTransaction to support the extension arguments.
  • Update the transaction after the afterSign hook to persist any updated properties.
  • Report success to the result callback after publish is skipped to unblock the UI during the MMI flows.
  • Set the value parameter to 0x0 if not specified.
  • Limit properties updated by updateCustodianTransaction so it can initially be used for hash and status updates only, with more general MMI updates continuing to use updateTransaction.
  • Align nonce logic with mobile.
  • Update post transaction balance of swaps transactions after internal transactions.

Changelog

@metamask/transaction-controller

  • BREAKING: Update types of TransactionReceipt.transactionIndex and TransactionMeta.swapMetaData.
  • ADDED: Add initApprovals method to trigger the approval flow for any pending transactions during initialisation.
  • ADDED: Add getTransactions method to search transactions used the given criteria and options.
  • CHANGED: Normalize the gas values provided to the speedUpTransaction and stopTransaction methods.
  • CHANGED: Persist any property changes performed by the afterSign hook.
  • CHANGED: Report success to the approver if publishing is skipped by the beforePublish hook.
  • CHANGED: Update postTxBalance after all swap transactions.

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

Add initApprovals method.
Remove gas update during initialization.
Normalise gas fee values during speed up and cancel.
Simplify updateCustodialTransaction method.
@matthewwalsh0 matthewwalsh0 requested a review from a team as a code owner November 20, 2023 16:01
Use fee market constant.
Update post balance after confirm.
Add post balance logging.
Add additional logging.
@matthewwalsh0 matthewwalsh0 merged commit 9c6e19d into main Nov 22, 2023
128 checks passed
@matthewwalsh0 matthewwalsh0 deleted the refactor/get-transactions-method branch November 22, 2023 13:07
mcmire pushed a commit that referenced this pull request Nov 22, 2023
Re-add initApprovals method to allow client to finish initialisation before creating approvals.
Remove unnecessary gas property update during initialisation since transactions are not added to the state until gas properties are updated.
Normalise the gas fee values provided to speedUpTransaction and stopTransaction to support the extension arguments.
Update the transaction after the afterSign hook to persist any updated properties.
Report success to the result callback after publish is skipped to unblock the UI during the MMI flows.
Set the value parameter to 0x0 if not specified.
Limit properties updated by updateCustodianTransaction so it can initially be used for hash and status updates only, with more general MMI updates continuing to use updateTransaction.
Align nonce logic with mobile.
Update post transaction balance of swaps transactions after internal transactions.
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.

4 participants