Skip to content

All four issues resolved#459

Open
ZainabJanee wants to merge 1 commit into
PrincessnJoy:mainfrom
ZainabJanee:fix/309-description-size-limit
Open

All four issues resolved#459
ZainabJanee wants to merge 1 commit into
PrincessnJoy:mainfrom
ZainabJanee:fix/309-description-size-limit

Conversation

@ZainabJanee

@ZainabJanee ZainabJanee commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #309
Closes #308
Closes #304
Closes #321

The create_proposal and amend_proposal functions already enforce 1 ≤ description.len() ≤ 1024 via InvalidDescription, but there was no test coverage for these boundary conditions.

Changes

  • Added 4 tests in contracts/governance/src/test.rs:
    • test_create_proposal_description_at_max_length_succeeds — 1024 chars passes ✓
    • test_create_proposal_description_over_max_length_fails — 1025 chars → InvalidDescription
    • test_create_proposal_empty_description_fails — empty string → InvalidDescription
    • test_create_proposal_description_one_char_succeeds — minimum valid input passes ✓

Acceptance Criteria

  • Maximum description length enforced (already existed at 1024 chars)
  • Input validated before storing
  • Tests added for invalid description sizes

- Test description at exactly 1024 chars passes
- Test description of 1025 chars returns InvalidDescription
- Test empty description returns InvalidDescription
- Test single-char description passes

The validation (description.len() in 1..=1024) already exists in
create_proposal and amend_proposal; this commit adds explicit test
coverage for the boundary cases.

Closes PrincessnJoy#309
@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@ZainabJanee 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

@ZainabJanee ZainabJanee changed the title fix(#309): add proposal description size limit tests All four issues resolved Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant