Skip to content

test(compliance): add schema-version regression snapshot test - #525

Merged
misrasamuelisiguzor-oss merged 1 commit into
WHEELBACK:mainfrom
Ejirowebfi:test/schema-version-regression-test
Aug 31, 2026
Merged

misrasamuelisiguzor-oss merged 1 commit into
WHEELBACK:mainfrom
Ejirowebfi:test/schema-version-regression-test

Conversation

@Ejirowebfi

Copy link
Copy Markdown
Contributor

Description:

Summary

Adds a snapshot-based regression test for compliance's get_schema_version entrypoint, as requested in #469.

The test hard-codes EXPECTED_SCHEMA_VERSION = 1 and fails immediately if the value changes without a deliberate update to the constant — forcing any
schema 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_version and SchemaVersion across all four contracts before writing anything. Result:

  • compliance — has get_schema_version and DataKey::SchemaVersion
  • invoice — neither exists
  • treasury — neither exists
  • settlement-workflow — neither exists

The test is correctly scoped to compliance only.

Tests added

contracts/compliance/tests/schema_version_test.rs

Test What it asserts
schema_version_matches_snapshot Core regression — get_schema_version() returns exactly EXPECTED_SCHEMA_VERSION = 1
schema_version_available_immediately_after_init Entrypoint is readable right after initialize, no other calls needed
schema_version_is_stable_across_repeated_reads Value is deterministic across successive reads

Updating this test in future

If you are intentionally bumping the schema version:

  1. Update EXPECTED_SCHEMA_VERSION in this test file to the new value.
  2. Add an entry to CHANGELOG.md describing the storage migration path.
  3. Include both changes in the same PR.

Closes #469

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
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@misrasamuelisiguzor-oss
misrasamuelisiguzor-oss merged commit e41b1f4 into WHEELBACK:main Aug 31, 2026
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 a snapshot-based regression test suite for every contract's get_schema_version output

2 participants