Skip to content

test(dto): payment + eip7702 DTOs (+10 tests)#351

Merged
TaprootFreak merged 1 commit into
developfrom
test/payment-dtos
May 15, 2026
Merged

test(dto): payment + eip7702 DTOs (+10 tests)#351
TaprootFreak merged 1 commit into
developfrom
test/payment-dtos

Conversation

@TaprootFreak
Copy link
Copy Markdown
Contributor

Summary

Stage 27 of the coverage push. Wire-format DTOs that were missing direct tests — important to pin because they encode the contract with the DFX backend.

DTO Cases
`PriceStep.fromJson` 2
`BroadcastTransactionRequestDto.toJson` 1
`BroadcastTransactionResponseDto.fromJson` 1
`RealUnitUnsignedTransactionsRequestDto.fromJson` 1
`RealUnitSellConfirmDto.toJson` 4
`Eip7702DelegationDto.toJson` 1

What's pinned

  • PriceStep: full wire shape (`source` / `from` / `to` / `price` / `timestamp`); integer `price` widens to double (matches the `num` cast in production).
  • Broadcast req/resp: request serialises the four signature parts (`unsignedTx`, `r`, `s`, `v`); response extracts `txHash`.
  • Unsigned-transactions request: parses `swap` + `deposit`.
  • SellConfirmDto: the conditional-key serialisation (4 branches — txHash-only, eip7702-only, both, neither/empty). This is load-bearing on the wire and a regression here would silently send empty confirms.
  • Eip7702DelegationDto: round-trips all five fields.

Test plan

  • `flutter analyze` clean
  • `flutter test` — 10 / 10 passing locally
  • CI green

Stage 27 of the coverage push. Wire-format DTOs.

- PriceStep.fromJson (2): full wire shape (source/from/to/price/
  timestamp); accepts an integer price + widens to double
- BroadcastTransactionRequestDto.toJson (1): serialises
  unsignedTx + r + s + v
- BroadcastTransactionResponseDto.fromJson (1): extracts txHash
- RealUnitUnsignedTransactionsRequestDto.fromJson (1): parses
  swap + deposit
- RealUnitSellConfirmDto.toJson (4): txHash-only branch, eip7702-
  only branch, both fields together, empty object when both null
- Eip7702DelegationDto.toJson (1): round-trips the 5 fields
@TaprootFreak TaprootFreak marked this pull request as ready for review May 15, 2026 17:24
@TaprootFreak TaprootFreak merged commit 22dc30b into develop May 15, 2026
1 check passed
@TaprootFreak TaprootFreak deleted the test/payment-dtos branch May 15, 2026 17:24
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