Commit d8067bb
authored
fix(transaction-pay-controller): proxy Across status polling via configured api base (#8512)
## Summary
- route Across status polling through the configured Across `apiBase`
instead of the direct upstream URL
- poll Across deposit status with `depositTxnRef` and accept
`fillTxnRef` as a terminal transaction hash fallback
- read `confirmations_pay` from remote feature flags or local overrides,
and use `http://localhost:3000/across` when `confirmations_pay.dev` is
enabled without an explicit Across base
- add focused tests and changelog coverage for the new behavior
## Validation
- `yarn workspace @metamask/transaction-pay-controller run jest
--no-coverage src/strategy/across/across-submit.test.ts
src/utils/feature-flags.test.ts`
- `yarn eslint
packages/transaction-pay-controller/src/strategy/across/across-submit.ts
packages/transaction-pay-controller/src/strategy/across/across-submit.test.ts
packages/transaction-pay-controller/src/utils/feature-flags.ts
packages/transaction-pay-controller/src/utils/feature-flags.test.ts`
- `yarn workspace @metamask/transaction-pay-controller run
changelog:validate`
- `yarn build`
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Touches Across bridging completion logic and status polling
parameters/base URL; misconfiguration or unexpected API response shapes
could cause submissions to appear stuck or resolve to the wrong final
hash.
>
> **Overview**
> Across submission now polls the `/deposit/status` endpoint via the
configured `confirmations_pay.payStrategies.across.apiBase` (instead of
relying on quote-provided/upstream URL details) and uses the source
transaction hash as `depositTxnRef`.
>
> Status completion handling is updated to accept `fillTxnRef` as an
additional terminal transaction hash fallback (before
`fillTxHash`/`txHash`). Tests are adjusted/added to assert the new
polling URL/params and hash fallback behavior, and the changelog
documents the fix.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
2c73a02. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 5d8bbdf commit d8067bb
3 files changed
Lines changed: 79 additions & 13 deletions
File tree
- packages/transaction-pay-controller
- src/strategy/across
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
Lines changed: 68 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
579 | | - | |
| 579 | + | |
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
| |||
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
636 | | - | |
| 636 | + | |
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
642 | 688 | | |
643 | 689 | | |
644 | 690 | | |
| |||
747 | 793 | | |
748 | 794 | | |
749 | 795 | | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
750 | 815 | | |
751 | 816 | | |
752 | 817 | | |
| |||
Lines changed: 7 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
| 245 | + | |
250 | 246 | | |
251 | 247 | | |
252 | 248 | | |
| 249 | + | |
| 250 | + | |
253 | 251 | | |
254 | 252 | | |
| 253 | + | |
255 | 254 | | |
256 | 255 | | |
257 | 256 | | |
258 | 257 | | |
259 | 258 | | |
260 | | - | |
261 | 259 | | |
262 | 260 | | |
263 | 261 | | |
264 | | - | |
| 262 | + | |
265 | 263 | | |
266 | 264 | | |
267 | 265 | | |
268 | 266 | | |
269 | 267 | | |
270 | | - | |
271 | | - | |
272 | | - | |
| 268 | + | |
273 | 269 | | |
274 | 270 | | |
275 | 271 | | |
| |||
314 | 310 | | |
315 | 311 | | |
316 | 312 | | |
| 313 | + | |
317 | 314 | | |
318 | 315 | | |
319 | 316 | | |
| |||
0 commit comments