Skip to content

do_complete_payment() does not transfer any tokens despite its name #258

Description

@SYLVIANNORUKA

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions