Skip to content

test: fuzz grant_role with boundary addresses - #857

Open
enny791 wants to merge 6 commits into
BCPathway:mainfrom
enny791:test/766-fuzz-grant-role-boundary-addresses
Open

test: fuzz grant_role with boundary addresses#857
enny791 wants to merge 6 commits into
BCPathway:mainfrom
enny791:test/766-fuzz-grant-role-boundary-addresses

Conversation

@enny791

@enny791 enny791 commented Aug 28, 2026

Copy link
Copy Markdown

Closes #766

Summary

Fuzz testing grant_role with boundary addresses (empty bytes and max-length strings).

What Changed

  • Added fuzz_grant_role_boundary_addresses in contracts/admin/src/tests/proptest.rs using proptest! to generate arbitrary bytes.
  • Added fuzz_grant_role_empty_and_max_length explicitly testing length 0 and 10000 strings.
  • Asserted that invalid arguments result in decoding errors via env.try_invoke_contract.

Acceptance Criteria Checklist

  • Fuzz grant_role with max-length strings and empty bytes.
  • Assert expected decoding errors.
  • Code compiles and adheres to Soroban/Rust/TypeScript best practices.
  • Unit tests cover both happy paths and expected error states.
  • All CI/CD pipelines pass successfully.

Closes BCPathway#766

- Added a proptest to fuzz \grant_role\ with various random byte sequences.
- Added a specific test case for explicitly empty strings/bytes and excessively long strings.
- Asserted that when an invalid Address (like max-length string or empty bytes) is passed to \grant_role\, the contract cleanly fails with a decoding error.
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

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

p3ris0n and others added 5 commits August 28, 2026 12:01
Sync with origin/main and apply the workspace/clippy fixes required for current CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	Cargo.toml
#	contracts/admin/src/tests/proptest.rs
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.

[Testing] Fuzz: grant_role with boundary addresses

4 participants