xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
tests
libxrpl
ledger
TicketEntry.cpp
1
#include <xrpl/ledger/entries/TicketEntry.h>
2
3
#include <xrpl/protocol/Indexes.h>
4
#include <xrpl/protocol/SeqProxy.h>
5
6
#include <gtest/gtest.h>
7
#include <ledger/EntryTestHelpers.h>
8
9
namespace
xrpl::test
{
10
11
TEST
(TicketEntryTests, constructors)
12
{
13
EntryTestEnv
e;
14
15
SeqProxy
const
ticketSeq =
SeqProxy::rawTicket
(2);
16
17
expectKeylet<TicketEntry>
(
18
e,
19
keylet::ticket
(e.
alice
.
id
(), ticketSeq),
20
"ticket(id, ticketSeq)"
,
21
e.
alice
.
id
(),
22
ticketSeq);
23
24
expectKeylet<TicketEntry>
(e,
keylet::ticket
(e.
someID
()),
"ticket(UInt256)"
, e.
someID
());
25
}
26
27
}
// namespace xrpl::test
xrpl::SeqProxy
A type that represents either a sequence value or a ticket value.
Definition
SeqProxy.h:37
xrpl::SeqProxy::rawTicket
static constexpr SeqProxy rawTicket(std::uint32_t v)
Factory function to return a ticket-based SeqProxy.
Definition
SeqProxy.h:74
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::jtx::Account::id
AccountID id() const
Returns the Account ID.
Definition
jtx/Account.h:104
xrpl::keylet::ticket
Keylet ticket(AccountID const &id, SeqProxy const &ticketSeq)
A ticket belonging to an account.
Definition
Indexes.cpp:332
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
Generated by
1.17.0