20 #ifndef RIPPLE_APP_MISC_AMENDMENTTABLE_H_INCLUDED
21 #define RIPPLE_APP_MISC_AMENDMENTTABLE_H_INCLUDED
23 #include <ripple/app/ledger/Ledger.h>
24 #include <ripple/protocol/STValidation.h>
25 #include <ripple/core/ConfigSections.h>
26 #include <ripple/protocol/Protocol.h>
57 virtual boost::optional<NetClock::time_point>
72 lastValidatedLedger->seq(),
124 lastClosedLedger->parentCloseTime(),
130 for (
auto const& it : actions)
133 [&it, seq = lastClosedLedger->seq() + 1](
auto& obj)
135 obj.setAccountID (sfAccount, AccountID());
136 obj.setFieldH256 (sfAmendment, it.first);
137 obj.setFieldU32 (sfLedgerSequence, seq);
140 obj.setFieldU32 (sfFlags, it.second);
146 initialPosition->addGiveItem (
147 std::make_shared <SHAMapItem> (
159 int majorityFraction,
160 Section
const& supported,
161 Section
const& enabled,
162 Section
const& vetoed,
majorityAmendments_t getMajorityAmendments(ReadView const &view)
std::set< uint256 > getEnabledAmendments(ReadView const &view)
virtual bool veto(uint256 const &amendment)=0
virtual bool needValidatedLedger(LedgerIndex seq)=0
Called to determine whether the amendment logic needs to process a new validated ledger.
virtual uint256 find(std::string const &name)=0
std::unique_ptr< AmendmentTable > make_AmendmentTable(std::chrono::seconds majorityTime, int majorityFraction, Section const &supported, Section const &enabled, Section const &vetoed, beast::Journal journal)
virtual std::map< uint256, std::uint32_t > doVoting(NetClock::time_point closeTime, std::set< uint256 > const &enabledAmendments, majorityAmendments_t const &majorityAmendments, std::vector< STValidation::pointer > const &valSet)=0
void doValidatedLedger(std::shared_ptr< ReadView const > const &lastValidatedLedger)
Called when a new fully-validated ledger is accepted.
virtual std::vector< uint256 > getDesired()=0
virtual bool hasUnsupportedEnabled()=0
returns true if one or more amendments on the network have been enabled that this server does not sup...
virtual bool unVeto(uint256 const &amendment)=0
virtual ~AmendmentTable()=default
A generic endpoint for log messages.
virtual bool enable(uint256 const &amendment)=0
virtual bool isSupported(uint256 const &amendment)=0
uint256 getTransactionID() const
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
virtual void add(Serializer &s) const override
Blob const & peekData() const
virtual boost::optional< NetClock::time_point > firstUnsupportedExpected()=0
The amendment table stores the list of enabled and potential amendments.
void doVoting(std::shared_ptr< ReadView const > const &lastClosedLedger, std::vector< STValidation::pointer > const &parentValidations, std::shared_ptr< SHAMap > const &initialPosition)
virtual bool disable(uint256 const &amendment)=0
virtual std::vector< uint256 > doValidation(std::set< uint256 > const &enabled)=0
virtual Json::Value getJson(int)=0
virtual bool isEnabled(uint256 const &amendment)=0