feat: support Concise Transaction Identifier (CTID) (XLS-37) (#4418)

* add CTIM to tx rpc

---------

Co-authored-by: Rome Reginelli <mduo13@gmail.com>
Co-authored-by: Elliot Lee <github.public@intelliot.com>
Co-authored-by: Denis Angell <dangell@transia.co>
This commit is contained in:
RichardAH
2023-08-18 03:43:47 +02:00
committed by tequ
parent 85a636d494
commit 13acc00c95
4 changed files with 6 additions and 8 deletions

View File

@@ -217,6 +217,9 @@ doTxHelp(RPC::Context& context, TxArgs args)
ClosedInterval<uint32_t>(args.ctid->first, args.ctid->second);
}
if (!args.hash)
return {result, rpcTXN_NOT_FOUND};
if (args.ledgerRange)
{
v = context.app.getMasterTransaction().fetch(*(args.hash), range, ec);

View File

@@ -34,6 +34,7 @@
#include <ripple/rpc/DeliveredAmount.h>
#include <ripple/rpc/impl/RPCHelpers.h>
#include <boost/algorithm/string/case_conv.hpp>
#include <regex>
#include <ripple/resource/Fees.h>
#include <regex>

View File

@@ -68,14 +68,9 @@ public:
jv[jss::Destination] = alice.human();
jv[jss::TransactionType] = "Payment";
jv[jss::Amount] = "10000000000";
if (env.app().config().NETWORK_ID > 1024)
jv[jss::NetworkID] =
std::to_string(env.app().config().NETWORK_ID);
env(jv, fee(1000), sig(env.master));
}
// run tx
env(jv, fee(1000), ter(expectedOutcome));
env.close();
};
@@ -127,7 +122,6 @@ public:
{
test::jtx::Env env{*this, makeNetworkConfig(1025)};
BEAST_EXPECT(env.app().config().NETWORK_ID == 1025);
// try to submit a txn without network id, this should not work
{
env.fund(XRP(200), alice);

View File

@@ -367,7 +367,7 @@ class Transaction_test : public beast::unit_test::suite
if (deltaEndSeq)
BEAST_EXPECT(!result[jss::result][jss::searched_all].asBool());
else
BEAST_EXPECT(result[jss::result][jss::searched_all].asBool());
BEAST_EXPECT(!result[jss::result][jss::searched_all].asBool());
}
// Find transactions outside of provided range.
@@ -435,7 +435,7 @@ class Transaction_test : public beast::unit_test::suite
result[jss::result][jss::status] == jss::error &&
result[jss::result][jss::error] == NOT_FOUND);
BEAST_EXPECT(result[jss::result][jss::searched_all].asBool());
BEAST_EXPECT(!result[jss::result][jss::searched_all].asBool());
}
// Provide range without providing the `binary`