xrpld
Loading...
Searching...
No Matches
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
11namespace xrpl::test {
12
13TEST(AMMEntryTests, constructors)
14{
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
Scaffolding shared by the per-entry-type suites.
UInt256 someID() const
An arbitrary but stable UInt256, for the entry constructors that take an object ID directly.
Converts to IOU Issue or STAmount.
Keylet amm(Asset const &issue1, Asset const &issue2) noexcept
AMM entry.
Definition Indexes.cpp:471
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.
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
Definition Issue.h:108