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
26#include <xrpl/beast/utility/Journal.h>
27#include <xrpl/ledger/View.h>
28#include <xrpl/protocol/STTx.h>
29
30#include <utility>
31
32namespace ripple {
33
34class Application;
35class HashRouter;
36
41enum class Validity {
43 SigBad,
47 Valid
48};
49
65 HashRouter& router,
66 STTx const& tx,
67 Rules const& rules,
68 Config const& config);
69
79void
80forceValidity(HashRouter& router, uint256 const& txid, Validity validity);
81
123ApplyResult
124apply(
125 Application& app,
126 OpenView& view,
127 STTx const& tx,
128 ApplyFlags flags,
129 beast::Journal journal);
130
137 Success,
139 Fail,
141 Retry
142};
143
153 Application& app,
154 OpenView& view,
155 STTx const& tx,
156 bool retryAssured,
157 ApplyFlags flags,
158 beast::Journal journal);
159
160} // namespace ripple
161
162#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:25
ApplyTransactionResult
Enum class for return value from applyTransaction
Definition apply.h:135
@ 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:146
void forceValidity(HashRouter &router, uint256 const &txid, Validity validity)
Sets the validity of a given transaction in the cache.
Definition apply.cpp:118
Validity
Describes the pre-processing validity of a transaction.
Definition apply.h:41
@ 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.
ApplyTransactionResult applyTransaction(Application &app, OpenView &view, STTx const &tx, bool retryAssured, ApplyFlags flags, beast::Journal journal)
Transaction application helper.
Definition apply.cpp:239
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:44