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/rpc/Role.h>
25 #include <ripple/ledger/ApplyView.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  Json::Value& request,
66  Role const role,
67  bool doAutoFill,
68  Config const& config,
69  LoadFeeTrack const& feeTrack,
70  TxQ const& txQ,
71  std::shared_ptr<OpenView const> const& ledger);
72 
73 // Return a std::function<> that calls NetworkOPs::processTransaction.
76  bool bUnlimited, bool bLocal, NetworkOPs::FailHard failType)>;
77 
79 {
80  return [&netOPs](std::shared_ptr<Transaction>& transaction,
81  bool bUnlimited, bool bLocal, NetworkOPs::FailHard failType)
82  {
83  netOPs.processTransaction(transaction, bUnlimited, bLocal, failType);
84  };
85 }
86 
89  Json::Value params, // Passed by value so it can be modified locally.
90  NetworkOPs::FailHard failType,
91  Role role,
92  std::chrono::seconds validatedLedgerAge,
93  Application& app);
94 
97  Json::Value params, // Passed by value so it can be modified locally.
98  NetworkOPs::FailHard failType,
99  Role role,
100  std::chrono::seconds validatedLedgerAge,
101  Application& app,
102  ProcessTransactionFn const& processTransaction);
103 
106  Json::Value params, // Passed by value so it can be modified locally.
107  NetworkOPs::FailHard failType,
108  Role role,
109  std::chrono::seconds validatedLedgerAge,
110  Application& app);
111 
114  Json::Value params, // Passed by value so it can be modified locally.
115  NetworkOPs::FailHard failType,
116  Role role,
117  std::chrono::seconds validatedLedgerAge,
118  Application& app,
119  ProcessTransactionFn const& processTransaction);
120 
121 } // RPC
122 } // ripple
123 
124 #endif
ripple::NetworkOPs
Provides server functionality for clients.
Definition: NetworkOPs.h:89
ripple::Application
Definition: Application.h:85
std::shared_ptr
STL class.
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:918
std::chrono::seconds
ripple::RPC::checkFee
Json::Value checkFee(Json::Value &request, Role const role, bool doAutoFill, Config const &config, LoadFeeTrack const &feeTrack, TxQ const &txQ, std::shared_ptr< OpenView const > const &ledger)
Fill in the fee on behalf of the client.
Definition: TransactionSign.cpp:658
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:756
ripple::RPC::getProcessTxnFn
ProcessTransactionFn getProcessTxnFn(NetworkOPs &netOPs)
Definition: TransactionSign.h:78
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:790
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:98
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:40
Json::Value
Represents a JSON value.
Definition: json_value.h:141
ripple::RPC::ProcessTransactionFn
std::function< void(std::shared_ptr< Transaction > &transaction, bool bUnlimited, bool bLocal, NetworkOPs::FailHard failType)> ProcessTransactionFn
Definition: TransactionSign.h:76
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:1031