refactor: standardize event emission payloads for indexer reliability - #87
Merged
Conversation
dumbdev
force-pushed
the
refactor/event-schema
branch
from
July 24, 2026 06:50
abf9555 to
955df94
Compare
dumbdev
force-pushed
the
refactor/event-schema
branch
from
July 24, 2026 07:33
955df94 to
d871c3e
Compare
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.
closes #70
This pull request addresses this issue by auditing and standardizing the contract's event emission schemas in src/events.rs. Off-chain indexers and data feeds require consistent topic structures and predictable payload shapes. Previously, the contract published loose tuple fragments or varying types as the payload value for events (e.g. only the transfer amount).
To ensure indexer reliability, every event (EscrowCreated, FundsLocked, FundsReleased, and EscrowRefunded) has been refactored to conform to a highly uniform structure. The primary identifier, EscrowId, is now consistently placed as the first data topic immediately following the event name symbol. Additionally, the event payloads have been standardized to pass the fully detailed EscrowState struct as a structured payload instead of raw values, guaranteeing a deterministic schema that is easy for indexers to parse.
To maintain correctness, we also updated the test assertions throughout tests/test.rs to construct and verify these new event signatures. The refactoring was performed and committed step-by-step to isolate changes to each event emitter and test update.
Key Changes
src/events.rs: Modified all event publishing functions to consistently use (Symbol, EscrowId) as the topics tuple and the EscrowState struct as the value.
tests/test.rs: Updated all event assertion expectations to verify matching (Symbol, EscrowId) topics and structured EscrowState payloads