Skip to content

[Test] blend-adapter withdraw() overflow panic branch is untested #656

Description

@collinsezedike

Description

packages/contracts/blend-adapter/src/lib.rs:301-304 calls b_tokens_to_usdc(shares, reserve.data.b_rate) inside withdraw() and does panic_with_error! on Err. The identical overflow condition is already tested for accrue() (accrue_returns_typed_error_on_overflow, lib.rs:738-749), but no equivalent test drives withdraw() into this same branch.

Acceptance Criteria

  • A new test deposits a small amount, sets the mock pool's rate high enough to overflow the conversion, and asserts adapter.withdraw(...) panics with the typed Overflow error (mirroring refresh_panics_on_accrue_overflow's pattern, but for withdraw).
  • cargo test -p blend-adapter passes.

Metadata

Metadata

Assignees

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