Skip to content

[Test] defindex-adapter deposit() NotInitialized panic branch is untested #664

Description

@collinsezedike

Description

packages/contracts/defindex-adapter/src/lib.rs:135-138 calls get_or_not_initialized for DFX_VAULT inside deposit(). The equivalent branch is already tested for withdraw() (withdraw_panics_with_typed_error_when_dfx_vault_is_unset, lib.rs:362-380), but no test removes DFX_VAULT before calling deposit().

Acceptance Criteria

  • A new test constructs the adapter, removes DFX_VAULT from instance storage via env.as_contract, and asserts adapter.deposit(&amount) panics with the typed NotInitialized error.
  • cargo test -p defindex-adapter passes.

Note

This file also has two other PRs open against it right now (#634, #622) touching unrelated parts of the same source — if you hit a merge conflict on pickup, it's just from those landing first, not a real dependency on either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programchoreBuild, CI, dependency updates, or repository maintenancecontractsInvolves writing or testing Rust/Soroban contracts in packages/contractstestingAdds or improves test coverage (unit, integration, or e2e)trivialSelf-contained task, completable in < 2 hours with no deep protocol knowledge required

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions