… parameterized fixtures (MetaMask#44485)
## **Description**
Extends shared Tron E2E mock infrastructure with swap-token registry
data, stateful account balances, parameterized transaction fixtures, and
default transaction data. It is one reviewable step of a linear stack.
Based on a fresh `main` and under 500 changed lines.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Part of the local-blockchain E2E initiative (WPN-536).
Part 1 of 2 splitting MetaMask#44157 (was "Part 1 of 3 splitting MetaMask#43723").
## **Manual testing steps**
1. `yarn build:test`
2. Confirm Tron E2E specs that consume the shared mocks still load and
render asset data.
## **Screenshots/Recordings**
N/A — test infrastructure only, no user-facing UI change.
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Test-only mock helpers in `test/e2e`; no production wallet or runtime
behavior changes.
>
> **Overview**
> Extends shared Tron E2E mocks in `common-tron.ts` so upcoming swap and
balance-delta tests can reuse canonical token metadata and flip account
state after a broadcast.
>
> Adds **`TRON_SWAP_TOKEN_REGISTRY`** (TRX, USDT, USDD) plus
**`TronSwapSymbol`**, and **`createStatefulTronAccountMock`**, which
pairs account GET mocks with broadcast POST handling: balances stay on a
`before` snapshot until a broadcast runs, then switch to an optional
`after` snapshot (broadcast still returns the existing
transaction-expiration style response).
>
> **`tronInfuraUrl`** now matches Infura URLs that include query strings
(`($|\?)`), not only bare paths. TRC20 and native transaction list mocks
take an optional **`transactions`** argument, with prior inline payloads
moved to **`DEFAULT_TRON_TRC20_TRANSACTIONS`** and
**`DEFAULT_TRON_TRANSACTIONS`**; response meta uses dynamic timestamps
and page sizes.
>
> Existing **`mockTronGetAccount`** / **`mockBroadTransaction`** are
unchanged for callers that do not adopt the stateful helper.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
0a401b8. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Description
Adds a local Tron node proxy layer for E2E tests. It proxies blockchain calls to the local node, returns deterministic seeded token data, scopes account history, and captures only successful broadcasts for confirmation polling. It is one reviewable step of a linear stack. Based on a fresh
mainand under 700 changed lines.Changelog
CHANGELOG entry: null
Related issues
Part of the local-blockchain E2E initiative (WPN-536).
Part 2 of 2 splitting #44157 (was "Part 1 of 3 splitting #43723").
Manual testing steps
yarn build:testScreenshots/Recordings
N/A — test infrastructure only, no user-facing UI change.
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Test-only mock infrastructure; no production wallet or runtime behavior changes.
Overview
Adds
proxyTronBlockchainCallsinlocal-tron-node-mocks.tsso Tron E2E can route Infura/TronGrid blockchain traffic through mockttp to a local Tron node, while still shaping a few responses tests depend on.Most wallet RPC calls are forwarded (
getblock, account, resources,createtransaction, etc.). Seeded TRC-20 contracts get deterministictriggersmartcontract/triggerconstantcontractpayloads instead of hitting the node.broadcasttransactionis proxied but, onresult: true, txs are captured and replayed on/v1/accounts/.../transactionsand.../trc20as confirmed history for the given accounts—failed broadcasts are not added.In
createStatefulTronAccountMock(common-tron.ts), the swap broadcast mock now returns a successful broadcast (result: true) instead ofTRANSACTION_EXPIRATION_ERROR, aligned with the proxy’s success-only capture behavior.Reviewed by Cursor Bugbot for commit 5550ec8. Bugbot is set up for automated code reviews on this repo. Configure here.