test(walletkit-e2e): USDT-on-Polygon Permit2 pay test#533
test(walletkit-e2e): USDT-on-Polygon Permit2 pay test#533ignaciosantise wants to merge 9 commits into
Conversation
Consumer side of WalletConnect/actions#97 (adds pay_usdt_arbitrum). USDT is a Permit2 token, so the wallet sends approve (allowance) then payment. - LoadingView: add pay-loading-setup-note testID on the token-setup note so the test can observe the approve step by id instead of a copy string. - walletkit-build-and-maestro action: after the Maestro run (if: always(), gated to the pay suite), reset the USDT-on-Arbitrum Permit2 allowance to 0 via revoke-permit2-approval.js so each run re-exercises approve. Add arbitrum-rpc-url input. Runs as a Node step (Maestro's runScript sandbox can't sign). - revoke-permit2-approval.js: make --walletAddress optional (derive from the private key; verify only when explicitly passed). - e2e-balance-check: monitor USDT + ETH (gas) on Arbitrum, Slack-alert when low. - Pin maestro/pay-tests to the #97 head SHA for testing (re-pin on merge). - AGENTS.md: document the flow, testID, and allowance reset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Claude finished @ignaciosantise's task in 2m 12s —— View job PR ReviewFound 3 issue(s)Issue 1:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
USDT on Arbitrum (0xFd086…) is EIP-3009 (signature-based, gasless), so WC Pay never returns an on-chain approve action for it — the approve step the test is meant to cover would never run. USDT on Polygon (0xc2132D…) is a plain ERC-20, so WC Pay uses the Permit2 approve + pay path. - Reset teardown now targets --chainId eip155:137 --rpcUrl https://polygon-rpc.com; rename the action input arbitrum-rpc-url -> polygon-rpc-url. - balance-check: monitor USDT + POL (gas) on Polygon instead of USDC/ETH on Arbitrum. - Bump maestro/pay-tests pin to the updated PR #97 head (pay_usdt_polygon). - AGENTS.md: document the Polygon rationale. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ted in CI) polygon-rpc.com returns HTTP 401 "tenant disabled" from CI runners, which made the Permit2 allowance-reset step fail (eth_estimateGas) and would also break the balance-check cast calls. Switch the reset default and the balance-check RPC to https://polygon-bor-rpc.publicnode.com (keyless, returns 200). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The payment-options screen keyed rows only by order-dependent index, with the
network in the accessibilityLabel — so a test couldn't deterministically pick a
specific asset+network (e.g. USDT on Polygon vs the same token on Arbitrum).
Add an additive `pay-option-${assetSymbol}-${networkName}` testID (e.g.
`pay-option-usdt-polygon`) via a thin wrapper, leaving `pay-option-${index}`
intact for the existing multi-options flow and other platforms. Bump the
maestro/pay-tests pin to the actions PR head that selects USDT-on-Polygon by
this id.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Lower the Polygon stablecoin threshold default from 5 to 1 to match the other balances, and label the faucet request "USDT0" (the asset the Polygon option actually uses) instead of "USDT". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…election The USDT-on-Polygon flow now swipes to reveal the option before tapping (scrollUntilVisible short-circuits on the RN ScrollView). Re-pin to the actions PR head that includes the verified fix. Also gitignore local Maestro run artifacts (recordings, the approve-setup screenshot). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3181d23 to
835b7b2
Compare
…itrum-test # Conflicts: # .github/actions/walletkit-build-and-maestro/action.yml
There was a problem hiding this comment.
Pull request overview
This PR wires up a new WalletKit Pay E2E flow for USDT on Polygon using Permit2, adding stable UI selectors for Maestro, adding CI teardown to reset Permit2 allowance for repeatability, and extending CI balance monitoring to include Polygon (USDT + POL gas).
Changes:
- Add deterministic
testIDs for Maestro to reliably select the intended Pay option and observe the Permit2 setup note. - Add a post-Maestro teardown step in the composite CI action to revoke the USDT→Permit2 approval on Polygon so each run re-tests the
approvepath. - Extend the balance-check workflow to monitor Polygon USDT and POL and Slack-alert when below thresholds.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| wallets/rn_cli_wallet/src/modals/PaymentOptionsModal/SelectOptionView.tsx | Adds a stable, network+token-keyed testID wrapper for deterministic option selection in Maestro. |
| wallets/rn_cli_wallet/src/modals/PaymentOptionsModal/LoadingView.tsx | Adds testID to the token-setup note so tests can detect the Permit2 approve/setup phase. |
| wallets/rn_cli_wallet/scripts/revoke-permit2-approval.js | Makes --walletAddress optional by deriving it from the private key (and only verifying if provided). |
| wallets/rn_cli_wallet/AGENTS.md | Documents the new Polygon USDT Permit2 flow, the new testIDs, and the allowance reset behavior. |
| .gitignore | Ignores additional Maestro local-run artifacts. |
| .github/workflows/e2e-balance-check.yml | Adds Polygon USDT + POL gas balance checks and Slack alerts for low balances. |
| .github/actions/walletkit-build-and-maestro/action.yml | Pins shared pay-tests to a PR SHA and adds a post-run step to revoke Polygon USDT Permit2 approval for repeatability. |
Comments suppressed due to low confidence (1)
wallets/rn_cli_wallet/scripts/revoke-permit2-approval.js:235
- The friendly error for an unsupported chain (
No default USDT address...) is currently unreachable becausenormalizeAddress('tokenAddress', args.tokenAddress || USDT_BY_CHAIN[chainId])will throw "Missing --tokenAddress" first when no default exists. Move the unsupported-chain check before normalizing the token address so users get the intended message.
const tokenAddress = normalizeAddress(
'tokenAddress',
args.tokenAddress || USDT_BY_CHAIN[chainId],
);
const minPriorityFeeWei = parseMinPriorityFeeWei(
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Maestro's runScript sandbox can't sign transactions. Non-fatal: a reset hiccup | ||
| # shouldn't fail an otherwise-green run. | ||
| - name: Reset USDT Permit2 allowance (Polygon) | ||
| if: always() && contains(inputs.maestro-tags, 'pay') |
…script Replace the inline allowance-reset bash step with the shared WalletConnect/actions/maestro/permit2-reset composite action, and delete the vendored wallets/rn_cli_wallet/scripts/revoke-permit2-approval.js (+ the permit2:revoke yarn script). One source of truth across platforms. The shared action reads the private key from PERMIT2_REVOKE_PRIVATE_KEY (env), so it's no longer passed on the CLI / visible in the runner process list. Re-pin pay-tests + permit2-reset to the actions PR head. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
57bd2c6 to
3738052
Compare
Restore `yarn permit2:revoke` for local manual testing without re-committing the script: setup-maestro-pay-tests.sh now also downloads the canonical helper from WalletConnect/actions (maestro/permit2-reset) into wallets/rn_cli_wallet/scripts/, which is gitignored. Single source of truth stays the actions repo. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
What
Wires up the new USDT-on-Polygon (Permit2) Maestro pay test for
wallets/rn_cli_wallet. The test flow itself lives in the shared actions repo — see WalletConnect/actions#97 — and this PR is the consumer side that runs it and keeps it repeatable.Why Polygon (not Arbitrum)
The wallet just executes whatever
actionsthe Pay backend returns; it does no local allowance check. USDT on Arbitrum (0xFd086…) is EIP-3009 (signature-based / gasless), so the backend never returns an on-chainapproveaction — no gas, no approval step, and the approve path we want to test would never run. USDT on Polygon (0xc2132D…) is a plain ERC-20, so WC Pay uses the Permit2 path (one-timeapprove(PERMIT2)+ signature) — exactly the two-txapprove+payflow under test.Changes
LoadingView.tsx— addtestID="pay-loading-setup-note"to the token-setup note. It renders only during first-time token setup (allowance == 0), so the test can observe the Permit2approvestep by id instead of matching a copy string.walletkit-build-and-maestro/action.yml— after the Maestro run (if: always(), gated to thepaysuite), reset the USDT-on-Polygon Permit2 allowance back to0viarevoke-permit2-approval.js(--chainId eip155:137 --rpcUrl https://polygon-rpc.com), so every run re-exercisesapprove. Renames the inputarbitrum-rpc-url→polygon-rpc-url. It's a Node step, not a MaestrorunScript— the sandbox can't sign transactions. Pinspay-teststo the [example] Improve W3W Tutorial #97 head SHA.revoke-permit2-approval.js—--walletAddressis now optional: derived from the private key when omitted, verified only when explicitly passed. So the teardown needs just the key + RPC (no extra var).e2e-balance-check.yml— monitor USDT and POL (gas) on Polygon against the test wallet, Slack-alert when below threshold (USDT_POLYGON_THRESHOLD_UNITS,POLYGON_POL_THRESHOLD_WEI).AGENTS.md— document the flow, the new testID, the allowance reset, and the Polygon rationale.How to test
Trigger CI E2E WalletKit (workflow_dispatch) with tag
pay-usdt-polygon(or defaultpay) on iOS + Android. Confirm the success screen is reached and the "Reset USDT Permit2 allowance (Polygon)" step ran. Requires the test wallet to hold USDT + a little POL (gas) on Polygon.Open items
MULTI_NOKYCoffers USDT on Polygon andtapOn: text: ".*USDT.*"is unambiguous).maestro/pay-teststo the merge commit after [example] Improve W3W Tutorial #97 merges.🤖 Generated with Claude Code