rippled
Loading...
Searching...
No Matches
SHAMapMissingNode.h
1#pragma once
2
3#include <xrpl/basics/base_uint.h>
4#include <xrpl/shamap/SHAMapTreeNode.h>
5
6#include <iosfwd>
7#include <stdexcept>
8#include <string>
9#include <type_traits>
10
11namespace xrpl {
12
13enum class SHAMapType {
14 TRANSACTION = 1, // A tree of transactions
15 STATE = 2, // A tree of state nodes
16 FREE = 3, // A tree not part of a ledger
17};
18
19inline std::string
21{
22 switch (t)
23 {
25 return "Transaction Tree";
27 return "State Tree";
29 return "Free Tree";
30 default:
32 }
33}
34
36{
37public:
39 : std::runtime_error("Missing Node: " + to_string(t) + ": hash " + to_string(hash))
40 {
41 }
42
44 : std::runtime_error("Missing Node: " + to_string(t) + ": id " + to_string(id))
45 {
46 }
47};
48
49} // namespace xrpl
SHAMapMissingNode(SHAMapType t, uint256 const &id)
SHAMapMissingNode(SHAMapType t, SHAMapHash const &hash)
STL namespace.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:597
constexpr std::enable_if_t< std::is_integral_v< Dest > &&std::is_integral_v< Src >, Dest > safe_cast(Src s) noexcept
Definition safe_cast.h:19
T to_string(T... args)