Skip to content

Commit

Permalink
re order test
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnxie999 committed Nov 8, 2023
1 parent 9617193 commit 99a031c
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions src/test/app/CFToken_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit 99a031c

Please sign in to comment.