Repository navigation
Conversation
There was a problem hiding this comment.
Clean, mechanical refactor that moves the per-page URI update logic from the free function nft::changeTokenURI into a new writable member NFTokenPageEntry::changeTokenURI. The extracted logic is copied verbatim (find NFT by ID, set/remove URI, call update(), return tecINTERNAL/tesSUCCESS), and the free function now just delegates to the member after locating the page. Includes were updated appropriately (Slice.h, TER.h) and the requires Base::kIsWritable constraint matches the existing pattern used by insertToken. No behavioral differences are apparent between the old and new code paths.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
0572b1b to
a2c8698
Compare
There was a problem hiding this comment.
Pure mechanical refactor moving the per-page URI-change logic from the free function nft::changeTokenURI into a new writable member NFTokenPageEntry::changeTokenURI. The moved logic (locate NFT via find_if on sfNFTokenID, set/clear sfURI, call update(), return tecINTERNAL/tesSUCCESS) is preserved verbatim, and the free function now just delegates to it after its own !page check. No behavioral differences are apparent; includes and forward declarations added (Slice.h, TER.h, base_uint.h) are consistent with the new signature. No issues found in the changed lines.
a2c8698 to
2b2f337
Compare
There was a problem hiding this comment.
Clean, mechanical refactor: the per-page URI logic is moved verbatim from the free function changeTokenURI in NFTokenHelpers.cpp onto the new NFTokenPageEntry::changeTokenURI method, with the free function now delegating to it. The find/set/remove/update logic is unchanged, and the method is correctly gated with requires Base::kIsWritable. No behavioral differences are introduced in the diff.
2b2f337 to
857541f
Compare
There was a problem hiding this comment.
Pure mechanical refactor moving the per-page URI update logic from the free function nft::changeTokenURI into a new writable member NFTokenPageEntry::changeTokenURI. The moved logic (find token by ID, set/remove sfURI, call update(), return tecINTERNAL if not found) is identical to the original free-function body, and the call site is updated to delegate correctly. No behavioral differences, resource leaks, or correctness issues spotted in the changed lines.
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
1 similar comment
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
857541f to
aa1b73c
Compare
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
There was a problem hiding this comment.
Clean, mechanical refactor that moves the per-page URI-change logic from the free function into NFTokenPageEntry::changeTokenURI, with the free function now delegating to it. The new member mirrors the previous logic exactly (find token, set/remove URI, update, return tec/tes), and no behavioral change is apparent.
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
nft::changeTokenURI() locates the page for the token, then finds the token in the page, sets or removes its URI, and updates the page. The second part only needs the page, so it becomes the writable member NFTokenPageEntry::changeTokenURI(id, uri). The free function keeps the page lookup and returns the member's result. No behavior change.
aa1b73c to
c9263e4
Compare
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
…arch/nftokenpage-changeTokenURI # Conflicts: # src/libxrpl/ledger/helpers/NFTokenHelpers.cpp
High Level Overview of Change
Adds the writable member
NFTokenPageEntry::changeTokenURI(uint256 const& id, std::optional<Slice> const& uri). It finds the token on this page, sets or removes its URI, and updates the page. It returnstecINTERNALif the page does not hold the token, as before.nft::changeTokenURI(view, owner, id, uri)stays a free function because it locates the page by key search across the owner's page range; it now returns the member's result. The body is inNFTokenPageEntry.cpp.Context of Change
Part of the Wrapped SLEs migration (design: step 2/3 of #7886). The per-page URI change now lives on the typed, writable page wrapper, so the compiler rejects it on a read-only view. Pure refactor: no amendment, no behavior change; any observable difference is a bug.
Stacked on #8410; review only the last commit.
This PR was fully written by AI (Claude Code) under human direction; the human author reviewed the diff.
API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)Test Plan
Compile-checked (
clang++ -fsyntax-only, project flags)NFTokenPageEntry.cpp,NFTokenHelpers.cpp, and every .cpp that includesNFTokenPageEntry.horNFTokenHelpers.h(14/14). clang-tidy (including the standalone header check) and pre-commit are clean. No new tests. CI runs the full unit test suite.🤖 Generated with Claude Code