Skip to content

feat: implement asset description storage and getter [#83]#98

Open
MarcusDavidG wants to merge 1 commit intoStellarFlow-Network:mainfrom
MarcusDavidG:feat/issue-83-asset-description
Open

feat: implement asset description storage and getter [#83]#98
MarcusDavidG wants to merge 1 commit intoStellarFlow-Network:mainfrom
MarcusDavidG:feat/issue-83-asset-description

Conversation

@MarcusDavidG
Copy link
Copy Markdown

Summary

Closes #83

Changes

  • Added AssetDescription(Symbol) variant to DataKey enum in types.rs
  • Added set_asset_description(admin, asset, description) — admin-only function to store a human-readable label for each asset (e.g. "Nigerian Naira")
  • Added get_asset_description(asset) -> Result<String, Error> — public getter; returns Error::AssetNotFound if no description has been set

Tests

4 new tests added to test.rs:

  • test_set_and_get_asset_description — success path
  • test_get_asset_description_not_found_returns_error — missing asset returns AssetNotFound
  • test_set_asset_description_non_admin_rejected — non-admin call is rejected
  • test_set_asset_description_can_be_updated — description can be overwritten

…low-Network#83)

- Add AssetDescription(Symbol) variant to DataKey enum in types.rs
- Add set_asset_description (admin-only) to store a human-readable
  description for each asset Symbol (e.g. 'Nigerian Naira')
- Add get_asset_description getter returning the description or
  Error::AssetNotFound if none has been set
- Add 4 tests covering success path, not-found error, non-admin
  rejection, and description update
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

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

@Sadeequ
Copy link
Copy Markdown
Contributor

Sadeequ commented Mar 29, 2026

Resolve all conflicts please.

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.

[CONTRACT] Implement Asset "Description" Storage

2 participants