Skip to content

add tests: encrypt under wrong public key#6650

Open
PeterChen13579 wants to merge 3 commits intoXRPLF:ripple/confidential-transferfrom
PeterChen13579:encrypt_wrong_public_key_test
Open

add tests: encrypt under wrong public key#6650
PeterChen13579 wants to merge 3 commits intoXRPLF:ripple/confidential-transferfrom
PeterChen13579:encrypt_wrong_public_key_test

Conversation

@PeterChen13579
Copy link
Contributor

High Level Overview of Change

Context of Change

Add tests and small checks under confidential MPT

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

@PeterChen13579 PeterChen13579 marked this pull request as draft March 25, 2026 16:50
@PeterChen13579 PeterChen13579 marked this pull request as ready for review March 26, 2026 14:35
@codecov
Copy link

codecov bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.1%. Comparing base (2c94e21) to head (8cc1afe).
⚠️ Report is 10 commits behind head on ripple/confidential-transfer.

Files with missing lines Patch % Lines
...l/tx/transactors/token/ConfidentialMPTClawback.cpp 50.0% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                      Coverage Diff                       @@
##           ripple/confidential-transfer   #6650     +/-   ##
==============================================================
- Coverage                          80.2%   80.1%   -0.1%     
==============================================================
  Files                               874     874             
  Lines                             69184   68894    -290     
  Branches                           7562    7548     -14     
==============================================================
- Hits                              55464   55175    -289     
+ Misses                            13720   13719      -1     
Files with missing lines Coverage Δ
...l/tx/transactors/token/ConfidentialMPTClawback.cpp 94.9% <50.0%> (-2.4%) ⬇️

... and 6 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines 71 to +87
@@ -77,6 +81,10 @@ ConfidentialMPTClawback::preclaim(PreclaimContext const& ctx)
if (!sleHolderMPToken->isFieldPresent(sfIssuerEncryptedBalance))
return tecNO_PERMISSION;

// Check if Holder has ElGamal public Key
if (!sleHolderMPToken->isFieldPresent(sfHolderEncryptionKey))
return tecNO_PERMISSION;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both returns should have // LCOV_EXCL_LINE to exclude them from test coverage since they are defensive checks that are unreachable

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