refactor(dpp): share one is_transient helper for lookup sources and encryptedFor - #4949
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: dashpay/platform/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe reference lookup module now imports the shared ChangesTransient property lookup
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to No behavior change is indicated for transient-property lookup, so no merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🕓 Queued for automated review — 9th in line, estimated start in ~1.0 h (commit 1fdb1c1)
|
…fersTo Merges ownerRefersTo/creatorRefersTo (#4941) and the shared is_transient helper (#4949). - ownerRefersTo and creatorRefersTo take a listElement as a target (alone or as a leaf of an expression): an identity id can be an element of a list of identities, the charters' "the writer is a seated member". Meta-schema, parser leaf check and docs updated; enforcement needed no change, the owner and creator references go through the same validator. - The listElement registration checks walk reference_declarations(), so an owner- or creator-held list element is checked as a property's is. - list_element_reference uses the shared is_transient; the changelog item is now 35, after ownerRefersTo's 34. - Composing tests: dpp (ownerRefersTo listElement, alone and in an anyOf, with a bad $id pair refused) and ABCI (a seatedNote a member may write and a stranger may not, refused at $ownerId). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue being fixed or feature implemented
#4943 added a private
is_transient(document_type, path)toproperty/reference_lookup.rsfor refersTo lookup key sources. #4948 then moved an identicalpub(crate)copy intoproperty/mod.rsfor theencryptedForchecks. #4948 merged a minute after #4943 and was not rebased over it, sov4.2-devnow has two identical helpers.What was done?
is_transientfromreference_lookup.rs.reference_lookup.rsnow imports the sharedproperty::is_transient, which already has its own unit test (should_find_a_path_transient_through_itself_or_an_enclosing_object_only).No behaviour change. The two bodies were identical, so every contract parses exactly as before, and there is no before/after to show. #4940 (open) carries a third private copy in
list_element_reference.rs, which should becomeuse super::is_transient;when it is rebased.In-place changes to shipped generations
None. The only code touched is the referring-side lookup check, which only parser generation 3 reaches. Generation 3 is used only by protocol version 14, which is unreleased, and the edit keeps its output identical.
How Has This Been Tested?
cargo test -p dpp --all-features --lib -- reference_lookup transient encrypted_for: 51 passed.cargo clippy -p dpp --all-features --all-targets -- -D warnings: clean.cargo fmt --all: clean.Breaking Changes
None.
Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
1fdb1c1/skip-botsproceeds without the ones not yet reported/self-reviewedonce the bots are doneWhen every box is checked the
PR Hygienecheck passes and this can merge.Summary by CodeRabbit