Skip to content

Extract assert_not_paused guard into a reusable helper function #626

Description

@Kingsman-99

Description

Many entry points in contracts/split/src/lib.rs start by reading StorageKey::Paused and returning ContractError::ContractPaused if true. Extracting this into fn assert_not_paused(env: &Env) -> Result<(), ContractError> reduces code duplication and makes the pause guard explicitly named in every entry point.

Acceptance Criteria

  • Create fn assert_not_paused(env: &Env) -> Result<(), ContractError> in contracts/split/src/lib.rs (or a guards.rs module)
  • Replace all inline pause checks with calls to this function
  • No behaviour change
  • cargo test passes

Context

  • Target file: contracts/split/src/lib.rs

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 ptsrefactorCode quality and restructuring

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions