test: add contract event emission tests for all state-changing functions#391
Open
devUnixx wants to merge 1 commit into
Open
test: add contract event emission tests for all state-changing functions#391devUnixx wants to merge 1 commit into
devUnixx wants to merge 1 commit into
Conversation
…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
|
@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! 🚀 |
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 #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)datatest_transfer_emits_event— verifies("transfer",)topic with(from, to, amount)datatest_burn_emits_event— verifies("burn",)topic with(from, amount)datatest_retire_emits_event— verifies("retire",)topic is emittedaudit_registry
test_anchor_emits_event— verifies("anchor",)topic with(reading_hash, ledger_sequence, timestamp)datacommunity_governance
test_propose_emits_event— verifies("propose",)topic with proposal IDtest_vote_emits_event— verifies("vote",)topic with(proposal_id, voter, approve)datatest_finalize_emits_event— verifies("final",)topic with(proposal_id, status)datatest_execute_emits_event— verifies("exec",)topic with proposal IDAcceptance criteria