mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user