Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions campaign/src/get_milestone.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use soroban_sdk::{contract, contractimpl, Env};
use crate::types::{Error, MilestoneData};
use crate::storage::get_milestone;

/// Issue #199 – `get_milestone` view function
///
/// Returns the full `MilestoneData` for the milestone at `index`.
/// Panics with `Error::MilestoneNotFound` if the index is out of range.
/// No authentication required.
pub fn get_milestone_view(env: &Env, index: u32) -> MilestoneData {
get_milestone(env, index).unwrap_or_else(|| {
soroban_sdk::panic_with_error!(env, Error::MilestoneNotFound)
})
}
Loading