-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Parameterize SmartTransactionsController state by ChainId for MultiChain + Integrate PollingController Mixin #237
Conversation
3729ab4
to
5c467b0
Compare
5c467b0
to
5f1df33
Compare
const txReceipt = mapValues(transactionReceipt, (value) => { | ||
if (value instanceof ethersBigNumber) { | ||
return value.toHexString(); | ||
} | ||
return value; | ||
}); |
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.
@dan437 so now we don't need to modify the transactionReceipt object since none of the values will be in ethersBigNumber
format.
745ae58
to
51d52e1
Compare
…ain + Integrate PollingController Mixin (#210) * integrating multichain controller upgrades * add test * cleanup * need to move confirmSmartTransaction tests into another test since confirmSmartTransaction is now private * actually for now leave it as a public method * cleanup * fix typeerror? * add test + cleanup * add a test + bump test coverage * update type * fix type issue * address feedback * fix provider logic * update test coverage threshholds * make a private and public version of updateSmartTransaction * fix capitalization" * addressing feedback * replace @ethersproject/providers with @metamask/eth-query * cleanup * address more feedback * remove @ethersproject/bignumber * make confirmSmartTransaction a private method * remove comment * getTransaction -> getTransactionByHash * fix ethquery mock
1b608f2
to
93a05f1
Compare
Removed dependencies detected. Learn more about Socket for GitHub ↗︎ 🚮 Removed packages: @metamask/[email protected] |
Looks good from my end! I'll defer to the team for final approval. |
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.
🚀
Going to wait for a review from @dan437 before merging |
TODO:E2E test with extension to ensure working properly before taking out of draftWorking e2e test here:
https://github.com/MetaMask/smart-transactions-controller/assets/34557516/307de2da-1fe3-43c8-8faa-7bf51da28eaa
Resolves: https://github.com/MetaMask/MetaMask-planning/issues/1039
Integrates new
PollingController
abstraction into theSmartTransactionsController
, implements the_executePoll
method and parameterizes theupdateSmartTransactions
method bynetworkClientId
such that pending SmartTransaction statuses can be polled for concurrently across different chains.A note: As is our current controller refactor strategy, these changes are additive, backwards compatible and coexist alongside the existing globally selected network pattern. Once we fully adopt this polling pattern we should no longer access the root liveness and fees state but rather access these values by chainId from
livenessByChainId
andfeesByChainId
.Added
PollingController
mixin into theSmartTransactionsController
and implements the abstract_executePoll
method.Changed
networkClientId
argument to theupdateSmartTransaction
method which, if passed, is used fetch the chainId that corresponds to the networkClientId and is then used to fetch and update the status of pending smart transactions for that chainId.