From 99a031cdea16dccaad3acf0b693a92362cfaee33 Mon Sep 17 00:00:00 2001 From: Shawn Xie Date: Wed, 8 Nov 2023 11:02:22 -0500 Subject: [PATCH] re order test --- src/test/app/CFToken_test.cpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/test/app/CFToken_test.cpp b/src/test/app/CFToken_test.cpp index 898fb039835..8dfbd85f439 100644 --- a/src/test/app/CFToken_test.cpp +++ b/src/test/app/CFToken_test.cpp @@ -25,6 +25,25 @@ namespace ripple { class CFToken_test : public beast::unit_test::suite { + bool + cftEqualsAmount(test::jtx::Env const& env, + ripple::uint256 const cftIssuanceID, + test::jtx::Account const& holder, std::uint64_t expectedAmount){ + auto const sleCft = env.le(keylet::cftoken(cftIssuanceID, holder)); + std::uint64_t const amount = (*sleCft)[sfCFTAmount]; + return amount == expectedAmount; + } + + bool + cftIsAuthorized(test::jtx::Env const& env, + ripple::uint256 const cftIssuanceID, + test::jtx::Account const& holder) + { + auto const sleCft = env.le(keylet::cftoken(cftIssuanceID, holder)); + uint32_t const cftFlags = sleCft->getFlags(); + return cftFlags & lsfCFTAuthorized; + } + void testEnabled(FeatureBitset features) { @@ -313,15 +332,7 @@ class CFToken_test : public beast::unit_test::suite testBasicAuthorize(FeatureBitset features) { testcase("Basic authorize"); - - auto const cftIsAuthorized =[](test::jtx::Env const& env, - ripple::uint256 const cftIssuanceID, - test::jtx::Account const& holder) -> bool { - auto const sleCft = env.le(keylet::cftoken(cftIssuanceID, holder)); - uint32_t const cftFlags = sleCft->getFlags(); - return cftFlags & lsfCFTAuthorized; - }; - + using namespace test::jtx; // Basic authorization without allowlisting {