Skip to content

test: add regression test for minimum handle length#377

Merged
Chucks1093 merged 3 commits into
accesslayerorg:mainfrom
shadrach68:creatorREG
May 31, 2026
Merged

test: add regression test for minimum handle length#377
Chucks1093 merged 3 commits into
accesslayerorg:mainfrom
shadrach68:creatorREG

Conversation

@shadrach68
Copy link
Copy Markdown
Contributor

Summary

This PR adds regression testing to cover the minimum boundary of the handle validation during creator registration. While the maximum and empty-string boundaries were previously tested, this ensures that the shortest allowed handle is accepted without error.

Changes

  • Added minimum length success test: Registers a creator with a handle of exactly HANDLE_LEN_MIN characters and asserts that the registration succeeds and the state is updated correctly.
  • Added below-minimum length failure test: Attempts to register a creator with a handle of HANDLE_LEN_MIN - 1 characters and asserts it is cleanly rejected with ContractError::HandleTooShort.
  • Dynamic Constant Reference: Both tests import and reference the HANDLE_LEN_MIN constant directly from the contract to size the byte arrays dynamically, avoiding hardcoded values.

Related Issues

Closes #367

Checklist

  • Happy-path test exists for the exact minimum valid length.
  • Failure path asserts no unintended state is stored when the handle is too short.
  • Tests use contract_test_env helpers where possible.
  • Code passes cargo test --workspace locally.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

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

@Chucks1093 Chucks1093 merged commit f96a422 into accesslayerorg:main May 31, 2026
1 check passed
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 regression test for creator registration with minimum valid handle length

2 participants