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/core/ConfigSections.h>
25 #include <ripple/protocol/Protocol.h>
26 #include <ripple/protocol/STValidation.h>
65 virtual boost::optional<NetClock::time_point>
82 lastValidatedLedger->seq(),
134 lastClosedLedger->parentCloseTime(),
140 for (
auto const& it : actions)
144 [&it, seq = lastClosedLedger->seq() + 1](
auto& obj) {
145 obj.setAccountID(sfAccount, AccountID());
146 obj.setFieldH256(sfAmendment, it.first);
147 obj.setFieldU32(sfLedgerSequence, seq);
150 obj.setFieldU32(sfFlags, it.second);
156 initialPosition->addGiveItem(
157 std::make_shared<SHAMapItem>(
168 int majorityFraction,
169 Section
const& supported,
170 Section
const& enabled,
171 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)
void doVoting(std::shared_ptr< ReadView const > const &lastClosedLedger, std::vector< std::shared_ptr< STValidation >> const &parentValidations, std::shared_ptr< SHAMap > const &initialPosition)
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
virtual std::map< uint256, std::uint32_t > doVoting(NetClock::time_point closeTime, std::set< uint256 > const &enabledAmendments, majorityAmendments_t const &majorityAmendments, std::vector< std::shared_ptr< STValidation >> const &valSet)=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.
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