This pull request implements comprehensive enhancements to ProofOfHeart-stellar, bringing stability, event persistence, strict documentation, and precise boundary constraints to the platform.
- Graceful Failure on Missing Campaigns:
get_campaignnow returnsResult<Campaign, Error>applyingok_or(Error::CampaignNotFound). This eradicates panic scenarios when attempting to access a nonexistent or removed campaign dynamically. Associated unit tests have been updated with robusttry_get_campaigntests. - Initialization Events: The
initfunction now persistently triggers an"initialized"event right after environmental configurations are registered. This includes details of the globally boundedplatform_fee, executingadmin, and the authorized basetokenreferences. - Comprehensive RustDocs: Applied extensive contextual
///documentation blocks across all struct typings, categorical enums, parameter variants, and the 23 public contract commands spanningProofOfHeart. These updates encapsulate precise behaviors concerning# Arguments,# Returns,# Errors, and specific# Authorizationrestrictions, fully enabling auto-generated API outputs. - Deadline Boundary Constraints: Injected
test_deadline_boundaryinsidesrc/test.rsto securely map Soroban ledger timestamps. This strictly asserts boundaries succeed cleanly exactly at the initialized campaigndeadline, but yield the appropriateError::DeadlinePassedexactly atdeadline + 1.
Closes #17, Closes #29, Closes #26, Closes #8