Commit 2de4b27
committed
fix(sdk-coin-flr): auto-detect atomic export txs in explainTransaction
When the FLR wallet platform calls explainTransaction for a cross-chain
export without setting crossChainType, the method falls through to the
EVM explain path which cannot parse atomic transaction hex, causing the
recipient P-chain address to be missing from the result.
Avalanche/Flare atomic transactions are identified by their codec prefix
(0x00000000). Add auto-detection: if the tx hex starts with '0000'
(after stripping any 0x prefix), route to explainAtomicTransaction even
when crossChainType is not supplied. This ensures the P-chain recipient
address always appears in outputs[0].address for export transactions,
regardless of whether the caller sets crossChainType explicitly.
Add regression tests in both sdk-coin-flr and sdk-coin-flrp that verify
outputs[0].address is non-empty for C-chain export transactions.
Ticket: CECHO-1445
Session-Id: 9552a57f-ade5-43df-b67b-d19aa62e6e32
Task-Id: 1785a314-e5c6-4b30-b86e-46e56c9206ed1 parent dc5729c commit 2de4b27
3 files changed
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
180 | 183 | | |
181 | 184 | | |
182 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
252 | 265 | | |
253 | 266 | | |
254 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
285 | 298 | | |
286 | 299 | | |
287 | 300 | | |
| |||
0 commit comments