Skip to content

Commit

Permalink
Use clio's include_deleted param in ledger_entry to fetch deleted MPT (
Browse files Browse the repository at this point in the history
…#1097)

## High Level Overview of Change

<!--
Please include a summary/list of the changes.
If too broad, please consider splitting into multiple PRs.
-->

### Context of Change
Before
<img width="1170" alt="image"
src="https://github.com/user-attachments/assets/3101cfdd-ef88-4ab0-8591-d6e18e8e9abd"
/>

after
<img width="1189" alt="image"
src="https://github.com/user-attachments/assets/faf4a733-8661-4841-a81f-5f2e52f544bc"
/>
`getMPTIssuance` fails to fetch the MPT because the MPT itself has been
deleted. Clio's ledger_entry API supports querying deleted object by
specifying `include_deleted` to be true
<!--
Please include the context of a change.
If a bug fix, when was the bug introduced? What was the behavior?
If a new feature, why was this architecture chosen? What were the
alternatives?
If a refactor, how is this better than the previous implementation?

If there is a design document for this feature, please link it here.
-->

### Type of Change

<!--
Please check relevant options, delete irrelevant ones.
-->

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Refactor (non-breaking change that only restructures code)
- [ ] Tests (You added tests for code that already exists, or your new
feature included in this PR)
- [ ] Documentation Updates
- [ ] Translation Updates
- [ ] Release

### TypeScript/Hooks Update

<!--
In an effort to modernize the codebase, you should convert the files
that you work with to React Hooks and TypeScript.
If this is not possible (e.g. it's too many changes, touching too many
files, etc.) please explain why here.
-->

- [ ] Updated files to React Hooks
- [ ] Updated files to TypeScript

## Before / After

<!--
If just refactoring / back-end changes, this can be just an in-English
description of the change at a technical level.
If a UI change, screenshots should be included.
-->

## Test Plan

<!--
Please describe the tests that you ran to verify your changes and
provide instructions so that others can reproduce.
-->

<!--
## Future Tasks
For future tasks related to PR.
-->
  • Loading branch information
shawnxie999 authored Dec 12, 2024
1 parent 1e89d53 commit 8cdbf05
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rippled/lib/rippled.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,11 @@ const getFeature = (rippledSocket, amendmentId) => {
}

const getMPTIssuance = (rippledSocket, tokenId) =>
query(rippledSocket, {
queryP2P(rippledSocket, {
command: 'ledger_entry',
mpt_issuance: tokenId,
ledger_index: 'validated',
include_deleted: true,
}).then((resp) => {
if (
resp.error === 'entryNotFound' ||
Expand Down

0 comments on commit 8cdbf05

Please sign in to comment.