Skip to content

Add get_invoice_funding_progress view function #674

Description

@Kingsman-99

Description

There is no single entry point that returns the funding progress of an invoice expressed in basis points (funded * 10_000 / total). External dashboards and integration tests must compute this themselves from raw funded and amounts, duplicating logic that belongs in the contract.

Acceptance Criteria

  • New read-only function get_invoice_funding_progress(invoice_id: u64) -> u32 added to the contract trait
  • Returns funded * 10_000 / total clamped to [0, 10_000]
  • Returns 0 when total == 0
  • Returns ContractError::InvoiceNotFound for unknown IDs
  • At least one unit test covers the happy path and the fully-funded case
  • cargo test passes

Context

  • Target file: contracts/split/src/lib.rs

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 ptsfeatureNew contract feature or operation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions