mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-04 17:27:00 +00:00
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.
42 lines
825 B
C++
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
|