Skip to content

feat: add duplicate-registration guard and structured contract errors#8

Closed
Enemuo-debug wants to merge 4 commits into
accesslayerorg:mainfrom
Enemuo-debug:mergeconflicts
Closed

feat: add duplicate-registration guard and structured contract errors#8
Enemuo-debug wants to merge 4 commits into
accesslayerorg:mainfrom
Enemuo-debug:mergeconflicts

Conversation

@Enemuo-debug

Copy link
Copy Markdown
Contributor

Title: feat: add duplicate-registration guard and structured contract errors

Body:
This PR implements structured error handling and a duplicate-registration guard for the creator registry contract as requested in #1.

Changes:

  • Defined ContractError enum with AlreadyRegistered and NotRegistered errors.
  • Updated register_creator to return Result<(), ContractError> and prevent duplicate registrations.
  • Updated buy_key to return Result<u32, ContractError> and return an error if the creator is not registered.
  • Added comprehensive tests in src/test.rs covering registration, duplicate registration, and key buying scenarios.
  • Enabled testutils feature for soroban-sdk in dev-dependencies to support contract testing.

Closes #1

@drips-wave

drips-wave Bot commented Mar 24, 2026

Copy link
Copy Markdown

@Enemuo-debug 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

Copy link
Copy Markdown
Contributor

Fix CI @Enemuo-debug

@Enemuo-debug

Copy link
Copy Markdown
Contributor Author

@Chucks1093

@Chucks1093

Copy link
Copy Markdown
Contributor

@Enemuo-debug fix merge conflict. tag me on the tg group when you do this

@Enemuo-debug

Copy link
Copy Markdown
Contributor Author

@Chucks1093 merge conflict fixed

@Chucks1093

Copy link
Copy Markdown
Contributor

@Enemuo-debug Fix ci

@Chucks1093 Chucks1093 closed this Mar 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

Development

Successfully merging this pull request may close these issues.

Add duplicate-registration guard and structured contract errors

2 participants