fix invoice proof amount

This commit is contained in:
wiesche
2026-09-01 19:48:37 +02:00
parent 1d342e59de
commit 9838ac3d8d
4 changed files with 4 additions and 7 deletions
@@ -213,6 +213,7 @@ fn contract_early_proofs_rsr_test_impl(test_dir: &'static str) -> Result<(), lib
)?;
let invoice_proof = invoice_proof.unwrap();
assert_eq!(invoice_proof.amount, 5_000_000_000);
let invoice_proof_json = serde_json::to_string(&invoice_proof).unwrap();
// Should have all proof fields filled out
@@ -205,6 +205,7 @@ fn contract_early_proofs_srs_test_impl(test_dir: &'static str) -> Result<(), lib
)?;
let invoice_proof = invoice_proof.unwrap();
assert_eq!(invoice_proof.amount, 5_000_000_000);
let invoice_proof_json = serde_json::to_string(&invoice_proof).unwrap();
// Should have all proof fields filled out
+2 -6
View File
@@ -569,12 +569,8 @@ where
}
// Pull out all needed fields, returning an error if they're not present
let tx = txs.1[0].clone();
let amount = if tx.amount_credited >= tx.amount_debited {
tx.amount_credited - tx.amount_debited
} else {
// TODO: Invoice proof not expecting fee included here
tx.amount_debited - tx.amount_credited
};
// Contract tx logs store the agreed net change separately from the fee.
let amount = tx.amount_credited.abs_diff(tx.amount_debited);
let (mut proof, sender_part_sig) = match tx.payment_proof {
Some(p) => {
-1
View File
@@ -56,7 +56,6 @@ Separating side effects until the 'save_step' part would make these functions mu
- Distinguish the transfer amount from the fee-adjusted balance change in `view`.
- Raise the replacement fee when `revoke` races a transaction already in the mempool.
- Merge invoice-proof retrieval with the existing payment-proof API.
- Confirm that invoice-proof retrieval excludes the transaction fee from the amount.
- Add a Grin node API for kernel lookup by MMR index, then use the witness index instead
of searching by commitment.
- Align the proof memo encoding with the early payment proofs proposal.