Skip to content

fix: complete contract test suite with all error variants covered#146

Merged
Ejirowebfi merged 1 commit into
Favourorg:mainfrom
Mac-5:fix/contract-tests
Mar 24, 2026
Merged

fix: complete contract test suite with all error variants covered#146
Ejirowebfi merged 1 commit into
Favourorg:mainfrom
Mac-5:fix/contract-tests

Conversation

@Mac-5

@Mac-5 Mac-5 commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

closes #6

  • Fix Error enum: use #[contracterror] + Copy for proper try_* client methods
  • Fix symbol_short! strings to <= 9 chars
  • Fix token fee transfer: use TokenClient::transfer (StellarAssetClient has no transfer)
  • Redesign create_token: accept pre-deployed token_address, return registry index
  • Add transfer_admin function (was missing, referenced in tests)
  • Add Debug + PartialEq to TokenInfo for assert_eq! support
  • Rewrite test.rs: 21 tests covering all public functions and all Error variants
    • test_initialize, test_initialize_already_initialized
    • test_create_token, test_create_token_insufficient_fee
    • test_set_metadata, test_set_metadata_insufficient_fee
    • test_mint_tokens, test_burn, test_burn_invalid_amount
    • test_update_fees, test_update_fees_unauthorized
    • test_get_token_info, test_get_token_info_not_found
    • pause/unpause, transfer_admin, get_tokens_by_creator tests

Description

Please include a summary of the changes and the "Why" behind them.

Related Issue

Link the issue using "Closes #XX" or "Fixes #XX".

Type of Change

Please tick the relevant options:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Testing Done

Please describe the tests you ran (unit tests, manual verification, etc.) to verify your changes.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally with my changes

- Fix Error enum: use #[contracterror] + Copy for proper try_* client methods
- Fix symbol_short! strings to <= 9 chars
- Fix token fee transfer: use TokenClient::transfer (StellarAssetClient has no transfer)
- Redesign create_token: accept pre-deployed token_address, return registry index
- Add transfer_admin function (was missing, referenced in tests)
- Add Debug + PartialEq to TokenInfo for assert_eq! support
- Rewrite test.rs: 21 tests covering all public functions and all Error variants
  - test_initialize, test_initialize_already_initialized
  - test_create_token, test_create_token_insufficient_fee
  - test_set_metadata, test_set_metadata_insufficient_fee
  - test_mint_tokens, test_burn, test_burn_invalid_amount
  - test_update_fees, test_update_fees_unauthorized
  - test_get_token_info, test_get_token_info_not_found
  - pause/unpause, transfer_admin, get_tokens_by_creator tests
@drips-wave

drips-wave Bot commented Mar 24, 2026

Copy link
Copy Markdown

@Mac-5 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

@Ejirowebfi Ejirowebfi merged commit 89539f9 into Favourorg:main Mar 24, 2026
0 of 2 checks 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.

Expand Contract Test Coverage

2 participants