Make Keylet strongly typed so that we can get strongly typed ledger obejcts from views

Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
JCW
2025-08-04 21:32:56 +01:00
parent e7633c939a
commit 304c4ceb9e
5 changed files with 177 additions and 182 deletions

View File

@@ -49,6 +49,21 @@ struct Keylet
check(STLedgerEntry const&) const;
};
template <LedgerEntryType Type>
struct TypedKeylet : Keylet
{
static constexpr LedgerEntryType LedgerType = Type;
TypedKeylet(uint256 const& key_) : Keylet(Type, key_)
{
}
Keylet untyped() const
{
return Keylet(LedgerType, key);
}
};
} // namespace ripple
#endif