test(dpp): improve address_funds state transition test coverage#3285
Conversation
Add comprehensive test suites for all three address_funds state transition types: AddressFundingFromAssetLockTransition, AddressCreditWithdrawalTransition, and AddressFundsTransferTransition. Tests cover validate_structure validation logic (empty inputs/outputs, max limits, witness count mismatches, fee strategy validation, amount minimums, overflow checks, balance mismatches), StateTransitionLike trait implementations, StateTransitionFieldTypes, FeatureVersioned, default_versioned constructors, and accessor 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 (3)
✨ 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 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v3.1-dev #3285 +/- ##
============================================
+ Coverage 70.42% 70.52% +0.10%
============================================
Files 3293 3293
Lines 262598 263553 +955
============================================
+ Hits 184935 185873 +938
- Misses 77663 77680 +17
🚀 New features to boost your workflow:
|
Remove trivial getter/setter and constant-assertion tests from mod.rs and v0/state_transition_like.rs for all three address_funds transitions. These tests only exercised auto-derived enum dispatch, hardcoded return values, and simple field accessors that are already covered by drive-abci strategy tests through the full state transition pipeline. Retain all validate_structure unit tests in v0/state_transition_validation.rs which exercise individual error branches (no inputs, too many inputs, witness count mismatch, fee strategy validation, overflow, etc.) that are NOT reached by strategy tests since those only create valid transitions. 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-dpp/src/state_transition/state_transitions/address_funds/module, targeting 93%+ coverage per file.What was done?
Added comprehensive test suites for all three address_funds state transition types:
AddressFundingFromAssetLockTransitionV0 (15 new tests):
AddressCreditWithdrawalTransitionV0 (19 new tests):
AddressFundsTransferTransitionV0 (17 new tests):
How Has This Been Tested?
All 166 address_funds tests pass:
Breaking Changes
None. Only test code was added.
Checklist: