test(dpp): improve coverage for document serialization, extended documents, and methods#3454
Conversation
Add comprehensive unit tests covering real logic in document serialization, conversion, validation, and comparison across 7 files that previously had zero or minimal test coverage. - extended_document/v0: construction, property access, JSON/value conversion, serialization round-trip, validation, document_type lookup, set/get paths - v0/cbor_conversion: CBOR round-trip, from_map field extraction, DocumentForCbor conversion, version prefix, error handling for invalid CBOR - v0/json_conversion: to_json/from_json_value round-trip, all timestamp fields, creator_id parsing, to_json_with_identifiers_using_bytes - platform_value_conversion: Document <-> Value round-trip, to_map_value, to_object, into_map_value, from_platform_value with minimal data - get_raw_for_document_type: system field extraction ($id, $ownerId, $creatorId), timestamp encoding, block height encoding, owner_id override, user properties - is_equal_ignoring_timestamps: equal ignoring time fields, different properties, different ids/owners/revisions, also_ignore_fields filtering - document/mod.rs: Display impl edge cases, increment_revision, version dispatch for is_equal_ignoring_time_based_fields, get_raw_for_contract, hash Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Review GateCommit:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThese changes add comprehensive test modules across seven document-related files to validate serialization/deserialization, property access, timestamp handling, and field extraction behavior. All changes are confined to new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v3.1-dev #3454 +/- ##
============================================
+ Coverage 83.13% 83.51% +0.37%
============================================
Files 2621 2621
Lines 270434 273537 +3103
============================================
+ Hits 224833 228452 +3619
+ Misses 45601 45085 -516
🚀 New features to boost your workflow:
|
Summary
Adds 76 tests across 7 files in rs-dpp/src/document covering real logic.
extended_document/v0/mod.rsv0/cbor_conversion.rsv0/json_conversion.rsserialization_traits/platform_value_conversiondocument_methods/get_raw_for_document_typedocument_methods/is_equal_ignoring_timestampsmod.rsTest plan
cargo test -p dpp --lib -- document::passescargo fmt --allclean🤖 Generated with Claude Code
Summary by CodeRabbit