Skip to content

feat: settlement OverDraft variant (#531)#577

Open
NEA-DEV-coder wants to merge 1 commit into
CalloraOrg:mainfrom
NEA-DEV-coder:task/overdraft-error
Open

feat: settlement OverDraft variant (#531)#577
NEA-DEV-coder wants to merge 1 commit into
CalloraOrg:mainfrom
NEA-DEV-coder:task/overdraft-error

Conversation

@NEA-DEV-coder

Copy link
Copy Markdown

Summary

Adds SettlementError::OverDraft = 23 to the settlement contract, providing a dedicated, semantically distinct error for overdraft attempts (withdrawal amount exceeds developer balance).

Changes

  • contracts/settlement/src/errors.rs — new OverDraft = 23 variant with /// rustdoc and doc-table row
  • contracts/settlement/src/lib.rswithdraw_developer_balance now returns OverDraft instead of InsufficientDeveloperBalance when amount > current_balance
  • contracts/settlement/src/test_error_codes.rs — added (23, OverDraft) mapping, bumped uniqueness assertion to 23, added doc-line check
  • docs/ERROR_CODES.md — added row 23 to the Settlement table

Acceptance criteria

  • New OverDraft variant at stable code 23
  • Used in withdraw_developer_balance overdraft guard
  • test_error_codes.rs uniqueness + doc-line tests updated
  • ERROR_CODES.md updated

Closes #531

Add SettlementError::OverDraft = 23 to distinguish overdraft attempts
(withdrawal amount > developer balance) from other insufficient-balance
conditions. Replace InsufficientDeveloperBalance in
withdraw_developer_balance with OverDraft.

- errors.rs: add OverDraft = 23 variant with doc comment
- lib.rs: return OverDraft instead of InsufficientDeveloperBalance
- test_error_codes.rs: add mapping + doc line assertion for OverDraft
- docs/ERROR_CODES.md: add row 23 to Settlement table

Closes CalloraOrg#531
@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@NEA-DEV-coder Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@GBOYEE

GBOYEE commented Jun 28, 2026

Copy link
Copy Markdown

@GBOYEE has applied to work on this issue as part of the Stellar Wave Program's 6th wave.

Implement following existing patterns and conventions. Add tests, ensure CI passes, and document any new API surface.

ℹ️ Repo Maintainers: To accept this application, review their application or assign @GBOYEE to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ContractError::OverDraft to settlement

2 participants