Skip to content

test(eip7702): Data + Confirm/Authorization DTOs (+8 tests)#358

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

test(eip7702): Data + Confirm/Authorization DTOs (+8 tests)#358
TaprootFreak merged 1 commit into
developfrom
test/eip7702-dtos

Conversation

@TaprootFreak
Copy link
Copy Markdown
Contributor

Summary

Stage 34 of the coverage push. Pure DTO tests for EIP-7702 wire shapes used in the RealUnit sell flow.

Cases

Target Cases
`Eip7702Domain.fromJson` 1 — name + version + chainId + verifyingContract
`Eip7702TypeField.fromJson` 1 — name + type
`Eip7702Types.fromJson` 1 — `Delegation` + `Caveat` field lists
`Eip7702Message.fromJson` 1 — delegate / delegator / authority / caveats / salt
`Eip7702Data.fromJson` 1 — every top-level field + recursive nested DTO parse
`Eip7702AuthorizationDto.toJson` 2 — six-field round-trip; `chainId` / `nonce` accept both number and string (per source comment)
`Eip7702ConfirmDto.toJson` 1 — nested `delegation` + `authorization`

What's pinned

  • The nested `fromJson` chain (`Eip7702Data` → `Eip7702Domain` / `Eip7702Types` / `Eip7702Message`) actually walks all the way down.
  • `Eip7702AuthorizationDto.chainId` and `nonce` are typed `dynamic` on purpose so the wire-side number-or-string contract holds — covered explicitly.
  • `Eip7702ConfirmDto.toJson` preserves both nested JSON shapes byte-for-byte.

Test plan

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

Stage 34 of the coverage push. EIP-7702 wire-format DTOs.

- Eip7702Domain.fromJson (1): name + version + chainId +
  verifyingContract
- Eip7702TypeField.fromJson (1): name + type
- Eip7702Types.fromJson (1): Delegation + Caveat field lists
- Eip7702Message.fromJson (1): delegate / delegator / authority /
  caveats / salt
- Eip7702Data.fromJson (1): every top-level field + recursive
  nested DTO parse
- Eip7702AuthorizationDto.toJson (2): six-field round-trip;
  chainId / nonce accept both number and string (per source comment)
- Eip7702ConfirmDto.toJson (1): nested delegation + authorization
@TaprootFreak TaprootFreak marked this pull request as ready for review May 15, 2026 19:00
@TaprootFreak TaprootFreak merged commit d034b09 into develop May 15, 2026
1 check passed
@TaprootFreak TaprootFreak deleted the test/eip7702-dtos branch May 15, 2026 19:00
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