xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
tests
libxrpl
ledger
AMMEntry.cpp
1
#include <xrpl/ledger/entries/AMMEntry.h>
2
3
#include <xrpl/protocol/Asset.h>
4
#include <xrpl/protocol/Indexes.h>
5
#include <xrpl/protocol/Issue.h>
6
7
#include <gtest/gtest.h>
8
#include <helpers/IOU.h>
9
#include <ledger/EntryTestHelpers.h>
10
11
namespace
xrpl::test
{
12
13
TEST
(AMMEntryTests, constructors)
14
{
15
EntryTestEnv
e;
16
17
Asset
const
xrp{
xrpIssue
()};
18
Asset
const
usd{
IOU
(
"USD"
, e.
alice
).
issue
()};
19
20
expectKeylet<AMMEntry>
(e,
keylet::amm
(xrp, usd),
"amm(asset, asset)"
, xrp, usd);
21
22
expectKeylet<AMMEntry>
(e,
keylet::amm
(e.
someID
()),
"amm(UInt256)"
, e.
someID
());
23
}
24
25
}
// namespace xrpl::test
xrpl::Asset
Definition
Asset.h:52
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::IOU
Converts to IOU Issue or STAmount.
Definition
src/test/jtx/amount.h:404
xrpl::test::jtx::IOU::issue
Issue issue() const
Definition
src/test/jtx/amount.h:415
xrpl::keylet::amm
Keylet amm(Asset const &issue1, Asset const &issue2) noexcept
AMM entry.
Definition
Indexes.cpp:471
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::xrpIssue
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
Definition
Issue.h:108
Generated by
1.17.0