feat(contract): Implement Quest Metadata and Description System (#104)#142
Merged
RUKAYAT-CODER merged 2 commits intoEarnQuestOne:mainfrom Feb 25, 2026
Merged
Conversation
Contributor
|
please resolve conflict |
Contributor
Author
DONE ✅. kindly review and merge |
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.
Overview
This PR implements quest metadata support for the Soroban contract, including creation-time metadata, metadata updates, and metadata query functions.
It supports both inline descriptions and hash-based references for larger content.
Related Issue
Closes #104
Changes
🧱 Contract Types
contracts/earn-quest/src/types.rsMetadataDescriptionenum:Inline(String)Hash(BytesN<32>)QuestMetadatastruct with:titledescriptionrequirementscategorytags🗄️ Storage Layer
contracts/earn-quest/src/storage.rsDataKey::QuestMetadata(Symbol)has_quest_metadataget_quest_metadataset_quest_metadatadelete_questto remove associated metadata.⚙️ Quest Logic
contracts/earn-quest/src/quest.rsregister_quest_with_metadata(...)update_quest_metadata(...)(authorized for quest creator or admin)🌐 Contract Interface
contracts/earn-quest/src/lib.rsregister_quest_with_metadataupdate_quest_metadataget_quest_metadatahas_quest_metadata❗ Errors
contracts/earn-quest/src/errors.rsMetadataNotFound🧪 Tests
contracts/earn-quest/tests/test_metadata.rscontracts/earn-quest/tests/test_batch.rs🛠️ Cleanup Fix
contracts/earn-quest/src/submission.rsuse crate::storage;import causing compile failure.Verification Results
Inline+Hash)How to Test