fix(indexer): parse and persist ContribReconciled event (#169) - #177
Open
trenysx wants to merge 1 commit into
Open
fix(indexer): parse and persist ContribReconciled event (#169)#177trenysx wants to merge 1 commit into
trenysx wants to merge 1 commit into
Conversation
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 #169
The escrow contract emits a distinct ContribReconciled event from the privileged
eceive_contribution admin path (see emit_reconciled_contribution in contracts/production_escrow/src/events.rs). This event is intentionally separate from ContribReceived so off-chain monitoring can flag admin reconciliations vs. genuine deposits.
The indexer's EventParserService.parseEvent had no case for ContribReconciled — it fell through to default: return null and was silently dropped with no audit row, no broadcast, and no log.
Changes
server/src/indexer/types/soroban-events.types.ts: Added ContribReconciledData interface (mirrors CampaignInvestedData) and included it in ParsedEventData union.
server/src/indexer/parsers/event-parser.service.ts:
server/src/websocket/events.types.ts + client/src/lib/websocket/events.types.ts: Added 'campaign.contrib_reconciled' to CampaignEventType union so realtime broadcast carries the correct event type.
Tests
Added a ContribReconciled describe block to event-parser.service.spec.ts:
All 48 unit tests pass; sc --noEmit and eslint are clean for changed files.