rippled
TransactionSign.h
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2012-2014 Ripple Labs Inc.
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #ifndef RIPPLE_RPC_TRANSACTIONSIGN_H_INCLUDED
21 #define RIPPLE_RPC_TRANSACTIONSIGN_H_INCLUDED
22 
23 #include <ripple/app/misc/NetworkOPs.h>
24 #include <ripple/ledger/ApplyView.h>
25 #include <ripple/rpc/Role.h>
26 
27 namespace ripple {
28 
29 // Forward declarations
30 class Application;
31 class LoadFeeTrack;
32 class Transaction;
33 class TxQ;
34 
35 namespace RPC {
36 
65 checkFee(
66  Json::Value& request,
67  Role const role,
68  bool doAutoFill,
69  Config const& config,
70  LoadFeeTrack const& feeTrack,
71  TxQ const& txQ,
72  Application const& app);
73 
74 // Return a std::function<> that calls NetworkOPs::processTransaction.
76  std::shared_ptr<Transaction>& transaction,
77  bool bUnlimited,
78  bool bLocal,
80 
83 {
84  return [&netOPs](
85  std::shared_ptr<Transaction>& transaction,
86  bool bUnlimited,
87  bool bLocal,
88  NetworkOPs::FailHard failType) {
89  netOPs.processTransaction(transaction, bUnlimited, bLocal, failType);
90  };
91 }
92 
96  Json::Value params, // Passed by value so it can be modified locally.
97  unsigned apiVersion,
98  NetworkOPs::FailHard failType,
99  Role role,
100  std::chrono::seconds validatedLedgerAge,
101  Application& app);
102 
106  Json::Value params, // Passed by value so it can be modified locally.
107  unsigned apiVersion,
108  NetworkOPs::FailHard failType,
109  Role role,
110  std::chrono::seconds validatedLedgerAge,
111  Application& app,
112  ProcessTransactionFn const& processTransaction);
113 
117  Json::Value params, // Passed by value so it can be modified locally.
118  unsigned apiVersion,
119  NetworkOPs::FailHard failType,
120  Role role,
121  std::chrono::seconds validatedLedgerAge,
122  Application& app);
123 
127  Json::Value params, // Passed by value so it can be modified locally.
128  unsigned apiVersion,
129  NetworkOPs::FailHard failType,
130  Role role,
131  std::chrono::seconds validatedLedgerAge,
132  Application& app,
133  ProcessTransactionFn const& processTransaction);
134 
135 } // namespace RPC
136 } // namespace ripple
137 
138 #endif
ripple::NetworkOPs
Provides server functionality for clients.
Definition: NetworkOPs.h:86
ripple::Application
Definition: Application.h:116
ripple::RPC::ProcessTransactionFn
std::function< void(std::shared_ptr< Transaction > &transaction, bool bUnlimited, bool bLocal, NetworkOPs::FailHard failType)> ProcessTransactionFn
Definition: TransactionSign.h:79
std::shared_ptr< Transaction >
std::chrono::seconds
std::function
ripple::RPC::checkFee
Json::Value checkFee(Json::Value &request, Role const role, bool doAutoFill, Config const &config, LoadFeeTrack const &feeTrack, TxQ const &txQ, Application const &app)
Fill in the fee on behalf of the client.
Definition: TransactionSign.cpp:696
ripple::RPC::getProcessTxnFn
ProcessTransactionFn getProcessTxnFn(NetworkOPs &netOPs)
Definition: TransactionSign.h:82
ripple::NetworkOPs::processTransaction
virtual void processTransaction(std::shared_ptr< Transaction > &transaction, bool bUnlimited, bool bLocal, FailHard failType)=0
Process transactions as they arrive from the network or which are submitted by clients.
ripple::RPC::transactionSign
Json::Value transactionSign(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
Returns a Json::objectValue.
Definition: TransactionSign.cpp:792
ripple::RPC::transactionSubmit
Json::Value transactionSubmit(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app, ProcessTransactionFn const &processTransaction)
Returns a Json::objectValue.
Definition: TransactionSign.cpp:830
ripple::RPC::transactionSignFor
Json::Value transactionSignFor(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
Returns a Json::objectValue.
Definition: TransactionSign.cpp:960
ripple::NetworkOPs::FailHard
FailHard
Definition: NetworkOPs.h:91
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::RPC::transactionSubmitMultiSigned
Json::Value transactionSubmitMultiSigned(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app, ProcessTransactionFn const &processTransaction)
Returns a Json::objectValue.
Definition: TransactionSign.cpp:1068
ripple::Role
Role
Indicates the level of administrative permission to grant.
Definition: Role.h:43
Json::Value
Represents a JSON value.
Definition: json_value.h:145