rippled
apply.h
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2012, 2013 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_TX_APPLY_H_INCLUDED
21 #define RIPPLE_TX_APPLY_H_INCLUDED
22 
23 #include <ripple/beast/utility/Journal.h>
24 #include <ripple/core/Config.h>
25 #include <ripple/ledger/View.h>
26 #include <ripple/protocol/STTx.h>
27 #include <ripple/protocol/TER.h>
28 #include <memory>
29 #include <utility>
30 
31 namespace ripple {
32 
33 class Application;
34 class HashRouter;
35 
40 enum class Validity {
42  SigBad,
46  Valid
47 };
48 
64  HashRouter& router,
65  STTx const& tx,
66  Rules const& rules,
67  Config const& config);
68 
78 void
79 forceValidity(HashRouter& router, uint256 const& txid, Validity validity);
80 
123 apply(
124  Application& app,
125  OpenView& view,
126  STTx const& tx,
127  ApplyFlags flags,
128  beast::Journal journal);
129 
134 enum class ApplyResult {
136  Success,
138  Fail,
140  Retry
141 };
142 
152  Application& app,
153  OpenView& view,
154  STTx const& tx,
155  bool retryAssured,
156  ApplyFlags flags,
157  beast::Journal journal);
158 
159 } // namespace ripple
160 
161 #endif
utility
ripple::apply
std::pair< TER, bool > apply(Application &app, OpenView &view, STTx const &tx, ApplyFlags flags, beast::Journal journal)
Apply a transaction to an OpenView.
Definition: apply.cpp:109
std::pair
ripple::applyTransaction
ApplyResult applyTransaction(Application &app, OpenView &view, STTx const &tx, bool retryAssured, ApplyFlags flags, beast::Journal journal)
Transaction application helper.
Definition: apply.cpp:125
ripple::ApplyFlags
ApplyFlags
Definition: ApplyView.h:29
ripple::Validity
Validity
Describes the pre-processing validity of a transaction.
Definition: apply.h:40
ripple::ApplyResult
ApplyResult
Enum class for return value from applyTransaction
Definition: apply.h:134
ripple::forceValidity
void forceValidity(HashRouter &router, uint256 const &txid, Validity validity)
Sets the validity of a given transaction in the cache.
Definition: apply.cpp:89
ripple::uint256
base_uint< 256 > uint256
Definition: base_uint.h:550
ripple::Validity::SigGoodOnly
@ SigGoodOnly
Signature is good, but local checks fail.
ripple::checkValidity
std::pair< Validity, std::string > checkValidity(HashRouter &router, STTx const &tx, Rules const &rules, Config const &config)
Checks transaction signature and local checks.
Definition: apply.cpp:37
ripple::ApplyResult::Retry
@ Retry
Should be retried in this ledger.
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
ripple::ApplyResult::Success
@ Success
Applied to this ledger.
memory
ripple::ApplyResult::Fail
@ Fail
Should not be retried in this ledger.
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::Validity::Valid
@ Valid
Signature and local checks are good / passed.
ripple::Validity::SigBad
@ SigBad
Signature is bad. Didn't do local checks.