rippled
Loading...
Searching...
No Matches
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 <xrpld/app/tx/applySteps.h>
24#include <xrpld/core/Config.h>
25#include <xrpld/ledger/View.h>
26#include <xrpl/beast/utility/Journal.h>
27#include <xrpl/protocol/STTx.h>
28
29#include <utility>
30
31namespace ripple {
32
33class Application;
34class HashRouter;
35
40enum class Validity {
42 SigBad,
46 Valid
47};
48
64 HashRouter& router,
65 STTx const& tx,
66 Rules const& rules,
67 Config const& config);
68
78void
79forceValidity(HashRouter& router, uint256 const& txid, Validity validity);
80
122ApplyResult
123apply(
124 Application& app,
125 OpenView& view,
126 STTx const& tx,
127 ApplyFlags flags,
128 beast::Journal journal);
129
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
A generic endpoint for log messages.
Definition: Journal.h:60
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:26
ApplyTransactionResult
Enum class for return value from applyTransaction
Definition: apply.h:134
@ Success
Applied to this ledger.
@ Retry
Should be retried in this ledger.
@ Fail
Should not be retried in this ledger.
base_uint< 256 > uint256
Definition: base_uint.h:558
ApplyResult apply(Application &app, OpenView &view, STTx const &tx, ApplyFlags flags, beast::Journal journal)
Apply a transaction to an OpenView.
Definition: apply.cpp:109
void forceValidity(HashRouter &router, uint256 const &txid, Validity validity)
Sets the validity of a given transaction in the cache.
Definition: apply.cpp:89
Validity
Describes the pre-processing validity of a transaction.
Definition: apply.h:40
@ SigBad
Signature is bad. Didn't do local checks.
@ Valid
Signature and local checks are good / passed.
@ SigGoodOnly
Signature is good, but local checks fail.
ApplyFlags
Definition: ApplyView.h:30
ApplyTransactionResult applyTransaction(Application &app, OpenView &view, STTx const &tx, bool retryAssured, ApplyFlags flags, beast::Journal journal)
Transaction application helper.
Definition: apply.cpp:125
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