test(e2e): mock popular network RPCs to remove from allowlist (MMQA-1785)#29682
Conversation
…785) Tier 4 of the E2E allowlist reduction (epic MMQA-1364). - Adds default RPC mocks for api.avax.network and mainnet.era.zksync.io (pinged on controller load via withPopularNetworks()) - Extends CUSTOM_RPC_PROVIDER_MOCKS to also handle rpc.atlantischain.network (used by permission-system-dapp-chain-switch-grant.spec.ts) - Removes testnet-rpc.monad.xyz from allowlist — stale entry, only used for ticker/nickname extraction; actual rpcUrl overridden to localhost - Drops corresponding entries from Detox blacklistURLs.json Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cb3af18. Configure here.
…DER_MOCKS The proxy matcher was returning Ethereum mainnet values (chainId 0x1, net_version 1) for every mocked custom-RPC host. With atlantischain (Elysium Testnet, chainId 0x53a) now sharing this matcher, that masked chain identity. Split the table into per-host overrides for chainId and net_version, with a shared table for the remaining method stubs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection rationale:
The Performance Test Selection: |
|




Description
Tier 4 of the E2E allowlist reduction (epic MMQA-1364). Removes four entries from
tests/api-mocking/mock-e2e-allowlist.tsby adding default RPC mocks where the URL is actually pinged at runtime, and deleting one stale entry whose host is never wired into aNetworkController.Entries removed:
api.avax.network/ext/bc/C/rpcwithPopularNetworks()).mainnet.era.zksync.iorpc.atlantischain.networkCUSTOM_RPC_PROVIDER_MOCKSextended to also cover this host. Used bypermission-system-dapp-chain-switch-grant.spec.ts(ElysiumTestnet).testnet-rpc.monad.xyztests/resources/mock-configs.tsto readticker/nickname; the actualrpcUrlis overridden tohttp://localhost:8545, so the live URL is never set on a controller.Detox's
blacklistURLs.jsonentries for avax + zksync are also removed — those URLs are now intercepted by the mock server and no longer leak to Detox's network-sync.Out of scope: the
npm:URI regex hack inMockServerE2E.ts(Tier 4 — Part 2, blocked by MMQA-1366). The Polymarket allowlist follow-up will be a separate ticket.After this lands,
ALLOWLISTED_HOSTSis down to 9 entries (4 local + 4 Tenderly + Polymarket carve-out +metamask.github.io) andALLOWLISTED_URLSis down to 1 entry (metamask.github.io/test-dapp/metamask-fox.svg).Changelog
CHANGELOG entry: null
Related issues
MMQA-1785 (Tier 4 — Part 1)
Parent epic: MMQA-1364
Fixes:
Manual testing steps
Screenshots/Recordings
Before
tests/api-mocking/mock-e2e-allowlist.ts— Tier 4 entries still permitted to leak as live requests:tests/resources/blacklistURLs.json— Detox dropping the same hosts at the network layer:After
tests/api-mocking/mock-e2e-allowlist.ts— four entries removed (1 host + 3 URLs):tests/resources/blacklistURLs.json— corresponding zkSync / avax patterns removed.CI verification (commit
cf2ba92fcc):network-abstraction-ios-smokeis the suite that runspermission-system-dapp-chain-switch-grant.spec.ts(Elysium / atlantischain) and the multichainwallet-*specs that build fixtures withwithPopularNetworks()(Avalanche / zkSync). Both shards passed on the latest commit, validating the new mocks across both code paths.Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist