xrpld
Loading...
Searching...
No Matches
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
9namespace xrpl::test {
10
11TEST(DelegateEntryTests, constructors)
12{
14
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
Scaffolding shared by the per-entry-type suites.
AccountID id() const
Returns the Account ID.
Keylet delegate(AccountID const &account, AccountID const &authorizedAccount) noexcept
A keylet for Delegate object.
Definition Indexes.cpp:511
TEST(UnitsTest, types)
Definition Units.cpp:16
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.