Skip to content

refactor(watcher-registry): consolidate storage keys to DataKey enum#170

Merged
habiba-d-coder merged 2 commits into
Tx-wat:mainfrom
deborahamoni0-prog:refactor/consolidate-watcher-registry-storage-keys
May 31, 2026
Merged

refactor(watcher-registry): consolidate storage keys to DataKey enum#170
habiba-d-coder merged 2 commits into
Tx-wat:mainfrom
deborahamoni0-prog:refactor/consolidate-watcher-registry-storage-keys

Conversation

@deborahamoni0-prog
Copy link
Copy Markdown
Contributor

Summary

Closes #91

Replaces all symbol_short! storage calls with the existing DataKey enum variants (DataKey::Admins / DataKey::Watchers), which was defined but never used.

Changes

  • All instance storage reads/writes now use DataKey instead of raw symbol_short! strings
  • Fixed a silent bug: transfer_admin was writing to "ADMINS" while load_admins read from "ADMIN" — admin was lost after transfer
  • initialize now stores Vec<Address> under DataKey::Admins, consistent with how load_admins reads it
  • symbol_short! retained only for event topic publishing in register_watcher (not a storage key)

- Replace all symbol_short! storage calls with DataKey::Admins / DataKey::Watchers
- Fix transfer_admin/load_admins key mismatch (was writing ADMINS, reading ADMIN)
- Align initialize to store Vec<Address> under DataKey::Admins

Closes Tx-wat#91
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@deborahamoni0-prog 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

@habiba-d-coder habiba-d-coder merged commit e3ccb37 into Tx-wat:main May 31, 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.

Refactor: Consolidate storage key approach in WatcherRegistry

2 participants