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  NetworkOPs::FailHard failType,
98  Role role,
99  std::chrono::seconds validatedLedgerAge,
100  Application& app);
101 
105  Json::Value params, // Passed by value so it can be modified locally.
106  NetworkOPs::FailHard failType,
107  Role role,
108  std::chrono::seconds validatedLedgerAge,
109  Application& app,
110  ProcessTransactionFn const& processTransaction);
111 
115  Json::Value params, // Passed by value so it can be modified locally.
116  NetworkOPs::FailHard failType,
117  Role role,
118  std::chrono::seconds validatedLedgerAge,
119  Application& app);
120 
124  Json::Value params, // Passed by value so it can be modified locally.
125  NetworkOPs::FailHard failType,
126  Role role,
127  std::chrono::seconds validatedLedgerAge,
128  Application& app,
129  ProcessTransactionFn const& processTransaction);
130 
131 } // namespace RPC
132 } // namespace ripple
133 
134 #endif
ripple::NetworkOPs
Provides server functionality for clients.
Definition: NetworkOPs.h:86
ripple::Application
Definition: Application.h:115
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 >
ripple::RPC::transactionSignFor
Json::Value transactionSignFor(Json::Value jvRequest, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
Returns a Json::objectValue.
Definition: TransactionSign.cpp:928
std::chrono::seconds
std::function
ripple::RPC::transactionSign
Json::Value transactionSign(Json::Value jvRequest, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
Returns a Json::objectValue.
Definition: TransactionSign.cpp:762
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:666
ripple::RPC::getProcessTxnFn
ProcessTransactionFn getProcessTxnFn(NetworkOPs &netOPs)
Definition: TransactionSign.h:82
ripple::RPC::transactionSubmit
Json::Value transactionSubmit(Json::Value jvRequest, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app, ProcessTransactionFn const &processTransaction)
Returns a Json::objectValue.
Definition: TransactionSign.cpp:799
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::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::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
ripple::RPC::transactionSubmitMultiSigned
Json::Value transactionSubmitMultiSigned(Json::Value jvRequest, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app, ProcessTransactionFn const &processTransaction)
Returns a Json::objectValue.
Definition: TransactionSign.cpp:1035