xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
tests
libxrpl
ledger
PayChannelEntry.cpp
1
#include <xrpl/ledger/entries/PayChannelEntry.h>
2
3
#include <xrpl/protocol/Indexes.h>
4
#include <xrpl/protocol/Keylet.h>
5
#include <xrpl/protocol/SeqProxy.h>
6
7
#include <gtest/gtest.h>
8
#include <ledger/EntryTestHelpers.h>
9
10
namespace
xrpl::test
{
11
12
TEST
(PayChannelEntryTests, constructors)
13
{
14
EntryTestEnv
e;
15
16
SeqProxy
const
seq =
SeqProxy::rawSequence
(4);
17
18
expectKeylet<PayChannelEntry>
(
19
e,
20
keylet::payChannel
(e.
alice
.
id
(), e.
bob
.
id
(), seq),
21
"payChannel(src, dst, seq)"
,
22
e.
alice
.
id
(),
23
e.
bob
.
id
(),
24
seq);
25
26
// Source and destination are both AccountIDs, so the assertion above
27
// only has teeth if their order matters.
28
EXPECT_NE(
29
keylet::payChannel
(e.
alice
.
id
(), e.
bob
.
id
(), seq).key,
30
keylet::payChannel
(e.
bob
.
id
(), e.
alice
.
id
(), seq).key);
31
}
32
33
}
// namespace xrpl::test
xrpl::SeqProxy
A type that represents either a sequence value or a ticket value.
Definition
SeqProxy.h:37
xrpl::SeqProxy::rawSequence
static constexpr SeqProxy rawSequence(std::uint32_t v)
Factory function to return a sequence-based SeqProxy.
Definition
SeqProxy.h:62
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::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::payChannel
Keylet payChannel(AccountID const &src, AccountID const &dst, SeqProxy const &seq) noexcept
A PaymentChannel.
Definition
Indexes.cpp:424
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