Skip to content

Conversation

@vinistevam
Copy link
Contributor

@vinistevam vinistevam commented Sep 21, 2023

Explanation

This PR aims to include a validation existent in the Extension in the TransactionController core. The validation gets the current network and current account to check if they support EIP-1559 transactions. If the transaction is an EIP-1559 transaction, meaning it contains maxFeePerGas and maxPriorityFeePerGas values, but the network or account does not support EIP-1559, then an error is thrown.

In order to support it two callbacks are passed to the controller constructor getCurrentAccountEIP1559Compatibility and getCurrentNetworkEIP1559Compatibility.

Changelog

@metamask/transaction-controller

  • BREAKING: Add required getCurrentAccountEIP1559Compatibility and getCurrentNetworkEIP1559Compatibility callback arguments to constructor.

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

@vinistevam vinistevam marked this pull request as ready for review September 21, 2023 09:39
@vinistevam vinistevam requested a review from a team as a code owner September 21, 2023 09:39
OGPoyraz
OGPoyraz previously approved these changes Sep 21, 2023
matthewwalsh0
matthewwalsh0 previously approved these changes Sep 21, 2023
@vinistevam
Copy link
Contributor Author

Only merge after #1690 to use @metamask/rpc-errors

@vinistevam vinistevam dismissed stale reviews from matthewwalsh0 and OGPoyraz via 666702a September 27, 2023 07:54
@vinistevam vinistevam merged commit db2aef2 into main Sep 27, 2023
@vinistevam vinistevam deleted the refactor/978-validate-eip-1559-compatibility branch September 27, 2023 09:22
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
## Explanation

This PR aims to include a validation existent in the Extension in the `TransactionController` core. The validation gets the current network and current account to check if they support EIP-1559 transactions. If the transaction is an EIP-1559 transaction, meaning it contains `maxFeePerGas` and `maxPriorityFeePerGas` values, but the network or account does not support EIP-1559, then an error is thrown.

In order to support it two callbacks are passed to the controller constructor `getCurrentAccountEIP1559Compatibility` and
`getCurrentNetworkEIP1559Compatibility`.

## Changelog

### `@metamask/transaction-controller`

- **BREAKING**: Add required `getCurrentAccountEIP1559Compatibility` and `getCurrentNetworkEIP1559Compatibility` callback arguments to constructor.
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
## Explanation

This PR aims to include a validation existent in the Extension in the `TransactionController` core. The validation gets the current network and current account to check if they support EIP-1559 transactions. If the transaction is an EIP-1559 transaction, meaning it contains `maxFeePerGas` and `maxPriorityFeePerGas` values, but the network or account does not support EIP-1559, then an error is thrown.

In order to support it two callbacks are passed to the controller constructor `getCurrentAccountEIP1559Compatibility` and
`getCurrentNetworkEIP1559Compatibility`.

## Changelog

### `@metamask/transaction-controller`

- **BREAKING**: Add required `getCurrentAccountEIP1559Compatibility` and `getCurrentNetworkEIP1559Compatibility` callback arguments to constructor.
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