Repository navigation
Conversation
Mint a real NFToken and exercise the typed getters instead of probing nft_uri with a dummy ID. Fixes #58.
sappenin
requested review from
mvadari and
pwang200
and removed request for
mvadari
August 27, 2026 22:35
sappenin
marked this pull request as ready for review
August 27, 2026 22:35
Collaborator
|
/ai-reviewer --adopt |
|
Repository |
Three examples (nft_owner, atomic_swap1, freelancer_escrow) each hand-rolled the same unsafe Locator/tx_inner call to read Memos[0].MemoData. Add a first_memo_data() convenience on TransactionCommonFields that returns the TxPathBuilder pre-positioned at that path, and switch the examples to it. Update the xrpl-smart-escrows skill reference docs to match. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Solid refactor that replaces the dummy-NFT nft_uri probe with real typed NFToken field coverage minted by runTest.js, and cleans up several examples/docs to use the new first_memo_data() helper consistently. One correctness concern: the wasm-only URI value assertion slices uri.data with a fixed-length index that could panic (trap) if the underlying URI buffer is shorter than the expected 38-byte URI, rather than failing gracefully with the existing -632 error code.
TimothyBanks
approved these changes
Sep 21, 2026
Resolve e2e-tests/host_functions_test/runTest.js by keeping main's finishEscrow/expectResult harness helpers and passing the PR's NFT-id Memo through the options bag. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Compare the trailing-zero-trimmed slice against the full expected URI instead of indexing with a fixed 38-byte range, so a shorter buffer returns the -632 error code rather than trapping. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
High Level Overview of Change
Extend
e2e-tests/host_functions_testso it mints a real NFToken and traces every typedNFTokengetter (flags,transfer_fee,issuer,taxon,token_sequence,uri) instead of probingnft_uriwith a dummy all-zero ID.Fixes #58.
Context of Change
#58 asked for e2e coverage that proves the stdlib NFT field accessors work against a real host. A dedicated
trace_*crate would have duplicatedhost_functions_test; this PR folds that coverage into the existing probe and hasrunTest.jsmint a token with known flags, taxon, transfer fee, and URI, then pass the ID in an EscrowFinish memo (StandardBlob).Value assertions run only on wasm, because native coverage still uses empty host stubs.
Type of Change
Test Plan
cargo clippy --manifest-path e2e-tests/Cargo.toml -p host_functions_test --target wasm32v1-none -- -Dclippy::allcargo test --manifest-path e2e-tests/Cargo.toml -p host_functions_test --libcargo build --manifest-path e2e-tests/Cargo.toml -p host_functions_test --target wasm32v1-none --release./scripts/run-tests.sh e2e-tests/host_functions_test(needs a rippled node; localws://127.0.0.1:6006was not running when this was written)