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  unsigned apiVersion,
100  NetworkOPs::FailHard failType,
101  Role role,
102  std::chrono::seconds validatedLedgerAge,
103  Application& app);
104 
108  Json::Value params, // Passed by value so it can be modified locally.
109  unsigned apiVersion,
110  NetworkOPs::FailHard failType,
111  Role role,
112  std::chrono::seconds validatedLedgerAge,
113  Application& app,
114  ProcessTransactionFn const& processTransaction,
115  RPC::SubmitSync sync);
116 
120  Json::Value params, // Passed by value so it can be modified locally.
121  unsigned apiVersion,
122  NetworkOPs::FailHard failType,
123  Role role,
124  std::chrono::seconds validatedLedgerAge,
125  Application& app);
126 
130  Json::Value params, // Passed by value so it can be modified locally.
131  unsigned apiVersion,
132  NetworkOPs::FailHard failType,
133  Role role,
134  std::chrono::seconds validatedLedgerAge,
135  Application& app,
136  ProcessTransactionFn const& processTransaction,
137  RPC::SubmitSync sync);
138 
139 } // namespace RPC
140 } // namespace ripple
141 
142 #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 >
std::chrono::seconds
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::transactionSubmitMultiSigned
Json::Value transactionSubmitMultiSigned(Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app, ProcessTransactionFn const &processTransaction, RPC::SubmitSync sync)
Returns a Json::objectValue.
Definition: TransactionSign.cpp:1068
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:83
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, RPC::SubmitSync sync)
Returns a Json::objectValue.
Definition: TransactionSign.cpp:830
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::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::RPC::SubmitSync::sync
@ sync
ripple::NetworkOPs::FailHard
FailHard
Definition: NetworkOPs.h:95
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