Remove legacy global/selected-chain path from GasFeeController

未关闭
#9,585 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
冷清
技术栈
typescript
领域
api, testing

调研方向

从 GasFeeController 和大型测试套件 GasFeeController.test.ts 开始,将 multichain 路径与 issue 中列出的 legacy global/selected-chain 用例分开。检查 transaction-controller 现有的 networkClientId 调用,然后移除 legacy surface 并更新测试,以确保每个 networkClientId 所需的流程仍然得到覆盖。

由索引模型根据 Issue 内容生成。

描述

team-confirmations

Summary

GasFeeController supports two modes: the multichain path (fetchGasFeeEstimates({ networkClientId }) → gasFeeEstimatesByChainId[chainId]) and a legacy global/selected-chain path that predates multichain support. Remove the global path so the per-networkClientId route is the only one.

Surface to remove

  • Constructor options: getProvider, getChainId, getCurrentNetworkEIP1559Compatibility, getCurrentNetworkLegacyGasAPICompatibility, getCurrentAccountEIP1559Compatibility, onNetworkDidChange
  • Flat top-level state: gasFeeEstimates, gasEstimateType, estimatedGasFeeTimeBounds
  • No-arg polling getGasFeeEstimatesAndStartPolling() and the NetworkController:networkDidChange subscription/reset
  • Make networkClientId required in fetchGasFeeEstimates; give getTimeEstimate a chain/networkClientId arg

Impact — BREAKING

  • Core: low risk. No consumer reads the flat state or uses no-arg polling; transaction-controller already passes networkClientId. Mostly mechanical + large GasFeeController.test.ts rewrite (~60-70% is global-path).

Notes

Follow-up to #9569, which made the global path init-order-agnostic — this removal deletes that code path entirely.

主要语言
TypeScript
星标
422
派生
313
平均合并
1 天 8 小时
30 天内合并 PR
414

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

MetaMask/core 的其他 Issue

查看 MetaMask/core 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。