Skip to content

Add unit tests for get_balance returning zero for a wallet that has never transacted - #733

Merged
Chucks1093 merged 3 commits into
accesslayerorg:mainfrom
Godfrey-Delight:feat/get-balance-zero-safe-view
Aug 25, 2026
Merged

Add unit tests for get_balance returning zero for a wallet that has never transacted#733
Chucks1093 merged 3 commits into
accesslayerorg:mainfrom
Godfrey-Delight:feat/get-balance-zero-safe-view

Conversation

@Godfrey-Delight

Copy link
Copy Markdown
Contributor

Summary

  • Added get_balance read-only view method to CreatorKeysContract as an alias to get_key_balance.
  • Ensured balance lookups return 0 without panicking or returning an error for wallets with no transaction history and wallets that sold all keys.
  • Added unit and integration tests covering zero-balance queries and non-panicking execution for direct and try_* client invocations.

Closes #719

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace

Checklist

  • Linked issue or backlog item
  • Added or updated creator-keys unit/integration tests for every changed contract behavior, including failure paths for new or reachable ContractError variants
  • Ran cargo fmt --all -- --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace, or explained exactly why a command was not run
  • Reviewed persistent storage changes against docs/storage-key-invariants.md; any storage layout change includes a migration/backward-compatibility note
  • Confirmed event names, topic order, payload field order, and field meanings remain compatible with docs/contract-event-conventions.md, or documented the breaking change and versioning plan
  • Updated docs for any changed public contract interface, read-only method, event schema, storage behavior, fee logic, or deployment workflow
  • Scope stays limited to one contract concern and does not include unrelated formatting, lockfile, generated artifact, or dependency changes

@drips-wave

drips-wave Bot commented Aug 24, 2026

Copy link
Copy Markdown

@Godfrey-Delight 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 ad9781a into accesslayerorg:main Aug 25, 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 unit tests for get_balance returning zero for a wallet that has never transacted

2 participants