Skip to content

Refine creator read views and quote helpers#87

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
Ejere:creator-view-refinements
Mar 28, 2026
Merged

Refine creator read views and quote helpers#87
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
Ejere:creator-view-refinements

Conversation

@Ejere

@Ejere Ejere commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Summary

This pull request resolves issues #75, #77, #78, and #84 by tightening the contract read paths without changing the underlying trading behavior.

The changes focus on three areas:

  • centralizing repeated creator-profile reads used by methods that require a registered creator
  • adding an explicit read-only creator supply method with clear error semantics for unregistered creators
  • improving quote-view typing and test coverage for existing read methods

What Changed

  • Added a shared read_registered_creator_profile helper to consolidate the common pattern of loading a creator profile and returning ContractError::NotRegistered when absent.
  • Reused that helper in existing registered-creator read paths and state-changing paths where the same storage lookup behavior was duplicated.
  • Added get_creator_supply, a read-only method that returns the current supply for a registered creator and fails cleanly for unknown creators.
  • Added a scoped QuoteViewResult type alias for quote-related view helpers so quote return typing is clearer and reusable without changing externally observable behavior.
  • Added focused tests for get_creator_fee_recipient, covering successful lookup, repeated read-only access, and the unregistered-creator failure path.
  • Added focused tests for get_creator_supply, covering successful reads, read-only behavior, and the unregistered-creator failure path.

Issue Mapping

Behavior Notes

This change is intended to be behavior-neutral aside from the addition of the new get_creator_supply view method.

Existing buy, sell, fee, and quote logic remain unchanged. The helper and alias additions are internal refactors intended to reduce repeated logic and make the read surface easier to maintain.

Testing

  • cargo fmt --all
  • cargo test --workspace

Closes #75
Closes #77
Closes #78
Closes #84

@drips-wave

drips-wave Bot commented Mar 28, 2026

Copy link
Copy Markdown

@Ejere 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 a7312fb into accesslayerorg:main Mar 28, 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

2 participants