Skip to content

Amendment XLS-35: URIToken — Lightweight first-class NFTs #4456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Builds/CMake/RippledCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ target_sources (rippled PRIVATE
src/ripple/app/tx/impl/SignerEntries.cpp
src/ripple/app/tx/impl/Taker.cpp
src/ripple/app/tx/impl/Transactor.cpp
src/ripple/app/tx/impl/URIToken.cpp
src/ripple/app/tx/impl/apply.cpp
src/ripple/app/tx/impl/applySteps.cpp
src/ripple/app/tx/impl/details/NFTokenUtils.cpp
Expand Down Expand Up @@ -729,6 +730,7 @@ if (tests)
src/test/app/Transaction_ordering_test.cpp
src/test/app/TrustAndBalance_test.cpp
src/test/app/TxQ_test.cpp
src/test/app/URIToken_test.cpp
src/test/app/ValidatorKeys_test.cpp
src/test/app/ValidatorList_test.cpp
src/test/app/ValidatorSite_test.cpp
Expand Down
32 changes: 32 additions & 0 deletions src/ripple/app/tx/impl/DeleteAccount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,36 @@ removeNFTokenOfferFromLedger(
return tesSUCCESS;
}

/** Remove a generic object that only lives in the owner's directory */
TER
removeGeneric(
Application& app,
ApplyView& view,
AccountID const& account,
uint256 const& delIndex,
std::shared_ptr<SLE> const& sleDel,
beast::Journal)
{
if (!sleDel)
return tesSUCCESS;

if (!view.dirRemove(
keylet::ownerDir(account),
(*sleDel)[sfOwnerNode],
sleDel->key(),
false))
return tefBAD_LEDGER;

adjustOwnerCount(
view,
view.peek(keylet::account(account)),
-1,
beast::Journal{beast::Journal::getNullSink()});

view.erase(sleDel);
return tesSUCCESS;
}

// Return nullptr if the LedgerEntryType represents an obligation that can't
// be deleted. Otherwise return the pointer to the function that can delete
// the non-obligation
Expand All @@ -151,6 +181,8 @@ nonObligationDeleter(LedgerEntryType t)
return removeDepositPreauthFromLedger;
case ltNFTOKEN_OFFER:
return removeNFTokenOfferFromLedger;
case ltURI_TOKEN:
return removeGeneric;
default:
return nullptr;
}
Expand Down
1 change: 1 addition & 0 deletions src/ripple/app/tx/impl/InvariantCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ LedgerEntryTypesMatch::visitEntry(
case ltNEGATIVE_UNL:
case ltNFTOKEN_PAGE:
case ltNFTOKEN_OFFER:
case ltURI_TOKEN:
break;
default:
invalidTypeAdded_ = true;
Expand Down
Loading