From 2adc234bf1b8db4e25fe31d8a1e178bae5c1f8fe Mon Sep 17 00:00:00 2001 From: Denis Angell Date: Mon, 25 Mar 2024 17:39:43 +0100 Subject: [PATCH] Update SetRemarks_test.cpp --- src/test/app/SetRemarks_test.cpp | 82 +++----------------------------- 1 file changed, 7 insertions(+), 75 deletions(-) diff --git a/src/test/app/SetRemarks_test.cpp b/src/test/app/SetRemarks_test.cpp index e6987d680..8e51d1474 100644 --- a/src/test/app/SetRemarks_test.cpp +++ b/src/test/app/SetRemarks_test.cpp @@ -17,46 +17,22 @@ */ //============================================================================== -#include #include -#include #include #include #include #include #include -#include - namespace ripple { namespace test { struct SetRemarks_test : public beast::unit_test::suite { - static bool - inOwnerDir( - ReadView const& view, - jtx::Account const& acct, - uint256 const& tid) - { - auto const uritSle = view.read({ltURI_TOKEN, tid}); - ripple::Dir const ownerDir(view, keylet::ownerDir(acct.id())); - return std::find(ownerDir.begin(), ownerDir.end(), uritSle) != - ownerDir.end(); - } - - static std::size_t - ownerDirCount(ReadView const& view, jtx::Account const& acct) - { - ripple::Dir const ownerDir(view, keylet::ownerDir(acct.id())); - return std::distance(ownerDir.begin(), ownerDir.end()); - }; - void testEnabled(FeatureBitset features) { testcase("enabled"); using namespace jtx; - using namespace std::literals::chrono_literals; // setup env auto const alice = Account("alice"); @@ -64,58 +40,14 @@ struct SetRemarks_test : public beast::unit_test::suite for (bool const withRemarks : {false, true}) { - std::cout << "RESULT" << "\n"; - // // If the URIToken amendment is not enabled, you should not be able - // // to mint, burn, buy, sell or clear uri tokens. - // auto const amend = - // withURIToken ? features : features - featureURIToken; - // Env env{*this, amend}; + std::cout << "With Remarks: " << withRemarks << "\n"; + // If the Remarks amendment is not enabled, you cannot add remarks + auto const amend = + withRemarks ? features : features - featureRemarks; + Env env{*this, amend}; - // env.fund(XRP(1000), alice, bob); - // env.close(); - - // std::string const uri(maxTokenURILength, '?'); - // std::string const id{strHex(uritoken::tokenid(alice, uri))}; - - // auto const txResult = - // withURIToken ? ter(tesSUCCESS) : ter(temDISABLED); - // auto const ownerDir = withURIToken ? 1 : 0; - - // // MINT - // env(uritoken::mint(alice, uri), txResult); - // env.close(); - // BEAST_EXPECT(ownerDirCount(*env.current(), alice) == ownerDir); - // BEAST_EXPECT(ownerDirCount(*env.current(), bob) == 0); - - // // SELL - // env(uritoken::sell(alice, id), uritoken::amt(XRP(10)), txResult); - // env.close(); - // BEAST_EXPECT(ownerDirCount(*env.current(), alice) == ownerDir); - // BEAST_EXPECT(ownerDirCount(*env.current(), bob) == 0); - - // // BUY - // env(uritoken::buy(bob, id), uritoken::amt(XRP(10)), txResult); - // env.close(); - // BEAST_EXPECT(ownerDirCount(*env.current(), alice) == 0); - // BEAST_EXPECT(ownerDirCount(*env.current(), bob) == ownerDir); - - // // SELL - // env(uritoken::sell(bob, id), uritoken::amt(XRP(10)), txResult); - // env.close(); - // BEAST_EXPECT(ownerDirCount(*env.current(), alice) == 0); - // BEAST_EXPECT(ownerDirCount(*env.current(), bob) == ownerDir); - - // // CLEAR - // env(uritoken::cancel(bob, id), txResult); - // env.close(); - // BEAST_EXPECT(ownerDirCount(*env.current(), alice) == 0); - // BEAST_EXPECT(ownerDirCount(*env.current(), bob) == ownerDir); - - // // BURN - // env(uritoken::burn(bob, id), txResult); - // env.close(); - // BEAST_EXPECT(ownerDirCount(*env.current(), alice) == 0); - // BEAST_EXPECT(ownerDirCount(*env.current(), bob) == 0); + env.fund(XRP(1000), alice, bob); + env.close(); } }