Skip to content

close_credit_line utilization guards #155

@greatest0fallt1me

Description

@greatest0fallt1me

Description

Test and document whether borrower close requires zero utilization and how admin forced close behaves.

Requirements and context

  • Match product policy.
  • Update state machine docs.

Suggested execution

Fork and branch

Fork the repo and create a branch:

git checkout -b test/close-nonzero-utilization

Implement changes

  • Add tests for non-zero utilization close attempts.
  • Align close_credit_line implementation if needed.

Test and commit

Run the full test suite, cover edge cases, and include test output plus security notes (assumptions, trust boundaries, failure modes) in the PR description.

Run tests

cargo test -p creditra-credit

Example commit message

test(credit): close_credit_line utilization guards

Guidelines

  • Minimum 95% line coverage (cargo llvm-cov as documented in the contracts README).

  • Clear documentation (Rust /// doc comments on public items; update docs/credit.md when behavior changes).

  • Timeframe: 96 hours.

  • Optionally run: cargo llvm-cov --workspace --all-targets --fail-under-lines 95 before merge.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions