test(drive-abci): improve processor validation test coverage#3282
Conversation
…aits Add 46 unit tests covering all state transition routing logic in the processor validation traits module. Tests verify correct classification of every StateTransition variant across 11 trait files: - is_allowed: has_is_allowed_validation for all 20 transition types - identity_based_signature: uses_identity_in_state and validates_signature_based_on_identity_info for all variants - identity_balance: has_identity_minimum_balance_pre_check_validation and error when identity has no balance - identity_nonces: has_identity_nonce_validation for both version 0 and version 1, plus unknown version error path - basic_structure: has_basic_structure_validation including version-gated data contract behavior - advanced_structure_without_state: has_advanced_structure_validation - advanced_structure_with_state: has_advanced_structure_validation and requires_advanced_structure_validation_with_state_on_check_tx - state: has_state_validation for all variants - prefunded_specialized_balance: uses_prefunded_specialized_balance - address_balances_and_nonces: has_addresses_balances_and_nonces - address_witnesses: has_address_witness_validation plus unknown version error paths for both has_ and validate_ methods - addresses_minimum_balance: has_addresses_minimum_balance_pre_check - shielded_proof: has_shielded_proof_validation, has_shielded_minimum_fee_validation, and unknown version error paths for validate methods 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 (13)
✨ 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 #3282 +/- ##
============================================
+ Coverage 70.53% 70.61% +0.07%
============================================
Files 3293 3293
Lines 263234 264257 +1023
============================================
+ Hits 185683 186611 +928
- Misses 77551 77646 +95
🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove 5 tests that are version dispatch tests or redundant: - identity_nonces: remove version_0/version_1 dispatch tests (test platform version routing, not enum variant correctness) - basic_structure: remove data_contract_create/update_depends_on_platform_version (no assertions, just check for panics -- weak coverage value) - is_allowed: remove validate_is_allowed test that only re-tested has_is_allowed_validation (already covered above) Keep 36 tests that verify enum variant routing correctness for all StateTransition variants across 10 processor trait files. These add genuine coverage for match arms (especially newer address-based and shielded transition types) that strategy tests may not reach. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Issue being fixed or feature implemented
Improve test coverage for the
packages/rs-drive-abci/src/execution/validation/state_transition/processor/module, which previously had zero tests for its trait implementations.What was done?
Added 46 unit tests covering all state transition routing logic in the processor validation traits module. Tests verify correct classification of every
StateTransitionvariant across 11 trait files:has_is_allowed_validationfor all 20 transition typesuses_identity_in_stateandvalidates_signature_based_on_identity_infofor all variantshas_identity_minimum_balance_pre_check_validationand error when identity has no balancehas_identity_nonce_validationfor both version 0 and version 1, plus unknown version error pathhas_basic_structure_validationincluding version-gated data contract behaviorhas_advanced_structure_validation_without_statehas_advanced_structure_validation_with_stateandrequires_advanced_structure_validation_with_state_on_check_txhas_state_validationfor all variantsuses_prefunded_specialized_balance_for_paymenthas_addresses_balances_and_nonces_validationhas_address_witness_validationplus unknown version error pathshas_addresses_minimum_balance_pre_check_validationhas_shielded_proof_validation,has_shielded_minimum_fee_validation, and unknown version error pathsHow Has This Been Tested?
All 46 tests pass locally:
Tests are fast (0.04s total) as they only exercise pattern-matching logic and boolean routing methods without any I/O or cryptographic operations.
Breaking Changes
None. This PR only adds tests.
Checklist: