Skip to content

Add settlement idempotency lock tests #358

Description

@edehvictor

Summary

Add tests and guardrails ensuring repeated settlement calls for the same payroll batch cannot pay twice.

Why This Matters

Network retries and user double-clicks should not create duplicate payroll settlements.

Suggested Files

  • contracts/src/settlement.rs
  • contracts/src/payroll.rs
  • contracts/src/storage.rs
  • contracts/tests/settlement_idempotency.rs

Tasks

  • Store settlement completion markers before or atomically with finalization.
  • Reject duplicate settlement attempts.
  • Allow safe read-only confirmation of already-settled runs.
  • Add retry-focused tests.

Acceptance Criteria

  • A payroll batch cannot settle more than once.
  • Duplicate execution attempts return a stable already-settled error.
  • Confirmation reads remain available.
  • Tests cover retry and duplicate submission.

Coordination

Join the Telegram channel for proper coordination: https://t.me/zkpayroll

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions