xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
tests
libxrpl
ledger
DelegateEntry.cpp
1
#include <xrpl/ledger/entries/DelegateEntry.h>
2
3
#include <xrpl/protocol/Indexes.h>
4
#include <xrpl/protocol/Keylet.h>
5
6
#include <gtest/gtest.h>
7
#include <ledger/EntryTestHelpers.h>
8
9
namespace
xrpl::test
{
10
11
TEST
(DelegateEntryTests, constructors)
12
{
13
EntryTestEnv
e;
14
15
expectKeylet<DelegateEntry>
(
16
e,
17
keylet::delegate
(e.
alice
.
id
(), e.
bob
.
id
()),
18
"delegate(account, authorizedAccount)"
,
19
e.
alice
.
id
(),
20
e.
bob
.
id
());
21
22
// Both arguments are AccountIDs, so the assertion above only has teeth
23
// if their order matters.
24
EXPECT_NE(
25
keylet::delegate
(e.
alice
.
id
(), e.
bob
.
id
()).key,
26
keylet::delegate
(e.
bob
.
id
(), e.
alice
.
id
()).key);
27
}
28
29
}
// 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::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::delegate
Keylet delegate(AccountID const &account, AccountID const &authorizedAccount) noexcept
A keylet for Delegate object.
Definition
Indexes.cpp:511
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