Skip to content

Test record_invoice_created increments the invoice counter by one #578

Description

@Kingsman-99

Description

record_invoice_created in contracts/split/src/stats.rs increments a persistent counter. There is no focused unit test checking that a single call advances the counter from 0 to 1 and emits a StatsUpdated event. This test would catch accidental no-ops or double-increment bugs.

Acceptance Criteria

  • Add a test named record_invoice_created_increments_counter in contracts/split/src/stats.rs
  • Call get_stats before and after record_invoice_created
  • Assert the invoice count changed from 0 to 1; volume and recipients_paid unchanged
  • cargo test passes

Context

  • Target file: contracts/split/src/stats.rs
  • Use soroban_sdk::testutils::Env with allow_non_root_auth

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 ptstestingTests — unit, integration, fuzz

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions