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:
35  virtual ~FeeVote() = default;
36 
42  virtual void
44  Fees const& lastFees,
45  Rules const& rules,
46  STValidation& val) = 0;
47 
53  virtual void
54  doVoting(
55  std::shared_ptr<ReadView const> const& lastClosedLedger,
56  std::vector<std::shared_ptr<STValidation>> const& parentValidations,
57  std::shared_ptr<SHAMap> const& initialPosition) = 0;
58 };
59 
60 struct FeeSetup;
66 make_FeeVote(FeeSetup const& setup, beast::Journal journal);
67 
68 } // namespace ripple
69 
70 #endif
std::shared_ptr
STL class.
ripple::FeeVote::doValidation
virtual void doValidation(Fees const &lastFees, Rules const &rules, STValidation &val)=0
Add local fee preference to validation.
ripple::FeeVote
Manager to process fee votes.
Definition: FeeVote.h:32
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::STValidation
Definition: STValidation.h:44
ripple::Fees
Reflects the fee settings for a particular ledger.
Definition: ReadView.h:49
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
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::Rules
Rules controlling protocol behavior.
Definition: Rules.h:33
ripple::FeeSetup
Fee schedule for startup / standalone, and to vote for.
Definition: Config.h:69
std::unique_ptr
STL class.
ripple::make_FeeVote
std::unique_ptr< FeeVote > make_FeeVote(FeeSetup const &setup, beast::Journal journal)
Create an instance of the FeeVote logic.
Definition: FeeVoteImpl.cpp:339