Skip to content

fix: send hardware payment proofs - #1199

Open
ben-kaufman wants to merge 5 commits into
masterfrom
codex/paykit-hardware-payment-proofs-android
Open

fix: send hardware payment proofs#1199
ben-kaufman wants to merge 5 commits into
masterfrom
codex/paykit-hardware-payment-proofs-android

Conversation

@ben-kaufman

Copy link
Copy Markdown
Contributor

This PR sends Paykit payment proofs for on-chain payment requests paid from a hardware wallet. It is stacked on #1178 so the proof-delivery changes remain isolated from the subscription work.

Description

  • Prepares the payment proof immediately before hardware broadcast, after signing succeeds.
  • Preserves the existing private Payment List consumption and request acceptance order.
  • Completes the proof with the broadcast transaction ID before showing payment success.
  • Keeps preparation idempotent across hardware broadcast retries.

Preview

N/A

QA Notes

Manual Tests

  • 1. Incoming on-chain Payment Request → choose a hardware wallet → review → sign and broadcast: payment succeeds and the requester receives its transaction proof.
  • 2. regression: hardware broadcast retry → retry the same signed transaction: the request is not accepted twice and the private Payment List is not consumed twice.

Automated Checks

  • AppViewModelSendFlowTest.kt: verifies hardware proof preparation ordering and idempotency, plus proof completion with the broadcast transaction ID.
  • ./gradlew testDevDebugUnitTest --tests 'to.bitkit.viewmodels.AppViewModelSendFlowTest'

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown

Greptile Summary

This PR extends incoming on-chain Paykit payment proofs to hardware-wallet sends while preserving preparation idempotency and the existing request-consumption order.

  • Prepares the proof immediately before broadcasting a signed hardware transaction.
  • Completes the proof with the resulting transaction ID before showing payment success.
  • Adds focused tests for preparation ordering, retries, and proof completion.

Confidence Score: 5/5

The PR appears safe to merge based on the reviewed hardware-send and payment-proof paths.

The hardware flow prepares the proof before broadcast, retains existing contact-payment preparation safeguards, completes the proof with the broadcast transaction ID, and handles repository failures without interrupting payment-success navigation.

Important Files Changed

Filename Overview
app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt Adds idempotent hardware proof preparation and transaction-ID-based proof completion without an accepted correctness issue.
app/src/main/java/to/bitkit/ui/sheets/SendSheet.kt Completes the hardware payment proof before advancing the successful broadcast flow.
app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt Verifies proof preparation ordering, repeated preparation behavior, and completion with the broadcast transaction ID.

Sequence Diagram

sequenceDiagram
    participant U as User
    participant H as Hardware send
    participant A as AppViewModel
    participant P as Paykit proof repository
    participant W as Hardware wallet
    U->>H: Confirm hardware payment
    H->>W: Sign transaction
    W-->>H: Signed transaction
    H->>A: prepareHardwareContactPayment()
    A->>P: Prepare payment proof
    A->>A: Consume private list and accept request
    A-->>H: Preparation succeeded
    H->>H: Broadcast signed transaction
    H-->>A: Transaction ID
    A->>P: Complete proof with transaction ID
    A->>A: Show payment success
Loading

Reviews (1): Last reviewed commit: "fix: send hardware payment proofs" | Re-trigger Greptile

@ben-kaufman
ben-kaufman force-pushed the codex/paykit-hardware-payment-proofs-android branch from 48f0d0a to 82d6c73 Compare August 31, 2026 17:49
@ben-kaufman ben-kaufman mentioned this pull request Aug 31, 2026
13 tasks

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@ben-kaufman
ben-kaufman force-pushed the codex/paykit-hardware-payment-proofs-android branch from 82d6c73 to e1053b0 Compare September 1, 2026 12:48
@ben-kaufman
ben-kaufman force-pushed the codex/paykit-payment-proofs-android branch from e9ce645 to ad132c8 Compare September 1, 2026 12:54
@ben-kaufman
ben-kaufman force-pushed the codex/paykit-hardware-payment-proofs-android branch 2 times, most recently from 850c252 to bac8656 Compare September 1, 2026 18:06
@ben-kaufman
ben-kaufman force-pushed the codex/paykit-payment-proofs-android branch from f08381d to 1eee260 Compare September 1, 2026 18:19
@ben-kaufman
ben-kaufman force-pushed the codex/paykit-hardware-payment-proofs-android branch from bac8656 to 6bb8501 Compare September 1, 2026 18:19
@ben-kaufman
ben-kaufman force-pushed the codex/paykit-payment-proofs-android branch from 1eee260 to e819704 Compare September 1, 2026 18:29
@ben-kaufman
ben-kaufman force-pushed the codex/paykit-hardware-payment-proofs-android branch from 6bb8501 to 7a6646c Compare September 1, 2026 18:29
@ben-kaufman
ben-kaufman force-pushed the codex/paykit-payment-proofs-android branch from e819704 to f17eff8 Compare September 1, 2026 18:37
@ben-kaufman
ben-kaufman force-pushed the codex/paykit-hardware-payment-proofs-android branch from 7a6646c to a92ca77 Compare September 1, 2026 18:38
@ben-kaufman
ben-kaufman force-pushed the codex/paykit-payment-proofs-android branch 4 times, most recently from c72a4c3 to 10ff0df Compare September 1, 2026 19:08
@ben-kaufman
ben-kaufman force-pushed the codex/paykit-hardware-payment-proofs-android branch from a92ca77 to af462ca Compare September 1, 2026 19:17
ovitrif
ovitrif previously approved these changes Sep 1, 2026

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Base automatically changed from codex/paykit-payment-proofs-android to master September 2, 2026 10:16
@jvsena42
jvsena42 dismissed ovitrif’s stale review September 2, 2026 10:16

The base branch was changed.

@jvsena42

jvsena42 commented Sep 2, 2026

Copy link
Copy Markdown
Member

Starting review

Comment thread app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt Outdated
Comment thread app/src/main/java/to/bitkit/ui/sheets/SendSheet.kt
Comment thread app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt Outdated
@ben-kaufman
ben-kaufman force-pushed the codex/paykit-hardware-payment-proofs-android branch from af462ca to 1d50070 Compare September 2, 2026 13:22
@ben-kaufman
ben-kaufman force-pushed the codex/paykit-hardware-payment-proofs-android branch 2 times, most recently from d0bf6c2 to e84d74a Compare September 2, 2026 13:46
@ben-kaufman
ben-kaufman force-pushed the codex/paykit-hardware-payment-proofs-android branch from e84d74a to 35c0b4c Compare September 2, 2026 13:56
ovitrif
ovitrif previously approved these changes Sep 2, 2026

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Comment thread app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt
@ben-kaufman
ben-kaufman force-pushed the codex/paykit-hardware-payment-proofs-android branch from 16c7158 to 1769cb2 Compare September 2, 2026 17:18
@ben-kaufman

Copy link
Copy Markdown
Contributor Author

Follow-up: current signed head is 1769cb2. The first CI run compiled the production code and ran 2,290 tests; its only failure was the new assertion mixing one raw endpoint with Mockito matchers. That assertion now uses eq(endpoint), static analysis remains clean for all changed files, and fresh CI is running.

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

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.

3 participants