From cd75e630a2bf8b2cb78fe6230acf41c3af102cb5 Mon Sep 17 00:00:00 2001 From: Shawn Xie <35279399+shawnxie999@users.noreply.github.com> Date: Mon, 3 Nov 2025 18:46:27 -0500 Subject: [PATCH] Change ConfidentialSend preflight error code (#5994) --- src/test/app/ConfidentialTransfer_test.cpp | 6 +++--- src/xrpld/app/tx/detail/ConfidentialSend.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/app/ConfidentialTransfer_test.cpp b/src/test/app/ConfidentialTransfer_test.cpp index e09d4cd6dc..ef25828eaf 100644 --- a/src/test/app/ConfidentialTransfer_test.cpp +++ b/src/test/app/ConfidentialTransfer_test.cpp @@ -910,7 +910,7 @@ class ConfidentialTransfer_test : public beast::unit_test::suite Buffer(ripple::ecGamalEncryptedTotalLength), .issuerEncryptedAmt = Buffer(ripple::ecGamalEncryptedTotalLength), - .err = temMALFORMED}); + .err = temBAD_CIPHERTEXT}); // dest encrypted amount wrong length mptAlice.send( {.account = bob, @@ -922,7 +922,7 @@ class ConfidentialTransfer_test : public beast::unit_test::suite .destEncryptedAmt = Buffer(10), // Incorrect length .issuerEncryptedAmt = Buffer(ripple::ecGamalEncryptedTotalLength), - .err = temMALFORMED}); + .err = temBAD_CIPHERTEXT}); // issuer encrypted amount wrong length mptAlice.send( {.account = bob, @@ -934,7 +934,7 @@ class ConfidentialTransfer_test : public beast::unit_test::suite .destEncryptedAmt = Buffer(ripple::ecGamalEncryptedTotalLength), .issuerEncryptedAmt = Buffer(10), - .err = temMALFORMED}); + .err = temBAD_CIPHERTEXT}); auto const ciphertextHex = generatePlaceholderCiphertext(); diff --git a/src/xrpld/app/tx/detail/ConfidentialSend.cpp b/src/xrpld/app/tx/detail/ConfidentialSend.cpp index c2530de8bd..12349b4d6b 100644 --- a/src/xrpld/app/tx/detail/ConfidentialSend.cpp +++ b/src/xrpld/app/tx/detail/ConfidentialSend.cpp @@ -53,7 +53,7 @@ ConfidentialSend::preflight(PreflightContext const& ctx) ctx.tx[sfDestinationEncryptedAmount].length() != ecGamalEncryptedTotalLength || ctx.tx[sfIssuerEncryptedAmount].length() != ecGamalEncryptedTotalLength) - return temMALFORMED; + return temBAD_CIPHERTEXT; if (!isValidCiphertext(ctx.tx[sfSenderEncryptedAmount]) || !isValidCiphertext(ctx.tx[sfDestinationEncryptedAmount]) ||