Skip to content

test(dto): RealUnitSellPaymentInfoDto.fromJson (+3 tests)#373

Merged
TaprootFreak merged 1 commit into
developfrom
test/sell-payment-info-dto
May 15, 2026
Merged

test(dto): RealUnitSellPaymentInfoDto.fromJson (+3 tests)#373
TaprootFreak merged 1 commit into
developfrom
test/sell-payment-info-dto

Conversation

@TaprootFreak

Copy link
Copy Markdown
Contributor

Summary

Stage 49 of the coverage push. Final big sell-flow DTO that wasn't reachable from the payment_dtos aggregate file — it recursively pulls in `Eip7702Data` + `DfxFeesData` + `BeneficiaryDto` + `PriceStep`.

Cases

Target Cases
`RealUnitSellPaymentInfoDto.fromJson` 3 — full happy-path wire shape; nested `Eip7702Data` DTO walked all the way down (one leaf per level pinned); integer wire values for `amount` / `exchangeRate` / `rate` widen to double

What's pinned

  • The recursive `fromJson` chain actually parses every nested DTO. One leaf field per level (`relayerAddress` → `domain.chainId` → `message.delegate` → `amountWei`) is pinned so a regression to "stops at top level" surfaces here.
  • `Currency.fromCode` is the wire→Dart conversion; `CHF` round-trips correctly.
  • Integer-typed JSON values widen to double for the floating-point fields — pins the contract used by partner APIs that sometimes serialize whole-number rates as `int`.

Test plan

  • `flutter test test/packages/service/dfx/models/payment/sell_payment_info_dto_test.dart` — 3 pass
  • `flutter analyze` clean on the new file
  • CI green

Stage 49 of the coverage push. Final big sell-flow DTO that
wasn't reachable from the payment_dtos aggregate file (it
recursively pulls in Eip7702Data + DfxFeesData + BeneficiaryDto
+ PriceStep).

- happy path: every top-level field parsed
- nested Eip7702Data DTO walked all the way down (one leaf per
  level pinned)
- int wire values widen to double for amount / exchangeRate / rate
@TaprootFreak TaprootFreak marked this pull request as ready for review May 15, 2026 20:03
@TaprootFreak TaprootFreak merged commit a947291 into develop May 15, 2026
1 check passed
@TaprootFreak TaprootFreak deleted the test/sell-payment-info-dto branch May 15, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant