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/ledger/ReadView.h>
24 #include <ripple/shamap/SHAMap.h>
25 #include <ripple/protocol/STValidation.h>
26 #include <ripple/basics/BasicConfig.h>
27 #include <ripple/protocol/SystemParameters.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
63  void
64  doValidation (std::shared_ptr<ReadView const> const& lastClosedLedger,
65  STValidation::FeeSettings & fees) = 0;
66 
72  virtual
73  void
74  doVoting (std::shared_ptr<ReadView const> const& lastClosedLedger,
75  std::vector<STValidation::pointer> const& parentValidations,
76  std::shared_ptr<SHAMap> const& initialPosition) = 0;
77 };
78 
80 FeeVote::Setup
81 setup_FeeVote (Section const& section);
82 
88 make_FeeVote (FeeVote::Setup const& setup, beast::Journal journal);
89 
90 } // ripple
91 
92 #endif
ripple::setup_FeeVote
FeeVote::Setup setup_FeeVote(Section const &section)
Build FeeVote::Setup from a config section.
Definition: FeeVoteImpl.cpp:265
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:285
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< STValidation::pointer > 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::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:60
ripple::feeunit::TaggedFee
Definition: FeeUnits.h:72
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:263
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
ripple::FeeVote::doValidation
virtual void doValidation(std::shared_ptr< ReadView const > const &lastClosedLedger, STValidation::FeeSettings &fees)=0
Add local fee preference to validation.
std::unique_ptr
STL class.
ripple::STValidation::FeeSettings
Fees to set when issuing a new validation.
Definition: STValidation.h:101
ripple::XRPAmount
Definition: XRPAmount.h:46