Fix: normalizer ensuring type is always present in TransactionParams#3817
Fix: normalizer ensuring type is always present in TransactionParams#3817vinistevam merged 2 commits intomainfrom
Conversation
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
| gasPrice: '0x1', | ||
| to: ACCOUNT_MOCK, | ||
| value: '0x0', | ||
| type: TransactionType.simpleSend, |
There was a problem hiding this comment.
Good spot 😄 It's a fun one having a type property in both the parameters and the options.
| estimatedBaseFee: (maxPriorityFeePerGas: string) => | ||
| addHexPrefix(maxPriorityFeePerGas), | ||
| type: (type: string) => (type === '0x0' ? '0x0' : undefined), | ||
| type: (type: string) => addHexPrefix(type), |
There was a problem hiding this comment.
In a future PR, we could go one step further and always derive a type even if one wasn't provided by looking at whether there is gasPrice or maxFeePerGas etc.
That's what we already do on submission using isEIP1559Transaction.
Perhaps worth confirming by testing an older commit with the extension controller, but my understanding is if a dapp transaction doesn't specify type, it won't be in the parameters either since the extension sources the parameters from here.
There was a problem hiding this comment.
I think this would be a good addition yeah! 👍
FrederikBolding
left a comment
There was a problem hiding this comment.
Can confirm this fixed in the snaps issue!
## **Description** The package `@metamask/transaction-controller` has been upgraded to `v21.0.1`. This version has the following fixes: - Resolves transaction custodian promise when setting transaction status to submitted or failed ([#3845](MetaMask/core#3845)) - Fix normalizer ensuring property type is always present in TransactionParams ([#3817](MetaMask/core#3817)) See here for the changelog: https://github.com/MetaMask/core/blob/main/packages/transaction-controller/CHANGELOG.md#2101
The package `@metamask/transaction-controller` has been upgraded to `v21.0.1`. This version has the following fixes: - Resolves transaction custodian promise when setting transaction status to submitted or failed ([#3845](MetaMask/core#3845)) - Fix normalizer ensuring property type is always present in TransactionParams ([#3817](MetaMask/core#3817)) See here for the changelog: https://github.com/MetaMask/core/blob/main/packages/transaction-controller/CHANGELOG.md#2101
The package `@metamask/transaction-controller` has been upgraded to `v21.0.1`. This version has the following fixes: - Resolves transaction custodian promise when setting transaction status to submitted or failed ([#3845](MetaMask/core#3845)) - Fix normalizer ensuring property type is always present in TransactionParams ([#3817](MetaMask/core#3817)) See here for the changelog: https://github.com/MetaMask/core/blob/main/packages/transaction-controller/CHANGELOG.md#2101
Explanation
This PR aims to ensure
typeis always present in theTransactionParamsby matching the old Extension Normalizer.References
Changelog
@metamask/transaction-controllertypenormalizer to use theaddHexPrefixand do not set thetypeasundefined.Checklist