test(walletkit-e2e): USDT-on-Polygon Permit2 pay test#533
test(walletkit-e2e): USDT-on-Polygon Permit2 pay test#533ignaciosantise wants to merge 4 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>
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