Files
rippled/src/test/jtx/impl/owners.cpp
Bart 1eb0fdac65 refactor: Rename ripple namespace to xrpl (#5982)
This change renames all occurrences of `namespace ripple` and `ripple::` to `namespace xrpl` and `xrpl::`, respectively, as well as the names of test suites. It also provides a script to allow developers to replicate the changes in their local branch or fork to avoid conflicts.
2025-12-11 16:51:49 +00:00

42 lines
825 B
C++

#include <test/jtx/owners.h>
namespace xrpl {
namespace detail {
std::uint32_t
owned_count_of(ReadView const& view, AccountID const& id, LedgerEntryType type)
{
std::uint32_t count = 0;
forEachItem(
view, id, [&count, type](std::shared_ptr<SLE const> const& sle) {
if (sle->getType() == type)
++count;
});
return count;
}
void
owned_count_helper(
test::jtx::Env& env,
AccountID const& id,
LedgerEntryType type,
std::uint32_t value)
{
env.test.expect(owned_count_of(*env.current(), id, type) == value);
}
} // namespace detail
namespace test {
namespace jtx {
void
owners::operator()(Env& env) const
{
env.test.expect(env.le(account_)->getFieldU32(sfOwnerCount) == value_);
}
} // namespace jtx
} // namespace test
} // namespace xrpl