Skip to content

Comments

test: Remittance Events#112

Merged
Baskarayelu merged 3 commits intoRemitwise-Org:mainfrom
anonfedora:test/remittance_events
Feb 21, 2026
Merged

test: Remittance Events#112
Baskarayelu merged 3 commits intoRemitwise-Org:mainfrom
anonfedora:test/remittance_events

Conversation

@anonfedora
Copy link
Contributor

feat: Add event emission and enhanced type derivations for RemittanceSplit contract

Summary

Closes #66

This PR adds structured event emission throughout the RemittanceSplit contract, improves type derivations for contract types, and expands test coverage for event-driven behavior.

Changes

Contract (lib.rs)

  • Added Debug, Eq, and PartialEq derives to SplitInitializedEvent, SplitCalculatedEvent, SplitConfig, and SplitEvent for better testability and debugging.
  • Added initialized: bool field to SplitConfig and SplitCalculatedEvent to track initialization state explicitly.
  • Added timestamp field population in initialize_split and calculate_split to ensure all emitted events carry ledger time context.
  • Migrated inline test module out of lib.rs into test.rs to keep the contract file clean.

Tests (test.rs)

  • Added Events, IntoVal, Symbol, TryFromVal, and Val to test imports.
  • Added three new event-specific tests:
    • test_initialize_split_events — verifies topic structure and data payload on split initialization.
    • test_update_split_events — verifies the SplitEvent::Updated topic and caller data on split update.
    • test_calculate_split_events — verifies the SplitEvent::Calculated topic and total_amount data payload on split calculation.

Testing

All existing tests continue to pass. New tests verify event topics and data payloads using try_from_val deserialization to ensure type-safe event assertions.

@Baskarayelu
Copy link
Contributor

fix the pipeline @anonfedora

@anonfedora
Copy link
Contributor Author

Fixed @Baskarayelu

@Baskarayelu
Copy link
Contributor

LGTM

@Baskarayelu Baskarayelu merged commit 4a4c459 into Remitwise-Org:main Feb 21, 2026
2 checks passed
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.

Add Tests for Remittance Split Event Emissions

2 participants