Skip to content

test(sell-service): confirmPayment software wallet happy path (+2 tests)#383

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

test(sell-service): confirmPayment software wallet happy path (+2 tests)#383
TaprootFreak merged 1 commit into
developfrom
test/sell-payment-info-confirm-happy

Conversation

@TaprootFreak
Copy link
Copy Markdown
Contributor

Summary

Stage 59 of the coverage push. Drives `confirmPayment` end-to-end with a real `EthPrivateKey` credential so the signing chain (`Eip712Signer.signDelegation` + `Eip7702Signer.signAuthorization`) is exercised, not just the validation guard.

Cases

Case What's pinned
Software wallet happy path PUTs to `/v1/realunit/sell//confirm`; body carries the `eip7702` envelope (not the `txHash` branch); delegation block mirrors the eip7702 data + carries a 65-byte real signature; authorization block carries the matching chain / nonce / (r, s, yParity)
4xx response `ApiException` propagates from `_sendConfirm`

What's pinned

  • The delegation `salt` is serialised as a string (`'0'`), not the raw int. Pinned via string equality so a regression to numeric serialization surfaces.
  • The authorization block uses `chainId` from `domain.chainId`, `address` from `delegatorAddress` (the MetaMask Delegator contract), and `nonce` from `userNonce` — the test asserts each value explicitly.
  • The signature length pin (132 chars including `0x`) catches a serialization regression that drops the trailing `v` byte.
  • Deterministic test key is shared with `FakeBitboxCredentials`. Reusing it keeps test infrastructure consistent and lets future BitBox-vs-software comparison tests reuse the same address.

Test plan

  • `flutter test test/packages/service/dfx/real_unit_sell_payment_info_service_confirm_test.dart` — 2 pass
  • `flutter analyze` clean on the new file
  • CI green

Stage 59 of the coverage push. Drives confirmPayment end-to-end
with a real EthPrivateKey credential so the signing chain
(Eip712Signer.signDelegation + Eip7702Signer.signAuthorization)
is exercised, not just the validation guard.

- signs delegation + authorization and PUTs the eip7702 envelope
  to /v1/realunit/sell/<id>/confirm; delegation block mirrors
  the eip7702 data + carries a 65-byte signature; authorization
  block carries the matching chain/nonce/(r,s,yParity)
- 4xx response → ApiException
@TaprootFreak TaprootFreak marked this pull request as ready for review May 15, 2026 20:00
@TaprootFreak TaprootFreak merged commit 9e9f216 into develop May 15, 2026
1 check passed
@TaprootFreak TaprootFreak deleted the test/sell-payment-info-confirm-happy branch May 15, 2026 20: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