Commit d568194
Return the bulk-scan shape from stubScanAssetSafe (fixes swap safe E2E)
The swap flow scans destination tokens via the /scan-asset-bulk endpoint, whose
response is { data: { results: { [assetId]: ... } } }. stubScanAssetSafe caught
that endpoint (via **/scan-asset**) but returned the single-asset shape, so the
recovery hook read results[id] as undefined. Previously that failed open
silently; now (correctly) it resolves to UNABLE_TO_SCAN, which made the 'Swap
shows no warning when scan confirms tokens are safe' test see a token warning.
Have the stub return the bulk shape (keyed by the requested asset_ids) for the
bulk endpoint and the single shape otherwise, so a safe scan resolves to SAFE.
Verified: blockaid swap E2E (safe/malicious/suspicious/unable) + swap.test.ts
pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 7635667 commit d568194
1 file changed
Lines changed: 26 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
551 | 565 | | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
570 | 578 | | |
571 | 579 | | |
572 | 580 | | |
| |||
0 commit comments