Skip to content

test(dpp): improve coverage for identity state transitions and public keys in creation#3456

Merged
QuantumExplorer merged 1 commit intov3.1-devfrom
test/dpp-identity-transitions-coverage
Apr 8, 2026
Merged

test(dpp): improve coverage for identity state transitions and public keys in creation#3456
QuantumExplorer merged 1 commit intov3.1-devfrom
test/dpp-identity-transitions-coverage

Conversation

@QuantumExplorer
Copy link
Copy Markdown
Member

Summary

Adds 203 tests across 15 files covering identity state transition construction, serialization, validation, and conversion logic.

Module Tests Coverage Before What's covered
identity_credit_transfer_transition 28 27% StateTransitionLike, serialization round-trips, value conversions, fee estimation
identity_topup_transition 19 35% Construction, AssetLockProved, serialization, fee estimation
identity_create_transition 21 43% Unique identifiers, owner_id, serialization, From conversions
identity_credit_withdrawal_transition 42 41% V0+V1 variants, optional output_script, MIN_WITHDRAWAL_AMOUNT
masternode_vote_transition 19 41% VOTING purpose with security levels, value conversions
identity_update_transition 27 43% MASTER key requirement, cleaned_object, helper functions
public_key_in_creation 27 41% Validation logic (missing master, duplicate IDs/data, security levels)

Test plan

  • cargo test -p dpp --lib — 2354 passed
  • cargo fmt --all clean
  • CI

🤖 Generated with Claude Code

Add comprehensive unit tests for all seven identity state transition
modules that had the lowest coverage. Tests cover construction,
accessors, StateTransitionLike/Owned/SingleSigned trait impls,
IdentitySigned trait impls, value conversion roundtrips, serialization
roundtrips, estimated fee validation, and error paths for unknown
versions. Also adds thorough tests for public key structure validation
including duplicate key detection, master key requirements, and
security level enforcement.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 8, 2026

Warning

Rate limit exceeded

@QuantumExplorer has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 43 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 7 minutes and 43 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 677dcf0f-2860-481c-b72a-c696d6059bb4

📥 Commits

Reviewing files that changed from the base of the PR and between 7bc901b and 0050a47.

📒 Files selected for processing (15)
  • packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/mod.rs
  • packages/rs-dpp/src/state_transition/state_transitions/identity/identity_create_transition/v0/mod.rs
  • packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/mod.rs
  • packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_transfer_transition/v0/mod.rs
  • packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/mod.rs
  • packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v0/mod.rs
  • packages/rs-dpp/src/state_transition/state_transitions/identity/identity_credit_withdrawal_transition/v1/mod.rs
  • packages/rs-dpp/src/state_transition/state_transitions/identity/identity_topup_transition/mod.rs
  • packages/rs-dpp/src/state_transition/state_transitions/identity/identity_topup_transition/v0/mod.rs
  • packages/rs-dpp/src/state_transition/state_transitions/identity/identity_update_transition/mod.rs
  • packages/rs-dpp/src/state_transition/state_transitions/identity/identity_update_transition/v0/mod.rs
  • packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/mod.rs
  • packages/rs-dpp/src/state_transition/state_transitions/identity/masternode_vote_transition/v0/mod.rs
  • packages/rs-dpp/src/state_transition/state_transitions/identity/public_key_in_creation/mod.rs
  • packages/rs-dpp/src/state_transition/state_transitions/identity/public_key_in_creation/v0/mod.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/dpp-identity-transitions-coverage

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added this to the v3.1.0 milestone Apr 8, 2026
@thepastaclaw
Copy link
Copy Markdown
Collaborator

thepastaclaw commented Apr 8, 2026

Review Gate

Commit: 0050a479

  • Debounce: 15m ago (need 30m)

  • CI checks: builds passed, 0/2 tests passed

  • CodeRabbit review: comment found

  • Off-peak hours: off-peak (01:30 AM PT Wednesday)

  • Run review now (check to override)

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 99.34795% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.98%. Comparing base (59f233f) to head (0050a47).
⚠️ Report is 6 commits behind head on v3.1-dev.

Files with missing lines Patch % Lines
...transitions/identity/public_key_in_creation/mod.rs 98.04% 4 Missing ⚠️
...ions/identity/identity_create_transition/v0/mod.rs 98.68% 1 Missing ⚠️
...tity/identity_credit_transfer_transition/v0/mod.rs 99.04% 1 Missing ⚠️
...ty/identity_credit_withdrawal_transition/v0/mod.rs 98.91% 1 Missing ⚠️
...ty/identity_credit_withdrawal_transition/v1/mod.rs 99.15% 1 Missing ⚠️
...tions/identity/identity_topup_transition/v0/mod.rs 98.24% 1 Missing ⚠️
...ions/identity/identity_update_transition/v0/mod.rs 99.16% 1 Missing ⚠️
...ions/identity/masternode_vote_transition/v0/mod.rs 98.91% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           v3.1-dev    #3456      +/-   ##
============================================
+ Coverage     83.13%   83.98%   +0.84%     
============================================
  Files          2621     2621              
  Lines        270434   275224    +4790     
============================================
+ Hits         224833   231137    +6304     
+ Misses        45601    44087    -1514     
Components Coverage Δ
dpp 79.27% <99.34%> (+3.16%) ⬆️
drive 84.19% <ø> (+0.13%) ⬆️
drive-abci 87.03% <ø> (+0.28%) ⬆️
sdk ∅ <ø> (∅)
dapi-client ∅ <ø> (∅)
platform-version ∅ <ø> (∅)
platform-value 92.10% <ø> (+0.09%) ⬆️
platform-wallet ∅ <ø> (∅)
drive-proof-verifier 55.66% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@QuantumExplorer QuantumExplorer merged commit 46e037e into v3.1-dev Apr 8, 2026
39 checks passed
@QuantumExplorer QuantumExplorer deleted the test/dpp-identity-transitions-coverage branch April 8, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants