feat: standardize escrow contract event schema and topics#322
Open
Chrisbankz0 wants to merge 2 commits into
Open
feat: standardize escrow contract event schema and topics#322Chrisbankz0 wants to merge 2 commits into
Chrisbankz0 wants to merge 2 commits into
Conversation
Contributor
|
@Chrisbankz0 please look in to ci fail and after wards ill review |
Author
|
i've resolved it |
Contributor
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
#318
Summary
Standardized escrow contract event emission so backend indexers can consume a strict, consistent topic schema.
What changed
events.rs
Added a dedicated escrow event schema module.
Defined a fixed primary topic: Escrow.
Standardized secondary event types:
Initialized
Funded
Released
Reclaimed
DisputeInitiated
DisputeResolved
Cleanup
Added structured payload types for each event.
lib.rs
Rewired all env.events().publish(...) calls to use the new standardized topics tuple:
(Escrow, , engagement_id)
Replaced legacy local event definitions with imports from the new events.rs module.
README.md
Documented the escrow event schema and topics for backend developers and indexers.
Why
Provides a consistent event namespace for all escrow lifecycle events.
Makes on-chain event consumption easier and more reliable for the FastAPI backend or other indexer services.
Reduces event handling ambiguity and supports a standardized contract event contract.
Testing
Recommended commands:
cd contracts
cargo test -p escrow
cargo build --release --target wasm32-unknown-unknown
Note: In the current editor environment, cargo was not available on the terminal PATH, so tests were not executed here.
Files changed
events.rs
lib.rs
README.md
#closes