Skip to content

Add invalid balance lookup test coverage (#32)#116

Open
haanarrh wants to merge 2 commits intoaccesslayerorg:mainfrom
haanarrh:fix/issue-32-invalid-balance-lookup
Open

Add invalid balance lookup test coverage (#32)#116
haanarrh wants to merge 2 commits intoaccesslayerorg:mainfrom
haanarrh:fix/issue-32-invalid-balance-lookup

Conversation

@haanarrh
Copy link
Copy Markdown

@haanarrh haanarrh commented Apr 2, 2026

Summary

  • Added comprehensive test coverage for invalid balance and supply lookups in creator-keys.
  • Verified that read-only methods like get_key_balance, get_total_key_supply, and get_creator_holder_count return 0 for unregistered creators, avoiding panics.
  • Confirmed that get_creator_supply correctly returns Err(ContractError::NotRegistered) for missing creators.
  • Added edge case tests for get_key_balance where the creator is the holder and where the contract address itself is the holder.
  • Validated that get_creator_details returns a structured view with is_registered: false and default field values for unregistered creators.

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace (New tests in invalid_balance_lookups.rs verify all edge cases)

Checklist

  • Linked issue or backlog item: Closes Add invalid balance lookup test coverage #32
  • Contract behavior and invariants are described clearly
  • Docs updated if contract interfaces or workflows changed (No interface changes, only test additions)
  • Scope stays limited to one contract concern

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Apr 2, 2026

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

@haanarrh
Copy link
Copy Markdown
Author

haanarrh commented Apr 5, 2026

please kindly review

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 invalid balance lookup test coverage

1 participant