chore(contracts): emit event on donation received#266
Merged
Kaylahray merged 5 commits intogeevapp:mainfrom Mar 30, 2026
Merged
chore(contracts): emit event on donation received#266Kaylahray merged 5 commits intogeevapp:mainfrom
Kaylahray merged 5 commits intogeevapp:mainfrom
Conversation
Topics: aid, donate, request_id. Data vec: donor, amount_donated, new_total_raised. Update test and ledger snapshot. Made-with: Cursor
|
@augusthottie Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
vec! inferred Symbol for all elements, breaking request_id.into_val under newer SDK (E0277). Convert aid/donate symbols with .into_val(&env). Made-with: Cursor
3m1n3nc3
requested changes
Mar 28, 2026
Contributor
3m1n3nc3
left a comment
There was a problem hiding this comment.
Please resolve conflicts and fix failing CI
Contributor
Author
fixed |
Kaylahray
approved these changes
Mar 30, 2026
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
Standardizes the
DonationReceivedcontract event so clients can subscribe to a stable topic layout and read this donation amount plus updated total raised for real-time UI (e.g. progress bar) without polling.Closes #214
What changed
File:
contracts/geev-core/src/mutual_aid.rsDonationReceivednow uses:aid,donate,request_id(#[contractevent(topics = ["aid", "donate"])]+#[topic] request_id).data_format = "vec"):[donor, amount_donated, new_total_raised].amount_donated: amount for thisdonatecall.new_total_raised:HelpRequest.raised_amountafter applying this donation (matches on-chain state).donate(), after transfers and storage updates.Tests & snapshots
test_donation_emits_contributor_tracking_eventupdated to assert the new topic triple.test_donation_emits_contributor_tracking_event.1.jsonsnapshot updated for the new event encoding.Breaking change
Subscribers that matched the legacy event (single
donation_receivedtopic + map-shaped data) must update toaid/donate/<request_id>and parse the vec body.Branch:
chore/event-donation