rippled
Loading...
Searching...
No Matches
SignHandler.cpp
1#include <xrpld/app/ledger/LedgerMaster.h>
2#include <xrpld/rpc/Context.h>
3#include <xrpld/rpc/detail/TransactionSign.h>
4
5#include <xrpl/protocol/ErrorCodes.h>
6#include <xrpl/resource/Fees.h>
7
8namespace ripple {
9
10// {
11// tx_json: <object>,
12// secret: <secret>
13// }
16{
17 if (context.role != Role::ADMIN && !context.app.config().canSign())
18 {
19 return RPC::make_error(
20 rpcNOT_SUPPORTED, "Signing is not supported by this server.");
21 }
22
25 context.params.isMember(jss::fail_hard) &&
26 context.params[jss::fail_hard].asBool());
27
28 auto ret = RPC::transactionSign(
29 context.params,
30 context.apiVersion,
31 failType,
32 context.role,
34 context.app);
35
36 ret[jss::deprecated] =
37 "This command has been deprecated and will be "
38 "removed in a future version of the server. Please "
39 "migrate to a standalone signing tool.";
40
41 return ret;
42}
43
44} // namespace ripple
Represents a JSON value.
Definition json_value.h:131
bool asBool() const
bool isMember(char const *key) const
Return true if the object has a member named key.
virtual Config & config()=0
bool canSign() const
Definition Config.h:329
std::chrono::seconds getValidatedLedgerAge()
static FailHard doFailHard(bool noMeansDont)
Definition NetworkOPs.h:76
Json::Value transactionSign(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
Returns a Json::objectValue.
Json::Value make_error(error_code_i code)
Returns a new json object that reflects the error code.
Charge const feeHeavyBurdenRPC
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
@ rpcNOT_SUPPORTED
Definition ErrorCodes.h:113
Json::Value doSign(RPC::JsonContext &)
unsigned int apiVersion
Definition Context.h:30
Resource::Charge & loadType
Definition Context.h:23
Application & app
Definition Context.h:22
LedgerMaster & ledgerMaster
Definition Context.h:25