xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
tests
libxrpl
ledger
MPTokenEntry.cpp
1
#include <xrpl/ledger/entries/MPTokenEntry.h>
2
3
#include <xrpl/protocol/Indexes.h>
4
#include <xrpl/protocol/UintTypes.h>
5
6
#include <gtest/gtest.h>
7
#include <ledger/EntryTestHelpers.h>
8
9
namespace
xrpl::test
{
10
11
TEST
(MPTokenEntryTests, constructors)
12
{
13
EntryTestEnv
e;
14
15
MPTID
const
issuanceID =
makeMptID
(1, e.
alice
.
id
());
16
17
expectKeylet<MPTokenEntry>
(
18
e,
19
keylet::mptoken
(issuanceID, e.
bob
.
id
()),
20
"mptoken(MPTID, holder)"
,
21
issuanceID,
22
e.
bob
.
id
());
23
24
expectKeylet<MPTokenEntry>
(
25
e,
26
keylet::mptoken
(e.
someID
(), e.
bob
.
id
()),
27
"mptoken(issuanceKey, holder)"
,
28
e.
someID
(),
29
e.
bob
.
id
());
30
31
expectKeylet<MPTokenEntry>
(e,
keylet::mptoken
(e.
someID
()),
"mptoken(UInt256)"
, e.
someID
());
32
}
33
34
}
// namespace xrpl::test
xrpl::test::EntryTestEnv
Scaffolding shared by the per-entry-type suites.
Definition
EntryTestHelpers.h:28
xrpl::test::EntryTestEnv::alice
Account const alice
Definition
EntryTestHelpers.h:31
xrpl::test::EntryTestEnv::someID
UInt256 someID() const
An arbitrary but stable UInt256, for the entry constructors that take an object ID directly.
Definition
EntryTestHelpers.h:62
xrpl::test::EntryTestEnv::bob
Account const bob
Definition
EntryTestHelpers.h:32
xrpl::test::jtx::Account::id
AccountID id() const
Returns the Account ID.
Definition
jtx/Account.h:104
xrpl::keylet::mptoken
Keylet mptoken(MPTID const &issuanceID, AccountID const &holder) noexcept
Definition
Indexes.cpp:573
xrpl::test
Definition
STLedgerEntry.h:21
xrpl::test::TEST
TEST(UnitsTest, types)
Definition
Units.cpp:16
xrpl::test::expectKeylet
void expectKeylet(EntryTestEnv &e, Keylet const &expected, std::string const &what, Args const &... args)
Assert that both flavors of Entry built from args resolve the ledger object that expected names.
Definition
EntryTestHelpers.h:96
xrpl::MPTID
BaseUInt< 192 > MPTID
MPTID is a 192-bit value representing MPT Issuance ID, which is a concatenation of a 32-bit sequence ...
Definition
UintTypes.h:54
xrpl::makeMptID
MPTID makeMptID(std::uint32_t const sequence, AccountID const &account)
Definition
Indexes.cpp:206
Generated by
1.17.0