xrpld
Loading...
Searching...
No Matches
libxrpl
protocol
Keylet.cpp
1
#include <xrpl/protocol/Keylet.h>
2
3
#include <xrpl/beast/utility/instrumentation.h>
4
#include <xrpl/protocol/LedgerFormats.h>
5
#include <xrpl/protocol/STLedgerEntry.h>
6
7
namespace
xrpl
{
8
9
bool
10
Keylet::check
(
STLedgerEntry
const
& sle)
const
11
{
12
XRPL_ASSERT(
13
sle.
getType
() !=
ltANY
&& sle.
getType
() !=
ltCHILD
,
14
"xrpl::Keylet::check : valid input type"
);
15
16
if
(
type
==
ltANY
)
17
return
true
;
18
19
if
(
type
==
ltCHILD
)
20
return
sle.
getType
() != ltDIR_NODE;
21
22
return
sle.
getType
() ==
type
&& sle.
key
() ==
key
;
23
}
24
25
}
// namespace xrpl
xrpl::STLedgerEntry
Definition
STLedgerEntry.h:14
xrpl::STLedgerEntry::key
uint256 const & key() const
Returns the 'key' (or 'index') of this item.
Definition
STLedgerEntry.h:101
xrpl::STLedgerEntry::getType
LedgerEntryType getType() const
Definition
STLedgerEntry.h:107
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::ltANY
@ ltANY
A special type, matching any ledger entry type.
Definition
LedgerFormats.h:58
xrpl::ltCHILD
@ ltCHILD
A special type, matching any ledger type except directory nodes.
Definition
LedgerFormats.h:70
xrpl::Keylet::key
uint256 key
Definition
Keylet.h:20
xrpl::Keylet::type
LedgerEntryType type
Definition
Keylet.h:21
xrpl::Keylet::check
bool check(STLedgerEntry const &) const
Returns true if the SLE matches the type.
Definition
Keylet.cpp:10
Generated by
1.16.1