fix(contract): add auth fixture helpers and tombstone read tests (#641 #624) - #769
Merged
manoahLinks merged 1 commit intoAug 31, 2026
Conversation
…one read tests (mind-vault-1#624) - Add auth_fixtures.rs: reusable MockAuth/MockAuthInvoke builders for every creator-gated, verifier-gated, and admin-gated contract method, with acceptance tests confirming correct signer succeeds and wrong signer panics. - Add tombstone_read.rs: documentation tests for all tombstone read semantics: get/exists/get_owner remain readable, count stays monotonic, list/list_page include tombstoned entries, tag/creator/listed indexes exclude them, and all creator mutations return ResourceNotMutable. Supporting compilation fixes: - Remove duplicate TTL_DAY_IN_LEDGERS const in lib.rs - Remove unimplemented list_payments from METHOD_SCHEMA - Fix DataKey::PaymentReceipt pattern match (1-arg not 2-arg) - Update storage_key_migration_covers_every_variant count (18→23) and add missing variants (PaymentIndex, Paused, Settler, ListedCount, AttestationHash) - Fix receipt_keys test to use PaymentIndex instead of 2-arg PaymentReceipt - Fix listed_count tests to use String::from_str instead of bare &str literals - Add &None as 4th arg to set_verification_status calls in lifecycle_roles.rs, moderation_pause.rs, properties_events.rs, schema_registry.rs - Fix set_verification_status event decoder to read 3-tuple (adds attestation_hash) - Replace env_without_snapshots() with Env::default() in hardening_preflight.rs, properties_events.rs, metadata_updates.rs - Update vault-registry README: schema version 5→6, add v6 history row, add get_attestation_hash and listed_count to Methods table, add Contract version compatibility section to contract/README.md All 401 tests pass. Closes mind-vault-1#624 Closes mind-vault-1#641
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 #641 — Add Soroban auth fixture helpers
Closes #624 — Add tombstone read behavior documentation tests
Changes
auth_fixtures.rs (issue #641)
Added
contract/contracts/vault-registry/src/test/auth_fixtures.rs— a module of reusableMockAuth/MockAuthInvokefixture helpers for contract tests.set_price,update_metadata,set_tags,set_listed,delist,transfer_ownership,freeze_metadataset_verification_statustombstone_resourcesetup_with_verifierconvenience helper (env + creator + admin + verifier + client)tombstone_read.rs (issue #624)
Added
contract/contracts/vault-registry/src/test/tombstone_read.rs— documentation tests for the exact read behaviour after tombstoning.Covers 10 sections:
get(id)— tombstoned resource still readable with preserved fieldsexists(id)/exists_many— still returntrueget_owner— last owner still readablecount()— monotonic, does not decrementlist/list_page— tombstoned entries remain in canonical cataloglist_by_tag— tombstoned resource removed from tag indexlist_by_creator/creator_resource_count— excluded and decrementedlist_listed/listed_count— excluded and decrementedResourceNotMutableget_many— batch read includes tombstoned entriesTest Results
mainand unrelated to these changesNotes
Rebased cleanly on current
main(b49c495a).