feat: implement asset description storage and getter [#83]#98
Open
MarcusDavidG wants to merge 1 commit intoStellarFlow-Network:mainfrom
Open
feat: implement asset description storage and getter [#83]#98MarcusDavidG wants to merge 1 commit intoStellarFlow-Network:mainfrom
MarcusDavidG wants to merge 1 commit intoStellarFlow-Network:mainfrom
Conversation
…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
|
@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! 🚀 |
Contributor
|
Resolve all conflicts please. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #83
Changes
AssetDescription(Symbol)variant toDataKeyenum intypes.rsset_asset_description(admin, asset, description)— admin-only function to store a human-readable label for each asset (e.g."Nigerian Naira")get_asset_description(asset) -> Result<String, Error>— public getter; returnsError::AssetNotFoundif no description has been setTests
4 new tests added to
test.rs:test_set_and_get_asset_description— success pathtest_get_asset_description_not_found_returns_error— missing asset returnsAssetNotFoundtest_set_asset_description_non_admin_rejected— non-admin call is rejectedtest_set_asset_description_can_be_updated— description can be overwritten