From 9836e4ceaf3be3eb79f1a80780c0d9106aa9e0e1 Mon Sep 17 00:00:00 2001 From: cyan317 <120398799+cindyyan317@users.noreply.github.com> Date: Thu, 8 Jun 2023 13:12:58 +0100 Subject: [PATCH] fix (#672) Fix #673 --- src/rpc/RPCHelpers.cpp | 2 +- unittests/SubscriptionManagerTest.cpp | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/rpc/RPCHelpers.cpp b/src/rpc/RPCHelpers.cpp index 9e86767a..e23503c5 100644 --- a/src/rpc/RPCHelpers.cpp +++ b/src/rpc/RPCHelpers.cpp @@ -965,7 +965,7 @@ getAccountsFromTransaction(boost::json::object const& transaction) } else if (value.is_string()) { - auto account = accountFromStringStrict(value.as_string().c_str()); + auto account = ripple::parseBase58(value.as_string().c_str()); if (account) { accounts.push_back(*account); diff --git a/unittests/SubscriptionManagerTest.cpp b/unittests/SubscriptionManagerTest.cpp index b1807332..8847a5a5 100644 --- a/unittests/SubscriptionManagerTest.cpp +++ b/unittests/SubscriptionManagerTest.cpp @@ -226,10 +226,21 @@ TEST_F(SubscriptionManagerSimpleBackendTest, SubscriptionManagerValidation) TEST_F(SubscriptionManagerSimpleBackendTest, SubscriptionManagerProposedTransaction) { subManagerPtr->subProposedTransactions(session); + // transaction contains account and its public key + // make sure it is not parsed to two identical accounts constexpr static auto dummyTransaction = R"({ "transaction": { - "Account":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn" + "Account":"rh1HPuRVsYYvThxG2Bs1MfjmrVC73S16Fb", + "Amount":"40000000", + "Destination":"rDgGprMjMWkJRnJ8M5RXq3SXYD8zuQncPc", + "Fee":"20", + "Flags":2147483648, + "Sequence":13767283, + "SigningPubKey":"036F3CFFE1EA77C1EEC5DCCA38C83E62E3AC068F8A16369620AF1D609BA5A620B2", + "TransactionType":"Payment", + "TxnSignature":"30450221009BD0D563B24E50B26A42F30455AD21C3D5CD4D80174C41F7B54969FFC08DE94C02201FC35320B56D56D1E34D1D281D48AC68CBEDDD6EE9DFA639CCB08BB251453A87", + "hash":"F44393295DB860C6860769C16F5B23887762F09F87A8D1174E0FCFF9E7247F07" } })"; subManagerPtr->forwardProposedTransaction(json::parse(dummyTransaction).get_object());