Skip to content

feat(contracts): add optional approver field and approve_invoice to i…#129

Merged
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
aji70:main
May 30, 2026
Merged

feat(contracts): add optional approver field and approve_invoice to i…#129
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
aji70:main

Conversation

@aji70
Copy link
Copy Markdown
Contributor

@aji70 aji70 commented May 30, 2026

Summary

Adds an optional approval step to the invoice workflow. When an invoice is created with an approver address, approve_invoice() must be called by that approver before release() can execute.
Invoices without an approver are unaffected.

Changes

  • types.rs — added approver: Option and approved: bool fields to the invoice struct; added approver: Option field to InvoiceOptions struct
  • lib.rs — added approve_invoice() requiring approver auth and setting approved = true; updated release() to gate on approved when an approver is set; updated all invoice creation paths to
    pass approver parameter

Testing

  • Test: invoice with approver blocks release until approved, then releases successfully
  • Test: release with unapproved approver panics with "awaiting approval"
  • Test: invoice without approver releases without any approval gate
  • All existing cargo tests pass; cargo clippy passes with zero new warnings

Closes #25

…nvoice workflow (Stellar-split#25)

- Added approver: Option<Address> and approved: bool fields to Invoice struct
- Added approver field to InvoiceOptions for specifying an approver at invoice creation
- Implemented approve_invoice() function requiring approver authentication
- Updated release() to check approval gate when approver is set
- Added comprehensive tests for approval workflow and non-approver invoices
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@aji70 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Kingsman-99 Kingsman-99 merged commit 20bcf62 into Stellar-split:main May 30, 2026
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.

Build invoice approval workflow

2 participants