Skip to content

Add negative-path and overflow-boundary tests for fee/amount arithmetic in all three contracts #7

Description

@abayomicornelius

Current test suites cover basic invalid-amount cases (test_send_payment_invalid_amount, test_wrap_invalid_amount, test_collect_fee_invalid_amount, etc.) but none exercise arithmetic at the extremes: i128::MAX amounts in stellar_send::split_fee (stellar_send/src/lib.rs lines 369-381) that could hit the checked_mul/checked_sub overflow guards, fee_collector::collect_fee's checked_add overflow path when KEY_TOTAL is near i128::MAX, or token_bridge::credit_wrapped's overflow guard.

These ArithmeticOverflow error variants exist in each contract's error enum but are never actually triggered/asserted in any test file, meaning the overflow-protection code paths are currently untested and could regress silently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions