Commit d504609
authored
fix: Fix
## Explanation
This function assumed that metadata for a given network client would be
`undefined` if an EIP-1559 compatibility check was needed. This used to
be the case prior to `@metamask/[email protected]`, but as of
that version we began regularly updating metadata without checking for
EIP-1559 compatibility.
The function `get1559CompatibilityWithNetworkClientI` now checks for
whether EIP-1559 compatibility metadata is present, not just whether
metadata is defined at all.
## References
Fixes #7533
## Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Updates EIP-1559 compatibility check to refetch network metadata when
the `EIPS[1559]` value is missing and adds tests plus changelog entry.
>
> - **NetworkController**:
> - Update `get1559CompatibilityWithNetworkClientId` to call
`lookupNetwork` when `networksMetadata[networkClientId].EIPS[1559]` is
`undefined`, not only when metadata is absent, then return `EIPS[1559]`.
> - **Tests**
(`packages/network-controller/tests/NetworkController.test.ts`):
> - Adjust existing test description and add test to verify metadata is
updated when EIP-1559 compatibility is missing.
> - **Changelog** (`packages/network-controller/CHANGELOG.md`):
> - Add Fix entry describing the updated EIP-1559 metadata behavior.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
396375e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->get1559CompatibilityWithNetworkClientId (#7532)1 parent a943041 commit d504609
File tree
3 files changed
+48
-2
lines changed- packages/network-controller
- src
- tests
3 files changed
+48
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2132 | 2132 | | |
2133 | 2133 | | |
2134 | 2134 | | |
2135 | | - | |
| 2135 | + | |
2136 | 2136 | | |
2137 | 2137 | | |
2138 | 2138 | | |
| |||
Lines changed: 43 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3590 | 3590 | | |
3591 | 3591 | | |
3592 | 3592 | | |
3593 | | - | |
| 3593 | + | |
3594 | 3594 | | |
3595 | 3595 | | |
3596 | 3596 | | |
| |||
3624 | 3624 | | |
3625 | 3625 | | |
3626 | 3626 | | |
| 3627 | + | |
| 3628 | + | |
| 3629 | + | |
| 3630 | + | |
| 3631 | + | |
| 3632 | + | |
| 3633 | + | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
| 3637 | + | |
| 3638 | + | |
| 3639 | + | |
| 3640 | + | |
| 3641 | + | |
| 3642 | + | |
| 3643 | + | |
| 3644 | + | |
| 3645 | + | |
| 3646 | + | |
| 3647 | + | |
| 3648 | + | |
| 3649 | + | |
| 3650 | + | |
| 3651 | + | |
| 3652 | + | |
| 3653 | + | |
| 3654 | + | |
| 3655 | + | |
| 3656 | + | |
| 3657 | + | |
| 3658 | + | |
| 3659 | + | |
| 3660 | + | |
| 3661 | + | |
| 3662 | + | |
| 3663 | + | |
| 3664 | + | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
3627 | 3669 | | |
3628 | 3670 | | |
3629 | 3671 | | |
| |||
0 commit comments