mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-10-17 07:11:36 +02:00
fix invoice proof amount
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user