feat: Native Feature RPC (#1526)

This commit is contained in:
Alex Kremer
2024-07-11 12:18:13 +01:00
committed by GitHub
parent 6e606cb7d8
commit f771478da0
15 changed files with 715 additions and 80 deletions

View File

@@ -43,7 +43,7 @@ public:
* @param key The key of the amendment to check
* @return true if supported; false otherwise
*/
virtual bool
[[nodiscard]] virtual bool
isSupported(AmendmentKey const& key) const = 0;
/**
@@ -51,7 +51,7 @@ public:
*
* @return The amendments supported by Clio
*/
virtual std::map<std::string, Amendment> const&
[[nodiscard]] virtual std::map<std::string, Amendment> const&
getSupported() const = 0;
/**
@@ -59,7 +59,7 @@ public:
*
* @return All known amendments as a vector
*/
virtual std::vector<Amendment> const&
[[nodiscard]] virtual std::vector<Amendment> const&
getAll() const = 0;
/**
@@ -69,7 +69,7 @@ public:
* @param seq The sequence to check for
* @return true if enabled; false otherwise
*/
virtual bool
[[nodiscard]] virtual bool
isEnabled(AmendmentKey const& key, uint32_t seq) const = 0;
/**
@@ -80,16 +80,27 @@ public:
* @param seq The sequence to check for
* @return true if enabled; false otherwise
*/
virtual bool
[[nodiscard]] virtual bool
isEnabled(boost::asio::yield_context yield, AmendmentKey const& key, uint32_t seq) const = 0;
/**
* @brief Check whether an amendment was/is enabled for a given sequence
*
* @param yield The coroutine context to use
* @param keys The keys of the amendments to check
* @param seq The sequence to check for
* @return A vector of bools representing enabled state for each of the given keys
*/
[[nodiscard]] virtual std::vector<bool>
isEnabled(boost::asio::yield_context yield, std::vector<AmendmentKey> const& keys, uint32_t seq) const = 0;
/**
* @brief Get an amendment
*
* @param key The key of the amendment to get
* @return The amendment as a const ref; asserts if the amendment is unknown
*/
virtual Amendment const&
[[nodiscard]] virtual Amendment const&
getAmendment(AmendmentKey const& key) const = 0;
/**
@@ -98,7 +109,7 @@ public:
* @param key The amendment key from @see Amendments
* @return The amendment as a const ref; asserts if the amendment is unknown
*/
virtual Amendment const&
[[nodiscard]] virtual Amendment const&
operator[](AmendmentKey const& key) const = 0;
};