test: add serialisation stability tests for freeze_appeal_channel field#2253
Merged
Baskarayelu merged 1 commit intoJul 27, 2026
Merged
Conversation
Closes QuickLendX#1960 Lock down the InvoiceFrozen event schema and the freeze_appeal_channel value so that accidental renames, deletions, or silent type changes are caught by the test suite. New tests in test_freeze_appeal_channel.rs: - Event data-map schema lock (exactly 5 field names, all present/non-null) - Administrative variant channel + label coverage - FreezeInfo XDR serialisation round-trip for all 9 reason variants - Channel consistency across freeze/unfreeze/refreeze cycles - Negative: freeze_investor must not emit InvoiceFrozen - Proptest: channel invariant, label snake_case, FreezeInfo roundtrip
|
@owohdora-stack 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! 🚀 |
5 tasks
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 #1960
📝 Description
Add serialisation-stability tests for the
freeze_appeal_channelfield in theInvoiceFrozenevent to lock down the contract's event schema and prevent silent regressions.🎯 Type of Change
🔧 Changes Made
Files Modified
quicklendx-contracts/src/lib.rs— registered new test moduleNew Files Added
quicklendx-contracts/src/test_freeze_appeal_channel.rs— 15 tests (12 unit + 3 proptest)Key Changes
BusinessFreezeReason::Administrative(alias forAdminAction) now tested for correct channel and labelBusinessFreezeReasonvariant survives serialisation/deserialisationfreeze_appeal_channel = "docs/APPEALS.md"freeze_investormust not emitInvoiceFrozen(business-only event)🧪 Testing
Test Coverage
event_data_map_contains_exactly_expected_fieldsevent_fields_are_all_non_nullevent_identity_fields_match_inputschannel_present_for_administrative_variantadministrative_and_admin_action_share_labelchannel_consistent_across_freeze_unfreeze_refreezechannel_correct_on_double_freezefreeze_info_xdr_roundtrip_preserves_reasonfreeze_info_roundtrip_all_reasonsfreeze_info_different_reasons_serialize_differentlyinvestor_freeze_does_not_emit_invoice_frozenadministrative_variant_emits_correct_label_and_channelprop_channel_always_appeals_docprop_label_is_snake_caseprop_freeze_info_roundtrip📋 Contract-Specific Checks
🔗 Related Issues
Closes #1960
📋 Additional Notes
The codebase currently has pre-existing compilation errors from recent merge conflicts (duplicate types, signature changes). This PR introduces zero new errors — the new test file compiles cleanly. The maintainer will resolve the merge conflicts separately.
🧪 How to Test
cargo test -p quicklendx-contracts test_freeze_appeal_channel(once merge conflicts are resolved)freeze_appeal_channelinevents.rsand confirmevent_data_map_contains_exactly_expected_fieldsfails