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/basics/SubmitSync.h>
25 #include <ripple/ledger/ApplyView.h>
26 #include <ripple/rpc/Role.h>
27 
28 namespace ripple {
29 
30 // Forward declarations
31 class Application;
32 class LoadFeeTrack;
33 class Transaction;
34 class TxQ;
35 
36 namespace RPC {
37 
66 checkFee(
67  Json::Value& request,
68  Role const role,
69  bool doAutoFill,
70  Config const& config,
71  LoadFeeTrack const& feeTrack,
72  TxQ const& txQ,
73  Application const& app);
74 
75 // Return a std::function<> that calls NetworkOPs::processTransaction.
77  std::shared_ptr<Transaction>& transaction,
78  bool bUnlimited,
79  RPC::SubmitSync sync,
81 
84 {
85  return [&netOPs](
86  std::shared_ptr<Transaction>& transaction,
87  bool bUnlimited,
89  NetworkOPs::FailHard failType) {
90  netOPs.processTransaction(
91  transaction, bUnlimited, sync, true, failType);
92  };
93 }
94 
98  Json::Value params, // Passed by value so it can be modified locally.
99  NetworkOPs::FailHard failType,
100  Role role,
101  std::chrono::seconds validatedLedgerAge,
102  Application& app);
103 
107  Json::Value params, // Passed by value so it can be modified locally.
108  NetworkOPs::FailHard failType,
109  Role role,
110  std::chrono::seconds validatedLedgerAge,
111  Application& app,
112  ProcessTransactionFn const& processTransaction,
113  RPC::SubmitSync sync);
114 
118  Json::Value params, // Passed by value so it can be modified locally.
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  NetworkOPs::FailHard failType,
129  Role role,
130  std::chrono::seconds validatedLedgerAge,
131  Application& app,
132  ProcessTransactionFn const& processTransaction,
133  RPC::SubmitSync sync);
134 
135 } // namespace RPC
136 } // namespace ripple
137 
138 #endif
ripple::NetworkOPs
Provides server functionality for clients.
Definition: NetworkOPs.h:90
ripple::Application
Definition: Application.h:116
ripple::RPC::SubmitSync
SubmitSync
Possible values for defining synchronous behavior of the transaction submission API.
Definition: SubmitSync.h:36
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
ripple::RPC::transactionSubmit
Json::Value transactionSubmit(Json::Value jvRequest, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app, ProcessTransactionFn const &processTransaction, RPC::SubmitSync sync)
Returns a Json::objectValue.
Definition: TransactionSign.cpp:799
ripple::NetworkOPs::processTransaction
virtual void processTransaction(std::shared_ptr< Transaction > &transaction, bool bUnlimited, RPC::SubmitSync sync, bool bLocal, FailHard failType)=0
Process a transaction.
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:83
ripple::RPC::SubmitSync::sync
@ sync
ripple::NetworkOPs::FailHard
FailHard
Definition: NetworkOPs.h:95
ripple::RPC::transactionSubmitMultiSigned
Json::Value transactionSubmitMultiSigned(Json::Value jvRequest, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app, ProcessTransactionFn const &processTransaction, RPC::SubmitSync sync)
Returns a Json::objectValue.
Definition: TransactionSign.cpp:1035
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::RPC::ProcessTransactionFn
std::function< void(std::shared_ptr< Transaction > &transaction, bool bUnlimited, RPC::SubmitSync sync, NetworkOPs::FailHard failType)> ProcessTransactionFn
Definition: TransactionSign.h:80
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