Skip to content

[Codebase Audit] Reduce panic-prone calls in tests/mint_burn_integration.rs #576

Description

@kelly-musk

Problem

tests/mint_burn_integration.rs contains 27 panic-prone calls (unwrap, expect, or panic!).

Evidence

  • tests/mint_burn_integration.rs:41.expect("DATABASE_URL must be set for integration tests");
  • tests/mint_burn_integration.rs:42PgPool::connect(&url).await.expect("db pool")
  • tests/mint_burn_integration.rs:47Arc::new(MintBurnMetrics::new(&registry).expect("metrics"))
  • tests/mint_burn_integration.rs:91.expect("create processed_events");
  • tests/mint_burn_integration.rs:105.expect("create ledger_cursor");

Proposed fix

Replace non-essential unwrap/expect usages with typed error propagation and contextual logging. Keep explicit panics only where unrecoverable invariants are well-documented.

Acceptance criteria

  • All avoidable panic-prone calls in this file are removed or justified with comments/tests.
  • Error paths return typed errors and preserve observability context.
  • Existing tests pass (or new tests cover changed paths).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    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