Skip to content

test: add contract event emission tests for all state-changing functions#391

Open
devUnixx wants to merge 1 commit into
AnnabelJoe:mainfrom
devUnixx:feat/contract-event-tests-330
Open

test: add contract event emission tests for all state-changing functions#391
devUnixx wants to merge 1 commit into
AnnabelJoe:mainfrom
devUnixx:feat/contract-event-tests-330

Conversation

@devUnixx
Copy link
Copy Markdown

Closes #330

Changes

Added event emission tests to all three Soroban contracts, verifying that correct events are emitted with the right topics and data fields for every state-changing function.

energy_token

  • test_mint_emits_event — verifies ("mint",) topic with (to, amount) data
  • test_transfer_emits_event — verifies ("transfer",) topic with (from, to, amount) data
  • test_burn_emits_event — verifies ("burn",) topic with (from, amount) data
  • test_retire_emits_event — verifies ("retire",) topic is emitted

audit_registry

  • test_anchor_emits_event — verifies ("anchor",) topic with (reading_hash, ledger_sequence, timestamp) data

community_governance

  • test_propose_emits_event — verifies ("propose",) topic with proposal ID
  • test_vote_emits_event — verifies ("vote",) topic with (proposal_id, voter, approve) data
  • test_finalize_emits_event — verifies ("final",) topic with (proposal_id, status) data
  • test_execute_emits_event — verifies ("exec",) topic with proposal ID

Acceptance criteria

  • energy_token: mint, transfer, retire events tested
  • audit_registry: anchor event tested
  • community_governance: proposal_created, voted, executed events tested
  • Event fields (topics, data) verified in tests

…ons (AnnabelJoe#330)

- energy_token: mint, transfer, burn, retire event tests
- audit_registry: anchor event test (topics + data fields verified)
- community_governance: propose, vote, finalize, execute event tests
- Each test verifies event topic and data payload fields
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@devUnixx Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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 contract event emission tests for all state-changing functions

1 participant