test(compliance): add schema-version regression snapshot test - #525
Merged
misrasamuelisiguzor-oss merged 1 commit intoAug 31, 2026
Merged
misrasamuelisiguzor-oss merged 1 commit into
misrasamuelisiguzor-oss merged 1 commit into
Conversation
Adds a snapshot-based regression test for compliance's get_schema_version entrypoint. The test hard-codes EXPECTED_SCHEMA_VERSION = 1 and fails if the value changes without a deliberate update, forcing any schema bump to be acknowledged and documented in the PR per WHEELBACK#113. Also confirms via grep that invoice, treasury, and settlement-workflow have no get_schema_version entrypoint or SchemaVersion storage key — the test is correctly scoped to compliance only. Closes WHEELBACK#469
|
@Ejirowebfi 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.
Description:
Summary
Adds a snapshot-based regression test for
compliance'sget_schema_versionentrypoint, as requested in #469.The test hard-codes
EXPECTED_SCHEMA_VERSION = 1and fails immediately if the value changes without a deliberate update to the constant — forcing anyschema bump to be acknowledged, the constant updated, and the storage migration path documented in the PR per #113.
What was checked first
Grepped for
get_schema_versionandSchemaVersionacross all four contracts before writing anything. Result:compliance— hasget_schema_versionandDataKey::SchemaVersion✓invoice— neither existstreasury— neither existssettlement-workflow— neither existsThe test is correctly scoped to
complianceonly.Tests added
contracts/compliance/tests/schema_version_test.rsschema_version_matches_snapshotget_schema_version()returns exactlyEXPECTED_SCHEMA_VERSION = 1schema_version_available_immediately_after_initinitialize, no other calls neededschema_version_is_stable_across_repeated_readsUpdating this test in future
If you are intentionally bumping the schema version:
EXPECTED_SCHEMA_VERSIONin this test file to the new value.CHANGELOG.mddescribing the storage migration path.Closes #469