Skip to content

Fix AccountRoot ledger object#3010

Merged
Patel-Raj11 merged 4 commits intomainfrom
fix-account-root-ledger-object
Jun 16, 2025
Merged

Fix AccountRoot ledger object#3010
Patel-Raj11 merged 4 commits intomainfrom
fix-account-root-ledger-object

Conversation

@Patel-Raj11
Copy link
Collaborator

High Level Overview of Change

Fixes #3007

Context of Change

  1. AccountRoot ledger object should have optional FirstNFTokenSequence field.
  2. Added integration test to assert it's presence once NFTokenMint is executed.

Type of Change

  • 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
  • Release

Did you update HISTORY.md?

  • Yes
  • No, this change does not impact library users

Test Plan

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 13, 2025

"""

Walkthrough

The changes update the AccountRoot interface to rename the FirstNFTSequence field to FirstNFTokenSequence and make it optional. Related test logic and documentation are updated to reflect this correction, ensuring accurate parsing and validation of the FirstNFTokenSequence field in the ledger object.

Changes

Files/Groups Change Summary
packages/xrpl/src/models/ledger/AccountRoot.ts Renamed FirstNFTSequence to FirstNFTokenSequence and made it optional in the AccountRoot interface.
packages/xrpl/test/integration/transactions/nftokenMint.test.ts Updated/added tests to validate FirstNFTokenSequence after NFT minting and imported related types.
packages/xrpl/HISTORY.md Added changelog entry documenting the fix for correct parsing of FirstNFTokenSequence.

Assessment against linked issues

Objective (Issue #) Addressed Explanation
Rename FirstNFTSequence to FirstNFTokenSequence in AccountRoot interface (#3007)

Suggested labels

bug

Suggested reviewers

  • ckeshava
  • achowdhry-ripple

Poem

In the ledger’s gentle nook,
A field’s name we undertook—
From NFT to NFToken, now it’s right,
The test confirms it in plain sight.
With every hop, the code grows neat,
A rabbit’s work is now complete! 🐇✨
"""

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: '@es-joy/jsdoccomment@0.36.1',
npm warn EBADENGINE required: { node: '^14 || ^16 || ^17 || ^18 || ^19' },
npm warn EBADENGINE current: { node: 'v24.2.0', npm: '11.3.0' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: 'eslint-plugin-jsdoc@39.9.1',
npm warn EBADENGINE required: { node: '^14 || ^16 || ^17 || ^18 || ^19' },
npm warn EBADENGINE current: { node: 'v24.2.0', npm: '11.3.0' }
npm warn EBADENGINE }
npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-13T20_43_26_242Z-debug-0.log


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e4ae894 and 9f4c3c7.

📒 Files selected for processing (1)
  • packages/xrpl/test/integration/transactions/nftokenMint.test.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/xrpl/test/integration/transactions/nftokenMint.test.ts
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: integration (20.x)
  • GitHub Check: integration (22.x)
  • GitHub Check: unit (20.x)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: browser (22.x)
  • GitHub Check: unit (22.x)
  • GitHub Check: build-and-lint (22.x)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Patel-Raj11 Patel-Raj11 changed the title Fix account root ledger object Fix AccountRoot ledger object Jun 13, 2025
@Patel-Raj11 Patel-Raj11 requested a review from khancode June 13, 2025 20:10
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
packages/xrpl/src/models/ledger/AccountRoot.ts (1)

75-77: Docstring wording can be tightened to match the new field name

The property name now includes “Token”, but the accompanying comment still reads a bit awkwardly (“The sequence that the account first minted an NFToken”). Consider re-phrasing for clarity:

-  /** The sequence that the account first minted an NFToken */
+  /** Sequence number of the first NFToken that this account minted. */
packages/xrpl/test/integration/transactions/nftokenMint.test.ts (1)

52-53: Minor readability nit – de-structure the Sequence directly

Purely stylistic, but de-structuring the value makes the intent clearer:

-      const mintTransactionSeq = response.result.tx_json.Sequence
+      const { Sequence: mintTransactionSeq } = response.result.tx_json
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee37e6c and e4ae894.

📒 Files selected for processing (3)
  • packages/xrpl/HISTORY.md (1 hunks)
  • packages/xrpl/src/models/ledger/AccountRoot.ts (1 hunks)
  • packages/xrpl/test/integration/transactions/nftokenMint.test.ts (3 hunks)
🔇 Additional comments (1)
packages/xrpl/HISTORY.md (1)

7-9: Changelog entry looks good – accurately captures the fix and follows the existing formatting.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/xrpl/test/integration/transactions/nftokenMint.test.ts (2)

52-53: Minor: use const { Sequence } = response.result.tx_json for brevity.

Purely cosmetic – feel free to ignore.


100-117: Edge-case: ledger state assertions assume a pristine wallet.

FirstNFTokenSequence === mintTransactionSeq and MintedNFTokens === 1 are only true when the wallet has never minted before.
If this helper is re-used with a wallet that already owns NFTokens the assertions will fail.

Consider loosening the expectations:

-assert.equal(accountData.MintedNFTokens, 1)
+assert.isAtLeast(accountData.MintedNFTokens, 1)

or generate / fund a fresh wallet inside the test to guarantee isolation (cheapest option on dev-nets).

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee37e6c and e4ae894.

📒 Files selected for processing (3)
  • packages/xrpl/HISTORY.md (1 hunks)
  • packages/xrpl/src/models/ledger/AccountRoot.ts (1 hunks)
  • packages/xrpl/test/integration/transactions/nftokenMint.test.ts (3 hunks)
🔇 Additional comments (3)
packages/xrpl/src/models/ledger/AccountRoot.ts (1)

73-78:

Details

✅ Verification successful

Verify that all call-sites were migrated from FirstNFTSequence to FirstNFTokenSequence.

The interface now exposes FirstNFTokenSequence?: number, but the old FirstNFTSequence identifier may still linger in helpers, parsers, or tests outside of this PR. A stale reference will silently compile (as any) or break at runtime when decoding ledger data.

If any matches are returned, rename them or update the type import.


🏁 Script executed:

#!/bin/bash
# Search the entire repo for the old identifier
rg --fixed-strings 'FirstNFTSequence' -n

Length of output: 16542


No lingering FirstNFTSequence references in code

A repository-wide search found FirstNFTSequence only in HISTORY.md and generated docs—not in any source files, helpers, parsers, or tests. All call-sites have been updated to use FirstNFTokenSequence.

packages/xrpl/HISTORY.md (1)

7-9: Changelog entry looks good – no action needed.

packages/xrpl/test/integration/transactions/nftokenMint.test.ts (1)

4-4: Nice catch adding a typed request object.

Importing AccountInfoRequest keeps the test strongly typed and future-proof.

@Patel-Raj11 Patel-Raj11 merged commit 27dc2b4 into main Jun 16, 2025
12 checks passed
@Patel-Raj11 Patel-Raj11 deleted the fix-account-root-ledger-object branch June 16, 2025 19:01
khancode pushed a commit that referenced this pull request Jun 21, 2025
* fix AccountRoot ledger object

* update HISTORY.md

* fix import and lint errors

* request a validated ledger
khancode added a commit that referenced this pull request Jul 3, 2025
* update HISTORY files

* enable SAV amendment

* add VaultCreate tx and update autofill

* build(deps-dev): bump karma from 6.4.3 to 6.4.4 (#2753)

* build(deps): bump @scure/bip39 from 1.5.4 to 1.6.0 (#3004)

* Fix AccountRoot ledger object (#3010)

* fix AccountRoot ledger object

* update HISTORY.md

* fix import and lint errors

* request a validated ledger

* build(deps-dev): bump react from 19.0.0 to 19.1.0 (#2968)

* upgrade ws dependency (#2940)

Co-authored-by: achowdhry-ripple <achowdhry@ripple.com>

* build(deps-dev): bump webpack from 5.98.0 to 5.99.9 (#3015)

Bumps [webpack](https://github.com/webpack/webpack) from 5.98.0 to 5.99.9.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](webpack/webpack@v5.98.0...v5.99.9)

---
updated-dependencies:
- dependency-name: webpack
  dependency-version: 5.99.9
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: achowdhry-ripple <achowdhry@ripple.com>
Co-authored-by: Omar Khan <khancodegt@gmail.com>

* add Vault ledger entry and base integ test

* add rippled serialized type Number. update models & tests to support it

* fix: add conditional check for `PermissionValue` definition (#3018)

* add conditional check for PermissionValue

* update HISTORY

* remove release date

* add unit test

* ripple-binary-codec 2.4.1 patch release (#3019)

* update HISTORY

* update package.json files

* update package-lock.json

* test: Separate faucet tests from local integration tests (#2985)

* refactor(tests): separate faucet tests from local integration tests

* feat: add Faucet test workflow and documentation

* fix: Add missing test:faucet script

* fix: execute tests one time

Co-authored-by: Raj Patel <rajp@ripple.com>

* fix: remove docker steps from faucet test workflow

* docs: update faucet tests section in CONTRIBUTING.md

* fix: remove comment from contributing.md

Co-authored-by: Raj Patel <rajp@ripple.com>

* fix: remove test:all from root package

Co-authored-by: Raj Patel <rajp@ripple.com>

* Update CONTRIBUTING.md

---------

Co-authored-by: Raj Patel <rajp@ripple.com>

* update number test

* debug

* set alias Number to SerializedNumber in coreTypes

* update fee in VaultCreate integ test

* up the fee

* up more

* debug fee

* update fee with comment

* add vault_info RPC with integ test

* remove unused var in test

* use vault_id

* update vaultInfo test

* add owner and seq params to vault_info request

* add DomainID to vault_info response

* add XRPLNumber type and VaultSet tx

* rename SerializedNumber to XRPLNumber

* add VaultSet to integ test

* refactor DEFAULT_VAULT_WITHDRAWAL_POLICY location

* fix import bug

* add VaultDeposit tx

* add VaultDeposit to integ test

* add VaultWithdraw tx

* add VaultWithdraw to integ test

* add VaultClawback tx

* add VaultClawback to integ test

* use 2 wallets for integ test

* comment out VaultClawback tx in integ test

* use IOU in integ test

* add ClawbackAmount type and VaultClawback to integ test

* add VaultDelete tx

* remove isBigInt

* add VaultDelete to integ test

* rename to STNumber

* comment out Amount in VaultClawback integ test

* Revert "comment out Amount in VaultClawback integ test"

This reverts commit 416c1e1.

* comment out WithdrawalPolicy in VaultCreate integ test

* refactor WithdrawalPolicy

* cleanup

* cleanup vars

* update HISTORY

* rename var to VAULT_DATA_MAX_BYTE_LENGTH

* use STNumber class in static function

* add VaultCreate to codec-fixtures

* refactor unit tests

* update HISTORY

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj Patel <rajp@ripple.com>
Co-authored-by: Chenna Keshava B S <21219765+ckeshava@users.noreply.github.com>
Co-authored-by: achowdhry-ripple <achowdhry@ripple.com>
Co-authored-by: Achal Jhawar <35405812+achaljhawar@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FirstNFTSequence -> FirstNFTokenSequence

3 participants