refactor: Use named constant for leaf item size (#39) (#7130)

Co-authored-by: Ed Hennis <ed@ripple.com>
This commit is contained in:
Valentin Balaschenko
2026-05-13 14:53:01 +01:00
committed by GitHub
parent 411286c519
commit 4ad94ae2ff
3 changed files with 47 additions and 6 deletions

View File

@@ -7,6 +7,7 @@
#include <xrpl/shamap/SHAMapItem.h>
#include <xrpl/shamap/SHAMapNodeID.h>
#include <cstddef>
#include <cstdint>
#include <string>
@@ -20,6 +21,9 @@ static constexpr unsigned char const kWIRE_TYPE_INNER = 2;
static constexpr unsigned char const kWIRE_TYPE_COMPRESSED_INNER = 3;
static constexpr unsigned char const kWIRE_TYPE_TRANSACTION_WITH_META = 4;
// Lower bound on SHAMap leaf item payload size, in bytes.
inline constexpr std::size_t kMIN_SHA_MAP_ITEM_BYTES = 12;
enum class SHAMapNodeType {
TnInner = 1,
TnTransactionNm = 2, // transaction, no metadata