feat(progress): implement milestone submission and approval contract …#242
Merged
Petah1 merged 1 commit intoJun 22, 2026
Merged
Conversation
…cout-off#218) Adds full progress.rs Soroban contract: validator registry (register/revoke), submit_milestone, approve_milestone with tier transitions (identity→1, performance→2), get_milestones read-only view, and AlreadyVerified(6) error variant in shared. Cross-calls register.update_progress_level on approval. 8 tests covering all required cases pass.
7 tasks
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 #218
Implements the
progressSoroban smart contract for milestone submission and approval by trusted validators, with automatic player progress tier transitions on approval.Changes
shared/src/errors.rsAlreadyVerified = 6(fills the gap betweenInvalidInput = 5andInsufficientFee = 7)progress/Cargo.tomlregisteras a dev-dependency (required for cross-contract test setup, mirrors the pattern inconnection)progress/src/lib.rsFull implementation replacing the prior stub:
initialize(admin, register_contract)register_validator(validator_address)revoke_validator(validator_address)submit_milestone(validator, player_id, milestone_type, evidence_uri)MilestoneData, appends to player history, emitsmilestone_submittedapprove_milestone(validator, milestone_id)register.update_progress_level, emitsmilestone_approvedget_milestones(player_id)Vec<MilestoneData>from ledger storageProgress Tier Transitions
"identity""performance"connection.rs)Error Codes
NotFoundInvalidInputAlreadyVerifiedUnauthorizedregister_validator/revoke_validatorCross-Contract Call
approve_milestonecallsregister.update_progress_level(player_id, level)viaenv.invoke_contract— same pattern used inconnection.rs— to avoid pulling the register rlib into the progress WASM and causing duplicate symbol errors.Tests
All 8 tests pass under
cargo test -p progress --target x86_64-unknown-linux-gnu.submit_milestoneAlreadyVerified"identity"milestone sets player progress to level 1"performance"milestone sets player progress to level 2get_milestonesreturns full tamper-proof historyinitializefails