Commit fb69c69
committed
fix(sdk-coin-flrp): subtract minImportToCFee from ExportInP outputAmount
For P→C exports (ExportInP), the exported UTXO amount includes the
C-chain import fee that is added by the platform during transaction
building (amount = userAmount + importToCFee). Without adjusting the
outputAmount, the confirmation UI reads the gross UTXO amount as the
displayed send amount. When the platform additionally applies its own
import-fee subtraction from the same gross value, the resulting
spendAmount can appear as 0 or be misinterpreted, causing the export
confirmation UI to display "- TFLR" instead of the correct amount.
Fix: in Flrp.explainTransaction, when the transaction is a P-chain
export (ExportInP, !isTransactionForCChain), subtract minImportToCFee
from outputAmount and each output's amount. This yields the minimum
expected net C-chain receipt, aligning the confirmation display with
the amount the user will actually receive after ImportInC, consistent
with how ExportInC subtracts minImportToPFee (CECHO-1450).
Add minImportToCFee to the FlareNetwork interface and set it to
2850000 nFLR (250 nFLR/gas × ~11400 gas, the minimum EVM import fee).
Add test coverage verifying ExportInP outputAmount is adjusted.
Ticket: CECHO-1518
Session-Id: 6f2ea6bd-01d6-4a82-a82f-0af0974e5165
Task-Id: 65e37cf1-5c7c-4605-8126-070b8d699a021 parent ad4998b commit fb69c69
3 files changed
Lines changed: 47 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
454 | 472 | | |
455 | 473 | | |
456 | 474 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
316 | 340 | | |
317 | 341 | | |
318 | 342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
2318 | 2319 | | |
2319 | 2320 | | |
2320 | 2321 | | |
2321 | | - | |
| 2322 | + | |
| 2323 | + | |
2322 | 2324 | | |
2323 | 2325 | | |
2324 | 2326 | | |
| |||
2354 | 2356 | | |
2355 | 2357 | | |
2356 | 2358 | | |
2357 | | - | |
| 2359 | + | |
| 2360 | + | |
2358 | 2361 | | |
2359 | 2362 | | |
2360 | 2363 | | |
| |||
0 commit comments