rippled
FeeVote.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_APP_MISC_FEEVOTE_H_INCLUDED
21 #define RIPPLE_APP_MISC_FEEVOTE_H_INCLUDED
22 
23 #include <ripple/basics/BasicConfig.h>
24 #include <ripple/ledger/ReadView.h>
25 #include <ripple/protocol/STValidation.h>
26 #include <ripple/protocol/SystemParameters.h>
27 #include <ripple/shamap/SHAMap.h>
28 
29 namespace ripple {
30 
32 class FeeVote
33 {
34 public:
40  struct Setup
41  {
44 
46  static constexpr FeeUnit32 reference_fee_units{10};
47 
50 
53  };
54 
55  virtual ~FeeVote() = default;
56 
62  virtual void
63  doValidation(Fees const& lastFees, STValidation& val) = 0;
64 
70  virtual void
71  doVoting(
72  std::shared_ptr<ReadView const> const& lastClosedLedger,
73  std::vector<std::shared_ptr<STValidation>> const& parentValidations,
74  std::shared_ptr<SHAMap> const& initialPosition) = 0;
75 };
76 
78 FeeVote::Setup
79 setup_FeeVote(Section const& section);
80 
86 make_FeeVote(FeeVote::Setup const& setup, beast::Journal journal);
87 
88 } // namespace ripple
89 
90 #endif
ripple::setup_FeeVote
FeeVote::Setup setup_FeeVote(Section const &section)
Build FeeVote::Setup from a config section.
Definition: FeeVoteImpl.cpp:259
ripple::FeeVote::Setup::owner_reserve
XRPAmount owner_reserve
The per-owned item reserve requirement in drops.
Definition: FeeVote.h:52
std::shared_ptr
STL class.
ripple::make_FeeVote
std::unique_ptr< FeeVote > make_FeeVote(FeeVote::Setup const &setup, beast::Journal journal)
Create an instance of the FeeVote logic.
Definition: FeeVoteImpl.cpp:279
ripple::FeeVote
Manager to process fee votes.
Definition: FeeVote.h:32
ripple::FeeVote::Setup::reference_fee
XRPAmount reference_fee
The cost of a reference transaction in drops.
Definition: FeeVote.h:43
std::vector
STL class.
ripple::FeeVote::doVoting
virtual void doVoting(std::shared_ptr< ReadView const > const &lastClosedLedger, std::vector< std::shared_ptr< STValidation >> const &parentValidations, std::shared_ptr< SHAMap > const &initialPosition)=0
Cast our local vote on the fee.
ripple::FeeVote::Setup
Fee schedule to vote for.
Definition: FeeVote.h:40
ripple::STValidation
Definition: STValidation.h:43
ripple::Fees
Reflects the fee settings for a particular ledger.
Definition: ReadView.h:48
ripple::FeeVote::Setup::account_reserve
XRPAmount account_reserve
The account reserve requirement in drops.
Definition: FeeVote.h:49
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
ripple::feeunit::TaggedFee
Definition: FeeUnits.h:70
ripple::FeeVote::Setup::reference_fee_units
static constexpr FeeUnit32 reference_fee_units
The cost of a reference transaction in fee units.
Definition: FeeVote.h:46
ripple::DROPS_PER_XRP
constexpr XRPAmount DROPS_PER_XRP
Number of drops per 1 XRP.
Definition: XRPAmount.h:244
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::FeeVote::~FeeVote
virtual ~FeeVote()=default
std::unique_ptr
STL class.
ripple::FeeVote::doValidation
virtual void doValidation(Fees const &lastFees, STValidation &val)=0
Add local fee preference to validation.
ripple::XRPAmount
Definition: XRPAmount.h:46