fix: Reject non-Vault ledger entries in getVault#1320
Merged
Merged
Conversation
getVault returned any ledger object at the given index, so a hash that resolves to (e.g.) a PermissionedDomain on devnet was surfaced as a Vault by the search bar and Vault page. Guard on LedgerEntryType === 'Vault' and add unit tests covering the new case plus the existing error branches.
Patel-Raj11
reviewed
Apr 28, 2026
| throw new Error(resp.error_message, 500) | ||
| } | ||
|
|
||
| if (resp.node?.LedgerEntryType !== 'Vault') { |
Contributor
There was a problem hiding this comment.
I think PR is not deployed on Dev environment. This give SAV page instead of 404 - https://devnet.dev.ripplex.io/vault/EF98FDBA404CBEB4F746DA1026B859E260BBB459D111268F6A26BBC7C4811A04
Collaborator
There was a problem hiding this comment.
Yea I think the deployment failed if you check github actions
Contributor
Author
There was a problem hiding this comment.
Yes, the deployment failed due to an unspecified reason. Please take another look, it should be working now. https://devnet.dev.ripplex.io/search/EF98FDBA404CBEB4F746DA1026B859E260BBB459D111268F6A26BBC7C4811A04
Patel-Raj11
previously approved these changes
Apr 28, 2026
Contributor
There was a problem hiding this comment.
Approved with 1 note: should we create a new issue to add in unit test coverage for the other functions in rippled.ts?
cybele-ripple
previously approved these changes
Apr 28, 2026
…L, getMPTIssuance, getLoanBroker. This commit also adds unit tests
fc33034
Patel-Raj11
approved these changes
Apr 30, 2026
pdp2121
approved these changes
May 4, 2026
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
The existing implementation of several
get<LedgerObject>methods in the Explorer do not validate the type of ledger-objects. This has led to cases where user specifies the hash of aPermissonedDomainobject however they are redirected to aVaultpage incorrectly.This bug was discovered with the input
EF98FDBA404CBEB4F746DA1026B859E260BBB459D111268F6A26BBC7C4811A04on the XRPL Devnet. This value points to aPermissionedDomain, however users are incorrectly directly to theVaultPage.Note: other rippled-related methods have not been updated in this PR because they have not exhibited a strong need for a strong response type-check. This also enables a nimble bug-fix PR.
Solution proposed in this PR:
LedgerEntryType === 'Vault'guard ingetVault. Any otherledger entry type now rejects with
Error('Not a Vault', 404).src/rippled/lib/test/rippled.test.tswith unit-test coveragefor
getVault's success path and every error branch.This PR is deployed in the dev environment of the Explorer: https://devnet.dev.ripplex.io/. Typing the above hash in the
SearchBarshould show a message akin to "No txn/nft/vault found for this hash"/Type of Change
Test Plan
A new unit test file has been introduced.