Skip to content

fix/feat: doc comments, AdminChanged event, exact-goal tests, verifier reassignment - #34

Merged
sweetsoul21 merged 8 commits into
aidline-org:mainfrom
RaymondAbiola:feat/issues-1-2-3-4
Oct 8, 2026
Merged

sweetsoul21 merged 8 commits into
aidline-org:mainfrom
RaymondAbiola:feat/issues-1-2-3-4

Conversation

@RaymondAbiola

Copy link
Copy Markdown
Contributor

Summary

Closes #1, #2, #3, #4

Issue #1 — Doc comments on all public functions

  • Added /// doc comments to every pub fn in the #[contractimpl] block
  • Each comment describes what the function does, who may call it, and which Error values it can return

Issue #2 — AdminChanged event on set_admin

  • Added AdminChanged { old, new } struct to events.rs
  • set_admin now emits the event so indexers can track admin transfers
  • Tests added: set_admin_emits_admin_changed_event, set_admin_updates_stored_admin

Issue #3 — Exact-goal boundary donation tests

  • Added three_donors_reach_goal_exactly_fourth_fails: three donors hit goal exactly, fourth attempt returns GoalExceeded
  • Added two_donors_reach_goal_exactly_campaign_fully_funded: verifies milestone can release when goal is exactly met

Issue #4 — Verifier reassignment

  • Added reassign_verifier(campaign_id, new_verifier) callable by admin only
  • New verifier must be registered; campaign must be active
  • Emits VerifierReassigned { campaign_id, old_verifier, new_verifier }
  • Tests: happy path, unregistered verifier, cancelled campaign, expired campaign, new verifier can approve after reassignment
  • ARCHITECTURE.md events table and design notes updated

Also fixed (pre-existing breakage)

  • Duplicate error discriminants in errors.rs (prevented compilation)
  • Unclosed delimiter in pull_pledges, duplicate imports and double transfer in approve_milestone
  • Broken test_measure_resource_costs (deprecated env.budget() → env.cost_estimate().budget())
  • Broken test_exact_events_emitted (invalid SDK APIs) → replaced with test_events_emitted

Tested

make test — 31 tests pass
make lint — no warnings or errors

@sweetsoul21
sweetsoul21 self-requested a review October 8, 2026 20:18

@sweetsoul21 sweetsoul21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Goood job @RaymondAbiola

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add doc comments to every public contract function

2 participants