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
Context
- Target file:
contracts/split/src/lib.rs
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
fundedandamounts, duplicating logic that belongs in the contract.Acceptance Criteria
get_invoice_funding_progress(invoice_id: u64) -> u32added to the contract traitfunded * 10_000 / totalclamped to[0, 10_000]0whentotal == 0ContractError::InvoiceNotFoundfor unknown IDscargo testpassesContext
contracts/split/src/lib.rs