Files
rippled/src/test/ledger/PayChannelEntry_test.cpp
Mayukha Vadari 46b72e693c fix clang-tidy findings in the entry test suites
- namespace xrpl { namespace test { -> namespace xrpl::test, matching the rest
  of src/test (modernize-concat-nested-namespaces).
- EntryTestEnv no longer holds its ApplyViewImpl in a std::optional. Funding
  moved to a private helper called from the member initializer list, so both
  members are initialized once and there is no unchecked optional access.
- [[nodiscard]] on read(), apply() and someID(); const on the writable entry in
  expectKeylet and on fromView in SLEBase_test.
- ApplyViewContext built with designated initializers.
- Prune the includes the generated suites carried but never used. Applied via
  run-clang-tidy -export-fixes with the repo hook's path canonicalisation, then
  fix_include_style.py; UintTypes.h regrouped by hand.
2026-08-13 12:45:34 -04:00

51 lines
1.2 KiB
C++

#include <test/jtx/Account.h>
#include <test/ledger/EntryTestHelpers.h>
#include <xrpl/beast/unit_test/suite.h>
#include <xrpl/ledger/helpers/PayChannelEntry.h>
#include <xrpl/protocol/Indexes.h>
#include <xrpl/protocol/Keylet.h>
#include <xrpl/protocol/SeqProxy.h>
namespace xrpl::test {
class PayChannelEntry_test : public beast::unit_test::Suite
{
void
testConstructors()
{
testcase("constructors");
using namespace jtx;
EntryTestEnv e(*this);
SeqProxy const seq = SeqProxy::rawSequence(4);
expectKeylet<PayChannelEntry>(
*this,
e,
keylet::payChannel(e.alice.id(), e.bob.id(), seq),
"payChannel(src, dst, seq)",
e.alice.id(),
e.bob.id(),
seq);
// Source and destination are both AccountIDs, so the assertion above
// only has teeth if their order matters.
BEAST_EXPECT(
keylet::payChannel(e.alice.id(), e.bob.id(), seq).key !=
keylet::payChannel(e.bob.id(), e.alice.id(), seq).key);
}
public:
void
run() override
{
testConstructors();
}
};
BEAST_DEFINE_TESTSUITE(PayChannelEntry, ledger, xrpl);
} // namespace xrpl::test