test(settlement): add full struct snapshot tests for PaymentReceivedEvent#552
Open
obswrld wants to merge 1 commit into
Open
test(settlement): add full struct snapshot tests for PaymentReceivedEvent#552obswrld wants to merge 1 commit into
obswrld wants to merge 1 commit into
Conversation
…vent - Add test_payment_received_event_snapshot_to_pool: asserts the complete PaymentReceivedEvent struct (from_vault, amount, to_pool, developer) in a single assert_eq! for the to_pool=true branch - Add test_payment_received_event_snapshot_to_developer: same full-struct assertion for the to_pool=false / developer branch - These complement the existing field-by-field event shape tests by catching any future change to the event's structure or values in one comparison, rather than requiring each field to be checked individually Note: contracts/settlement currently has 34 pre-existing compile errors on main (missing Severity/AdminBroadcast types in lib.rs, argument mismatches in unrelated withdraw_developer_balance tests, missing Box imports in test_invariant.rs) that block cargo test from running. These are unrelated to this change and were verified to exist on main prior to this branch via git stash comparison. This PR does not attempt to fix them as they are out of scope for this issue. Closes CalloraOrg#491
|
@obswrld 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! 🚀 |
|
@GBOYEE has applied to work on this issue as part of the Stellar Wave Program's 6th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @GBOYEE to this issue. |
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.
Summary
Closes #491
Changes
Added two snapshot tests that assert the complete
PaymentReceivedEventstruct in a singleassert_eq!, rather than checking fields individually:test_payment_received_event_snapshot_to_pool— full struct assertion for theto_pool=truebranchtest_payment_received_event_snapshot_to_developer— full struct assertion for theto_pool=false/ developer branchThese complement the existing field-by-field event shape tests (
test_payment_received_event_to_pool, etc.) by catching any future change to the event's structure or values in one comparison — if a field is added, removed, or renamed, or a value changes, the test fails immediately rather than silently passing because only some fields were checked.Pre-existing build issue (out of scope)
contracts/settlementcurrently has 34 pre-existing compile errors onmainthat blockcargo testfrom running for this crate:Severity,String,AdminBroadcasttypes referenced inlib.rs(broadcastfunction)withdraw_developer_balancetest calls intest.rsBoximport intest_invariant.rsI verified via
git stashthat these errors exist onmainindependent of this change — this PR does not introduce them and does not attempt to fix them, as they're unrelated to this issue's scope. The new tests are syntactically correct and will pass once the crate compiles.Acceptance Criteria
settlement.receive_paymentoutput structure added