Description
do_complete_payment() is documented as "Complete a payment with a risk assessment," but its implementation is a single line -- Self::get_effective_fee_for_payment(...) -- that performs no token transfer and mutates no state; it is purely a fee-preview calculation identical in effect to calling get_effective_fee_for_payment() directly. An integrator reading the function name and doc comment in isolation could reasonably believe calling it actually moves funds, when it does not.
Affected modules: contracts/hamplard/src/lib.rs
A function named and documented as completing a payment performs no payment at all.
Expected Behavior
Either rename do_complete_payment() to reflect that it is a read-only fee preview (and consider removing it as a duplicate of get_effective_fee_for_payment()), or update its doc comment to explicitly clarify it performs no transfer.
Tasks
Rename do_complete_payment() (or remove it in favor of get_effective_fee_for_payment()) to avoid implying it moves funds.
Update the doc comment to accurately describe its behavior if the function is kept.
Grep the backend/SDK integration code for any usage that assumes it performs a transfer.
Description
do_complete_payment() is documented as "Complete a payment with a risk assessment," but its implementation is a single line -- Self::get_effective_fee_for_payment(...) -- that performs no token transfer and mutates no state; it is purely a fee-preview calculation identical in effect to calling get_effective_fee_for_payment() directly. An integrator reading the function name and doc comment in isolation could reasonably believe calling it actually moves funds, when it does not.
Affected modules: contracts/hamplard/src/lib.rs
A function named and documented as completing a payment performs no payment at all.
Expected Behavior
Either rename do_complete_payment() to reflect that it is a read-only fee preview (and consider removing it as a duplicate of get_effective_fee_for_payment()), or update its doc comment to explicitly clarify it performs no transfer.
Tasks
Rename do_complete_payment() (or remove it in favor of get_effective_fee_for_payment()) to avoid implying it moves funds.
Update the doc comment to accurately describe its behavior if the function is kept.
Grep the backend/SDK integration code for any usage that assumes it performs a transfer.