-
Notifications
You must be signed in to change notification settings - Fork 91
[Chore] adapter-common has zero test coverage #655
Copy link
Copy link
Closed
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programchoreBuild, CI, dependency updates, or repository maintenanceBuild, CI, dependency updates, or repository maintenancecontractsInvolves writing or testing Rust/Soroban contracts in packages/contractsInvolves writing or testing Rust/Soroban contracts in packages/contractsmediumRequires familiarity with the Meridian codebase or relevant tooling; expect 4–8 hoursRequires familiarity with the Meridian codebase or relevant tooling; expect 4–8 hourstestingAdds or improves test coverage (unit, integration, or e2e)Adds or improves test coverage (unit, integration, or e2e)
Description
Activity
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programchoreBuild, CI, dependency updates, or repository maintenanceBuild, CI, dependency updates, or repository maintenancecontractsInvolves writing or testing Rust/Soroban contracts in packages/contractsInvolves writing or testing Rust/Soroban contracts in packages/contractsmediumRequires familiarity with the Meridian codebase or relevant tooling; expect 4–8 hoursRequires familiarity with the Meridian codebase or relevant tooling; expect 4–8 hourstestingAdds or improves test coverage (unit, integration, or e2e)Adds or improves test coverage (unit, integration, or e2e)
Description
packages/contracts/adapter-common/src/lib.rshas no#[cfg(test)]module at all, despite being shared scaffolding used by bothblend-adapteranddefindex-adapter. Every helper in it (require_not_initialized,store_vault_and_usdc,require_vault_auth,get_vault,get_usdc,get_or_not_initialized) is only ever exercised indirectly through the two adapters' own tests, which always initialize via__constructorfirst — so the "not yet initialized" branches are never actually hit by any test in the repo. For example,get_vault(env)returningNone(the pre-init state) has zero direct coverage.Acceptance Criteria
#[cfg(test)] mod testsinadapter-common/src/lib.rsassertsget_vault(&env)returnsNonebeforestore_vault_and_usdcis called, andSome(vault)after.require_not_initializedreturnsErr(AlreadyInitialized)onceVAULT_KEYis already set.cargo test -p adapter-commonruns and passes.