Skip to content

line coverage for cosign-v1 - #8207

Open
Kassaking7 wants to merge 7 commits into
XRPLF:ripple/cosign-v1from
Kassaking7:cosign-v1-line-coverage
Open

Kassaking7 wants to merge 7 commits into
XRPLF:ripple/cosign-v1from
Kassaking7:cosign-v1-line-coverage

Conversation

@Kassaking7

Copy link
Copy Markdown
Contributor

High Level Overview of Change

Context of Change

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)

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Comment thread src/libxrpl/tx/applySteps.cpp Outdated
Comment on lines +331 to +333
// outside of a dry run. Coverage is measured in Debug where the assert
// above aborts first, so the body of this defensive branch is
// unreachable there.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we dont need to comment about the unreachable here

Kassaking7 and others added 2 commits September 9, 2026 15:08
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Kassaking7
Kassaking7 requested a review from a team as a code owner September 10, 2026 15:08
@mathbunnyru
mathbunnyru removed the request for review from a team September 10, 2026 15:22
Comment on lines +208 to +214
// Only reachable if the on-ledger SignerList is corrupt
// (SignerListSet re-runs the same deserialize on write).
// LCOV_EXCL_START
JLOG(ctx.j.fatal()) << "TransactionProposalCreate: unparseable SignerList: "
<< transToken(accountSigners.error());
return std::unexpected(tefBAD_LEDGER);
// LCOV_EXCL_STOP

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we test this by modifying the OpenLedger reference (similar to the examples in Invariants test) ? I vaguely remember seeing some corrupt / unreadable SignerList unit-tests. In such a corrupt ledger-state, it is useful to validate that we hit the tefBAD_LEDGER error code.

return tefINTERNAL; // LCOV_EXCL_LINE
isSigner = isAuthorizedFor(delegateAccount);
if (!isSigner)
return isSigner.error();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you explain why this line is unreachable in unit-tests? My understanding is that we need to construct a corrupt ledger-state where the Delegate ledger-object exists, however the associated SignerList is unparseable.

Comment on lines 392 to 398
catch (UnknownTxnType const& e)
{
// Should never happen
// LCOV_EXCL_START
JLOG(debugLog().fatal()) << "Unknown transaction type in invokeCheckPermission: "
<< e.txnType;
UNREACHABLE("xrpl::invokeCheckPermission : unknown transaction type");
return temUNKNOWN;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isn't this block testable by specifying a sfDelegate inside a proposed-transaction and ensuring that the proposed-transaction has an ill-specified transaction-type ??

[[maybe_unused]] unsigned const apiVersion)
{
if (!params.isObject())
return parseObjectID(params, fieldName, "hex string");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An error string to the effect of "expect a hex string to parse the proposal-ID" would be helpful here.

@Kassaking7
Kassaking7 requested a review from ckeshava September 15, 2026 19:33
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.

5 participants