Skip to content

Comments

feat: emit escrow_created event on store_escrow (#39)#41

Open
Chucks1093 wants to merge 1 commit intoMarketXpress:mainfrom
Chucks1093:feat/emit-escrow-created-event-39
Open

feat: emit escrow_created event on store_escrow (#39)#41
Chucks1093 wants to merge 1 commit intoMarketXpress:mainfrom
Chucks1093:feat/emit-escrow-created-event-39

Conversation

@Chucks1093
Copy link

Closes #39

Changes

  • lib.rs: store_escrow now calls env.events().publish() after writing
    to persistent storage. Topics are (symbol_short!("escrow_cr"), escrow_id)
    and data is the full Escrow struct. #[allow(deprecated)] applied at the
    call site — the method still works correctly in soroban-sdk v25.1.1.
  • test.rs: Added test_store_escrow_emits_created_event which calls
    store_escrow and asserts all five escrow fields are correctly persisted
    alongside the event emission. Full event structure (topics + data) is locked
    in via the generated snapshot file.
  • test_snapshots/: Regenerated all snapshots via SOROBAN_TEST_SNAPSHOT_UPDATE=1
    to capture the new event output across all 15 existing tests.

Test results

15 passed; 0 failed

- Publish (escrow_cr, escrow_id) → Escrow event via env.events().publish()
- Suppressed deprecation warning at the call site with #[allow(deprecated)]
- Added test_store_escrow_emits_created_event verifying storage and event path
- Regenerated all test snapshots to capture new event in existing test runs
@Chucks1093
Copy link
Author

@Cybermaxi7 can you review and merge the pr

@Cybermaxi7
Copy link
Contributor

Please resolve conflicts

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.

Emit Escrow Created Event

2 participants