Commit d8ee94c
Skip unfunded-destination warning for Soroban on Search address screen (#2778)
* Skip unfunded-destination warning for Soroban on Search address screen
PR #2720 removed the misleading "Blockaid unfunded destination" warning
for pure Soroban custom tokens on the transaction Review step. The same
warning still appeared one step earlier on the Search address screen
(SendTo). This change consolidates the rule into a single helper so
both surfaces agree by construction.
- Add popup/helpers/sendWarnings.ts with two pure helpers:
- shouldCheckUnfundedDestinationWarning (qualitative gate: classic
asset + classic destination + non-collectible)
- shouldShowAccountDoesntExistWarning (compound: gate + strict
isFunded === false, matching Review-step semantics where isFunded
is boolean | null)
- SendTo/index.tsx: pull asset/isCollectible from transactionDataSelector
and use the compound helper; delete the dead
shouldAccountDoesntExistWarning export and unused baseReserve.
- useSimulateTxData.tsx: refactor getExpectedToFailReason in-place to
delegate the qualitative gate to the shared helper; thread destination
and isCollectible (already available in the hook) into the single
call site without widening the hook's public API.
- Tests:
- New sendWarnings.test.ts covers native, classic, SAC, pure Soroban,
collectible, contract destination, null/undefined funding, and
the early-return query-param hydration edge case.
- useSimulateTxData.test.ts updated for the new params and gains
collectible / contract-destination cases.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Import isContractId from @shared/api/helpers/soroban in sendWarnings.ts
Addressed Copilot PR review suggestion: sendWarnings.ts only uses the
isContractId predicate, so importing from the lightweight @shared source
directly avoids pulling in the larger popup/helpers/soroban module.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 56d485f commit d8ee94c
5 files changed
Lines changed: 344 additions & 35 deletions
File tree
- extension/src/popup
- components/send
- SendAmount/hooks
- __tests__
- SendTo
- helpers
- __tests__
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| 29 | + | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| |||
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| 45 | + | |
| 46 | + | |
40 | 47 | | |
41 | 48 | | |
42 | 49 | | |
| |||
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| 59 | + | |
| 60 | + | |
52 | 61 | | |
53 | 62 | | |
54 | 63 | | |
| |||
66 | 75 | | |
67 | 76 | | |
68 | 77 | | |
| 78 | + | |
| 79 | + | |
69 | 80 | | |
70 | 81 | | |
71 | 82 | | |
| |||
78 | 89 | | |
79 | 90 | | |
80 | 91 | | |
| 92 | + | |
| 93 | + | |
81 | 94 | | |
82 | 95 | | |
83 | 96 | | |
| |||
93 | 106 | | |
94 | 107 | | |
95 | 108 | | |
| 109 | + | |
| 110 | + | |
96 | 111 | | |
97 | 112 | | |
98 | 113 | | |
| |||
106 | 121 | | |
107 | 122 | | |
108 | 123 | | |
| 124 | + | |
| 125 | + | |
109 | 126 | | |
110 | 127 | | |
111 | 128 | | |
| |||
117 | 134 | | |
118 | 135 | | |
119 | 136 | | |
| 137 | + | |
| 138 | + | |
120 | 139 | | |
121 | 140 | | |
122 | 141 | | |
| |||
128 | 147 | | |
129 | 148 | | |
130 | 149 | | |
| 150 | + | |
| 151 | + | |
131 | 152 | | |
132 | 153 | | |
133 | 154 | | |
| |||
139 | 160 | | |
140 | 161 | | |
141 | 162 | | |
| 163 | + | |
| 164 | + | |
142 | 165 | | |
143 | 166 | | |
144 | 167 | | |
145 | 168 | | |
146 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
147 | 206 | | |
Lines changed: 26 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | | - | |
80 | | - | |
| 80 | + | |
| 81 | + | |
81 | 82 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
92 | 89 | | |
93 | 90 | | |
94 | 91 | | |
95 | 92 | | |
| 93 | + | |
| 94 | + | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
100 | 99 | | |
| 100 | + | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
108 | 119 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | 120 | | |
114 | 121 | | |
115 | 122 | | |
| |||
408 | 415 | | |
409 | 416 | | |
410 | 417 | | |
411 | | - | |
| 418 | + | |
412 | 419 | | |
413 | 420 | | |
414 | 421 | | |
| |||
475 | 482 | | |
476 | 483 | | |
477 | 484 | | |
| 485 | + | |
| 486 | + | |
478 | 487 | | |
479 | 488 | | |
480 | 489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | 49 | | |
61 | 50 | | |
62 | 51 | | |
| |||
108 | 97 | | |
109 | 98 | | |
110 | 99 | | |
111 | | - | |
| 100 | + | |
112 | 101 | | |
113 | 102 | | |
114 | 103 | | |
| |||
279 | 268 | | |
280 | 269 | | |
281 | 270 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
286 | 278 | | |
287 | 279 | | |
288 | 280 | | |
| |||
0 commit comments