test(dpp): improve coverage for token config validation, cbor utils, and identity factory#3381
Conversation
…and identity factory Add unit tests for four DPP modules that previously had 0% code coverage: - Token configuration update validation (v0): 16 tests covering identical configs, immutable field changes (base_supply), convention changes with various permission levels, max_supply, manual minting/burning rules, freeze/unfreeze rules, destroy frozen funds, emergency action rules, main control group modifications, and marketplace trade mode changes. - CBOR value map helpers (CborBTreeMapHelper): 39 tests covering all trait methods including string, integer, bool, identifier, array, and map accessors with present/absent/wrong-type scenarios. - CBOR value conversions (mod.rs): 30 tests covering get_key_from_cbor_map, CborMapExtension methods, cbor_value_to_json_value, cbor_value_into_json_value, cbor_map_to_json_map, and cbor_map_into_json_map for all CBOR types and error cases. - Identity factory: 11 tests covering factory creation, identity creation with valid/invalid versions, identity field verification (id, balance, revision, public keys), chain asset lock proof creation, and edge cases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 #3381 +/- ##
============================================
+ Coverage 75.87% 76.19% +0.32%
============================================
Files 2912 2914 +2
Lines 283860 284993 +1133
============================================
+ Hits 215375 217150 +1775
+ Misses 68485 67843 -642
🚀 New features to boost your workflow:
|
Issue being fixed or feature implemented
Improve unit test coverage for several DPP modules that previously had 0% code coverage.
What was done?
Added 85 unit tests across four DPP modules:
Token configuration update validation (
validate_token_configuration_update/v0/mod.rs): 16 tests covering identical config validation, immutable field protection (base_supply), convention changes with various permission levels, max_supply changes, manual minting/burning rule changes, freeze/unfreeze rules, destroy frozen funds rules, emergency action rules, main control group modifications, and marketplace trade mode changes.CBOR value map helpers (
cbor_value/map.rs): 39 tests covering allCborBTreeMapHelpertrait methods including string, integer, bool, identifier, array, and map accessors with present/absent/wrong-type scenarios, plusremove_optional_integerandremove_integer.CBOR value conversions (
cbor_value/mod.rs): 19 tests coveringget_key_from_cbor_map,CborMapExtensionmethods (as_u16,as_u8,as_bool,as_bytes,as_string,as_u64),cbor_value_to_json_value,cbor_value_into_json_value,cbor_map_to_json_map, andcbor_map_into_json_mapfor all CBOR types and error cases.Identity factory (
identity/identity_factory.rs): 11 tests covering factory creation, identity creation with valid/invalid protocol versions, identity field verification (id, balance, revision, public keys), chain asset lock proof creation, and edge cases.How Has This Been Tested?
All 85 new tests pass via
cargo test -p dpp. Full DPP test suite (1004 tests) passes with no regressions.Breaking Changes
None. This PR only adds
#[cfg(test)]modules at the bottom of existing files.Checklist: