Skip to content

Add Test for Split Percentages Boundaries #103

@Baskarayelu

Description

@Baskarayelu

Description:

The remittance split contract accepts any quadruple of non-negative percentages that sum to 100. Edge cases include allocating 100% to a single category (e.g. 100/0/0/0 or 0/100/0/0) or equal splits (25/25/25/25). If validation or storage were to reject valid edge cases, or if get_split returned different values than those passed to initialize_split or update_split, downstream logic (e.g. calculate_split) would produce wrong amounts. This issue adds tests that call initialize_split (or update_split after init) with these boundary inputs and assert get_split returns the same four values and calculate_split uses them correctly.

Requirements

Test cases: After initializing the split (as owner), test at least: (1) 100, 0, 0, 0 – assert get_split returns [100, 0, 0, 0] and calculate_split(env, 1000) returns [1000, 0, 0, 0]; (2) 0, 100, 0, 0 – same idea; (3) 25, 25, 25, 25 – get_split returns [25, 25, 25, 25] and amounts are quartered. Ensure the contract does not reject valid zero-percent categories.

Acceptance Criteria

  • Tests for 100/0/0/0, 0/100/0/0, and 25/25/25/25 (or similar) with get_split and optionally calculate_split assertions.
  • Tests are in remittance_split test suite and run in CI.

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