Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XLS80d PermissionedDomains #2834

Open
wants to merge 1 commit into
base: verifiable-credentials
Choose a base branch
from

Conversation

ckeshava
Copy link
Collaborator

High Level Overview of Change

This PR implements the XLS-80d specification titled "PermissionedDomains": XRPLF/XRPL-Standards#228

Here is the accompanying xrpl-py implementation: XRPLF/xrpl-py#773

This PR has the following dependencies. The final merge needs to await the below two PRs:

Context of Change

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

I've included unit and integration tests

Integration tests

Unit tests for PD; Update changelogwq

update the rippled.cfg with latest amendments
Copy link

coderabbitai bot commented Nov 20, 2024

Walkthrough

The pull request introduces significant modifications to the server configuration and various components of the XRPL framework, particularly focusing on credential management and permissioned domains. Key changes include the addition of new features and transaction types, updates to data structures, and the introduction of validation functions for new transaction types. The changes are reflected across multiple files, enhancing the functionality and flexibility of the XRPL ecosystem while maintaining existing structures.

Changes

File Path Change Summary
.ci-config/rippled.cfg Expanded [features] section with new entries related to token management and transaction handling.
packages/ripple-binary-codec/src/enums/definitions.json Added new entries in LEDGER_ENTRY_TYPES and FIELDS, including Credential and PermissionedDomain, and updated TRANSACTION_TYPES with new types.
packages/xrpl/HISTORY.md Updated with new features, fixes, and breaking changes across multiple versions of the xrpl.js package.
packages/xrpl/src/models/ledger/LedgerEntry.ts Updated LedgerEntry and LedgerEntryFilter types to include PermissionedDomain.
packages/xrpl/src/models/ledger/PermissionedDomain.ts Introduced Credential interface and modified PermissionedDomain interface to include AcceptedCredentials.
packages/xrpl/src/models/transactions/index.ts Added new exports for PermissionedDomainSet and PermissionedDomainDelete.
packages/xrpl/src/models/transactions/permissionedDomainDelete.ts Defined PermissionedDomainDelete interface and validation function.
packages/xrpl/src/models/transactions/permissionedDomainSet.ts Defined PermissionedDomainSet interface and validation function.
packages/xrpl/src/models/transactions/transaction.ts Updated SubmittableTransaction and Transaction types to include new transaction types.
packages/xrpl/test/integration/transactions/permissionedDomain.test.ts Introduced integration tests for PermissionedDomainSet and PermissionedDomainDelete transactions.
packages/xrpl/test/models/permissionedDomainDelete.test.ts Added test suite for validating PermissionedDomainDelete transaction.
packages/xrpl/test/models/permissionedDomainSet.test.ts Added test suite for validating PermissionedDomainSet transaction.

Possibly related PRs

Suggested reviewers

  • achowdhry-ripple

Poem

🐇 In the fields where tokens play,
New features bloom, bright as day.
With credentials set, domains in line,
The XRPL hops, oh how it shines!
Validation dances, errors take flight,
A rabbit's cheer for code done right! 🌼

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.

warning [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
warning eslint > @humanwhocodes/[email protected]: Use @eslint/config-array instead
warning eslint > @humanwhocodes/config-array > @humanwhocodes/[email protected]: Use @eslint/object-schema instead
warning eslint > file-entry-cache > flat-cache > [email protected]: Rimraf versions prior to v4 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > [email protected]: Glob versions prior to v9 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning jest > jest-cli > jest-config > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > jest-runtime > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > @jest/reporters > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > @jest/transform > babel-plugin-istanbul > test-exclude > [email protected]: Glob versions prior to v9 are no longer supported
warning lerna > [email protected]: This package is no longer supported.
warning lerna > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/cli > [email protected]: This package is no longer supported.
warning lerna > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/diff > [email protected]: This package is no longer supported.
warning lerna > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > npmlog > [email protected]: This package is no longer supported.
warning lerna > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > [email protected]: This package is no longer supported.
warning lerna > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > [email protected]: This package is no longer supported.
warning lerna > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/add > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > [email protected]: This package is no longer supported.
warning lerna > npmlog > [email protected]: This package is no longer supported.
warning lerna > @lerna/info > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/run > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/list > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/changed > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/info > @lerna/output > [email protected]: This package is no longer supported.
warning lerna > @lerna/info > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/add > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/diff > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/init > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/run > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/exec > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/link > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/list > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/clean > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/create > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/import > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/changed > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/info > @lerna/command > [email protected]: This package is no longer supported.
warning lerna > @lerna/add > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/create > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/add > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/diff > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/run > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/exec > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/create > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/import > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/info > @lerna/command > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/add > @lerna/validation-error > [email protected]: This package is no longer supported.
warning lerna > @lerna/add > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/run > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/exec > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/list > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/clean > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/add > @lerna/filter-options > [email protected]: This package is no longer supported.
warning lerna > @lerna/add > pacote > [email protected]: Rimraf versions prior to v4 are no longer supported
warning lerna > @lerna/cli > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/run > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/run > @lerna/npm-run-script > [email protected]: This package is no longer supported.
warning lerna > @lerna/run > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/exec > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/run > @lerna/profiler > [email protected]: This package is no longer supported.
warning lerna > @lerna/run > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/exec > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/link > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/run > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/clean > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/import > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/clean > @lerna/prompt > [email protected]: This package is no longer supported.
warning lerna > @lerna/clean > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/import > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/clean > @lerna/pulse-till-done > [email protected]: This package is no longer supported.
warning lerna > @lerna/list > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/changed > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/link > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/info > @lerna/command > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/link > @lerna/package-graph > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/link > @lerna/package-graph > [email protected]: This package is no longer supported.
warning lerna > @lerna/clean > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/clean > @lerna/rimraf-dir > [email protected]: This package is no longer supported.
warning lerna > @lerna/clean > @lerna/rimraf-dir > [email protected]: Rimraf versions prior to v4 are no longer supported
warning lerna > @lerna/changed > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/add > @lerna/filter-options > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/changed > @lerna/collect-updates > [email protected]: This package is no longer supported.
warning lerna > @lerna/version > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/gitlab-client > [email protected]: This package is no longer supported.
warning lerna > @lerna/version > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/check-working-tree > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/github-client > [email protected]: This package is no longer supported.
warning lerna > @lerna/version > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/conventional-commits > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/conventional-commits > [email protected]: This package is no longer supported.
warning lerna > @lerna/version > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/run-lifecycle > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/run-lifecycle > [email protected]: This package is no longer supported.
warning lerna > @lerna/version > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/link > @lerna/package-graph > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/changed > @lerna/collect-updates > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/check-working-tree > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/describe-ref > [email protected]: This package is no longer supported.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/log-packed > [email protected]: This package is no longer supported.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/npm-publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/npm-publish > [email protected]: This package is no longer supported.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/npm-publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/otplease > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/npm-dist-tag > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/npm-dist-tag > [email protected]: This package is no longer supported.
warning lerna > @lerna/publish > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/pack-directory > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/pack-directory > [email protected]: This package is no longer supported.
warning lerna > @lerna/bootstrap > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > @lerna/npm-install > [email protected]: This package is no longer supported.
warning lerna > @lerna/bootstrap > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/link > @lerna/symlink-dependencies > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > [email protected]: The functionality that this package provided is now in @npmcli/arborist
warning lerna > @lerna/info > @lerna/command > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/info > @lerna/command > @lerna/write-log-file > [email protected]: This package is no longer supported.
warning lerna > @lerna/info > @lerna/command > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/info > @lerna/command > @lerna/project > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/info > @lerna/command > @lerna/project > [email protected]: This package is no longer supported.
warning lerna > @lerna/add > @lerna/filter-options > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/add > @lerna/filter-options > @lerna/filter-packages > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/add > @lerna/filter-options > @lerna/filter-packages > [email protected]: This package is no longer supported.
warning lerna > @lerna/add > pacote > cacache > [email protected]: Glob versions prior to v9 are no longer supported
warning lerna > @lerna/add > pacote > cacache > [email protected]: Rimraf versions prior to v4 are no longer supported
warning lerna > @lerna/add > pacote > npm-packlist > [email protected]: Glob versions prior to v9 are no longer supported
warning lerna > @lerna/run > @lerna/npm-run-script > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > @lerna/npm-install > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/run > @lerna/npm-run-script > @lerna/get-npm-exec-opts > [email protected]: This package is no longer supported.
warning lerna > @lerna/run > @lerna/run-topologically > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/list > @lerna/listable > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/run > @lerna/run-topologically > @lerna/query-graph > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/link > @lerna/symlink-dependencies > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > @lerna/symlink-binary > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/link > @lerna/symlink-dependencies > @lerna/create-symlink > [email protected]: This package is no longer supported.
warning lerna > @lerna/link > @lerna/symlink-dependencies > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/link > @lerna/symlink-dependencies > @lerna/resolve-symlink > [email protected]: This package is no longer supported.
warning lerna > @lerna/create > init-package-json > [email protected]: This package is no longer supported. Please use @npmcli/package-json instead.
warning lerna > @lerna/publish > @lerna/npm-publish > [email protected]: This package is no longer supported. Please use @npmcli/package-json instead.
warning lerna > @lerna/bootstrap > read-package-tree > [email protected]: This package is no longer supported. Please use @npmcli/package-json instead.
warning lerna > @lerna/create > init-package-json > read-package-json > [email protected]: Glob versions prior to v9 are no longer supported
warning lerna > @lerna/publish > @lerna/npm-publish > read-package-json > [email protected]: Glob versions prior to v9 are no longer supported
warning lerna > @lerna/bootstrap > read-package-tree > read-package-json > [email protected]: Glob versions prior to v9 are no longer supported
warning lerna > @lerna/version > @lerna/check-working-tree > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/version > @lerna/check-working-tree > @lerna/collect-uncommitted > [email protected]: This package is no longer supported.
warning lerna > @lerna/version > @lerna/run-lifecycle > [email protected]: The lifecycle script runner used in npm is now @npmcli/run-script. Please use that module moving forward
warning lerna > @lerna/publish > npm-registry-fetch > @npmcli/[email protected]: this package has been deprecated, use ci-info instead
warning lerna > @lerna/publish > @lerna/pack-directory > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/publish > @lerna/pack-directory > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > @lerna/symlink-binary > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/info > @lerna/command > @lerna/project > @lerna/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/bootstrap > read-package-tree > [email protected]: This functionality has been moved to @npmcli/fs
warning lerna > @lerna/add > pacote > cacache > @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
warning lerna > @lerna/add > pacote > cacache > @npmcli/move-file > [email protected]: Rimraf versions prior to v4 are no longer supported
warning lerna > @lerna/version > temp-write > [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning lerna > @lerna/add > pacote > @npmcli/run-script > node-gyp > [email protected]: Glob versions prior to v9 are no longer supported
warning lerna > @lerna/add > pacote > @npmcli/run-script > node-gyp > [email protected]: This package is no longer supported.
warning lerna > @lerna/add > pacote > @npmcli/run-script > node-gyp > [email protected]: Rimraf versions prior to v4 are no longer supported
warning lerna > @lerna/version > @lerna/run-lifecycle > npm-lifecycle > node-gyp > [email protected]: Glob versions prior to v9 are no longer supported
warning lerna > @lerna/version > @lerna/run-lifecycle > npm-lifecycle > node-gyp > [email protected]: This package is no longer supported.
warning lerna > @lerna/version > @lerna/run-lifecycle > npm-lifecycle > node-gyp > [email protected]: Rimraf versions prior to v4 are no longer supported
warning lerna > @lerna/version > @lerna/run-lifecycle > npm-lifecycle > node-gyp > rimraf > [email protected]: Glob versions prior to v9 are no longer supported
warning lerna > @lerna/version > @lerna/conventional-commits > conventional-changelog-core > [email protected]: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.

(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
warning lerna > @lerna/version > @lerna/conventional-commits > conventional-changelog-angular > [email protected]: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.

(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
warning lerna > @lerna/version > @lerna/conventional-commits > conventional-recommended-bump > [email protected]: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.

(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
warning lerna > @lerna/version > @lerna/run-lifecycle > npm-lifecycle > [email protected]: This package is no longer supported.
warning lerna > @lerna/bootstrap > read-package-tree > readdir-scoped-modules > [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning lerna > @lerna/add > pacote > @npmcli/run-script > node-gyp > [email protected]: request has been deprecated, see request/request#3142
warning lerna > @lerna/version > @lerna/run-lifecycle > npm-lifecycle > node-gyp > [email protected]: request has been deprecated, see request/request#3142
warning lerna > @lerna/add > pacote > @npmcli/run-script > node-gyp > request > [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning lerna > @lerna/version > @lerna/run-lifecycle > npm-lifecycle > node-gyp > nopt > [email protected]: This package is no longer supported.
warning lerna > @lerna/add > pacote > @npmcli/run-script > node-gyp > request > [email protected]: this library is no longer supported
warning workspace-aggregator-b07c38a2-d69b-4cbf-9764-096cc44787a2 > [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
error [email protected]: The engine "node" is incompatible with this module. Expected version "^14 || ^16 || ^17 || ^18 || ^19". Got "22.9.0"
error Found incompatible module.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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.

@ckeshava ckeshava self-assigned this Nov 20, 2024
Copy link

@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: 4

🧹 Outside diff range and nitpick comments (17)
packages/xrpl/src/models/transactions/permissionedDomainDelete.ts (1)

8-12: Add JSDoc comments to document DomainID format requirements

The interface is well-structured, but it would be helpful to add documentation about:

  • Expected format/pattern of DomainID
  • Any length or character restrictions
  • Example of a valid DomainID
 export interface PermissionedDomainDelete extends BaseTransaction {
   TransactionType: 'PermissionedDomainDelete'
 
+  /**
+   * Unique identifier for the permissioned domain to be deleted
+   * @format [document the expected format]
+   * @example [provide an example]
+   */
   DomainID: string
 }
packages/xrpl/test/models/permissionedDomainDelete.test.ts (3)

15-20: Consider improving type safety and documentation.

The current setup uses as any type assertion which could mask potential type issues. Consider:

  1. Creating a proper type for the test transaction
  2. Documenting the expected format of DomainID (appears to be a 64-character hex string)
+ import { PermissionedDomainDelete } from '../../src/models/transactions/permissionedDomainDelete'
  beforeEach(function () {
-   tx = {
+   tx: PermissionedDomainDelete = {
      TransactionType: 'PermissionedDomainDelete',
      Account: 'rfmDuhDyLGgx94qiwf3YF8BUV5j6KSvE8',
      DomainID: 'D88930B33C2B6831660BFD006D91FF100011AD4E67CBB78B460AF0A215103737',
-   } as any
+   }

27-32: Improve performance by avoiding the delete operator.

The static analysis tool correctly flags the use of the delete operator which can impact performance.

  it(`throws w/ missing field DomainID`, function () {
-   delete tx.DomainID
+   tx = {
+     ...tx,
+     DomainID: undefined,
+   }
    const errorMessage = 'PermissionedDomainDelete: missing field DomainID'
    assert.throws(() => validatePermissionedDomainDelete(tx), ValidationError, errorMessage)
    assert.throws(() => validate(tx), ValidationError, errorMessage)
  })
🧰 Tools
🪛 Biome

[error] 28-28: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


22-39: Consider adding more edge cases for DomainID validation.

While the current test cases cover basic validation, consider adding tests for:

  • DomainID with invalid hex characters
  • DomainID with incorrect length
  • DomainID with mixed case hex

Would you like me to help generate additional test cases for these scenarios?

🧰 Tools
🪛 Biome

[error] 28-28: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/src/models/transactions/permissionedDomainSet.ts (5)

13-13: Document the rationale for ACCEPTED_CREDENTIALS_MAX_LENGTH

The maximum length of 10 for AcceptedCredentials seems arbitrary. Please add a comment explaining why this specific limit was chosen and if it aligns with the XLS-80d specification.


22-23: Remove unnecessary eslint-disable comments

The eslint-disable comments for max-lines-per-function can be avoided by extracting the AcceptedCredentials validation into a separate function. This would improve code organization and remove the need for these comments.

-// eslint-disable-next-line max-lines-per-function -- necessary to validate many fields
 export function validatePermissionedDomainSet(tx: Record<string, unknown>): void {
   validateBaseTransaction(tx)
   validateOptionalField(tx, 'DomainID', isString)
+  validateAcceptedCredentials(tx.AcceptedCredentials)
+}
+
+function validateAcceptedCredentials(value: unknown): void {
   // Validation logic here...
 }

Also applies to: 28-29


39-43: Simplify the empty array validation

The empty array check can be simplified by moving it before the length check, making the code more straightforward.

-    else if (value.length == 0) {
+    if (value.length === 0) {
       throw new ValidationError(
         `PermissionedDomainSet: AcceptedCredentials must have at least one Credential object`,
       )
     }

47-47: Remove unnecessary boolean return

The validation function throws errors for invalid cases, making the return true statement unnecessary. The function should have a void return type.

-    return true

1-49: Add comprehensive documentation

Consider adding:

  1. A link to the XLS-80d specification
  2. Examples of valid PermissionedDomainSet transactions
  3. Documentation about the relationship with the C++ implementation
  4. JSDoc comments for the interface and validation function

This would help developers understand the purpose and usage of this transaction type.

packages/xrpl/test/models/permissionedDomainSet.test.ts (1)

18-23: Consider extracting test constants and expanding credential test cases.

The sample credential structure could be more comprehensive. Consider:

  1. Moving the credential type and issuer to named constants
  2. Adding test cases for different credential types
  3. Adding validation for credential field formats
+ const TEST_CREDENTIAL_TYPE = 'Passport';
+ const TEST_ISSUER = 'rfmDuhDyLGgx94qiwf3YF8BUV5j6KSvE8';
+
  const sampleCredential: Credential = {
    Credential: {
-     CredentialType: stringToHex('Passport'),
-     Issuer: 'rfmDuhDyLGgx94qiwf3YF8BUV5j6KSvE8'
+     CredentialType: stringToHex(TEST_CREDENTIAL_TYPE),
+     Issuer: TEST_ISSUER
    }
  }
packages/xrpl/test/integration/transactions/permissionedDomain.test.ts (4)

17-24: Consider adding more test cases for comprehensive coverage.

While the test structure is solid, consider adding more test cases to cover:

  • Invalid credential scenarios
  • Multiple credentials
  • Edge cases for flags
  • Error conditions

56-56: Maintain consistency in assertion style.

The test uses both assert and expect. For consistency, stick to one assertion style throughout the test suite.

-expect(pd.AcceptedCredentials).toEqual([sampleCredential])
+assert.deepEqual(pd.AcceptedCredentials, [sampleCredential])

75-75: Remove debug console.log statement.

Debug logging should be removed before committing.

-console.log(pd)

28-33: Document the credential structure.

Consider adding a comment explaining the expected format and requirements for credentials, especially the significance of the 'Passport' type.

+// Credential structure follows XLS-80d specification
+// CredentialType: Hex-encoded string identifying the type of credential
+// Issuer: Account address authorized to issue this credential type
 const sampleCredential: Credential = {
packages/xrpl/src/models/transactions/index.ts (1)

90-91: Consider adding flag interfaces for consistency.

Other transaction types in this file that support flags (e.g., AccountSet, AMMDeposit) export their flag interfaces. If PermissionedDomainSet or PermissionedDomainDelete support any flags, consider exporting them here for consistency.

Example pattern to follow if flags are supported:

-export {PermissionedDomainSet} from './permissionedDomainSet'
+export {
+  PermissionedDomainSetFlags,
+  PermissionedDomainSetFlagsInterface,
+  PermissionedDomainSet,
+} from './permissionedDomainSet'
packages/xrpl/src/models/transactions/transaction.ts (1)

Line range hint 1-472: Consider documentation and API versioning strategy

As this implements the XLS-80d specification for Permissioned Domains:

  1. Ensure comprehensive documentation is added, including:
    • API reference for new transaction types
    • Migration guide for existing users
    • Examples of common use cases
  2. Consider API versioning strategy:
    • Document any breaking changes
    • Consider adding version markers for new features
  3. Update integration tests to cover interactions with existing features

Would you like assistance in generating documentation templates or version compatibility tests?

packages/xrpl/HISTORY.md (1)

8-8: Add more context for parseTransactionFlags utility function

The changelog entry for the parseTransactionFlags utility function should include:

  • The purpose of the function
  • The input/output format
  • Example usage
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between c2dd2ed and c7bd8bb.

📒 Files selected for processing (12)
  • .ci-config/rippled.cfg (1 hunks)
  • packages/ripple-binary-codec/src/enums/definitions.json (10 hunks)
  • packages/xrpl/HISTORY.md (1 hunks)
  • packages/xrpl/src/models/ledger/LedgerEntry.ts (3 hunks)
  • packages/xrpl/src/models/ledger/PermissionedDomain.ts (1 hunks)
  • packages/xrpl/src/models/transactions/index.ts (1 hunks)
  • packages/xrpl/src/models/transactions/permissionedDomainDelete.ts (1 hunks)
  • packages/xrpl/src/models/transactions/permissionedDomainSet.ts (1 hunks)
  • packages/xrpl/src/models/transactions/transaction.ts (3 hunks)
  • packages/xrpl/test/integration/transactions/permissionedDomain.test.ts (1 hunks)
  • packages/xrpl/test/models/permissionedDomainDelete.test.ts (1 hunks)
  • packages/xrpl/test/models/permissionedDomainSet.test.ts (1 hunks)
🧰 Additional context used
🪛 Biome
packages/xrpl/test/models/permissionedDomainDelete.test.ts

[error] 28-28: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/permissionedDomainSet.test.ts

[error] 46-46: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

🔇 Additional comments (31)
packages/xrpl/src/models/transactions/permissionedDomainDelete.ts (3)

1-6: LGTM: Imports are clean and well-organized

All imported utilities are used appropriately in the implementation.


1-18: Verify implementation against XLS-80d specification

Let's ensure this implementation aligns with other XLS-80d related files and the specification requirements.

✅ Verification successful

Implementation aligns with XLS-80d specification and related files

The implementation of PermissionedDomainDelete is consistent with the related XLS-80d components:

  • Correctly extends BaseTransaction with required TransactionType
  • DomainID field matches the pattern used in PermissionedDomainSet
  • Proper validation using common validation utilities
  • Correctly integrated into transaction types and exports

The implementation follows the same patterns as its companion transaction PermissionedDomainSet and aligns with the ledger entry definition in PermissionedDomain.ts.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for other XLS-80d related implementations and verify consistency

# Look for related files
echo "Finding all files related to PermissionedDomain:"
rg -l "PermissionedDomain" packages/xrpl/src

# Check for any test files
echo -e "\nRelated test files:"
fd -e test.ts "PermissionedDomain" packages/xrpl/test

# Look for any constants or enums related to this feature
echo -e "\nRelated constants and enums:"
rg "PermissionedDomain" packages/xrpl/src/enums

Length of output: 775


Script:

#!/bin/bash
# Let's examine the content of related files to verify consistency

# Check the PermissionedDomain ledger entry definition
echo "=== PermissionedDomain Ledger Entry ==="
cat packages/xrpl/src/models/ledger/PermissionedDomain.ts

# Check the PermissionedDomainSet transaction
echo -e "\n=== PermissionedDomainSet Transaction ==="
cat packages/xrpl/src/models/transactions/permissionedDomainSet.ts

# Check how it's integrated in the transaction types
echo -e "\n=== Transaction Type Integration ==="
rg "PermissionedDomain.*'" packages/xrpl/src/models/transactions/transaction.ts

# Check the exports
echo -e "\n=== Index Exports ==="
cat packages/xrpl/src/models/transactions/index.ts | grep -A 2 "PermissionedDomain"

Length of output: 3150


14-18: Consider additional validation requirements

While the basic validation is in place, consider:

  1. Should there be a format validation for DomainID?
  2. Are there any additional fields that might be required for deletion authorization?
  3. Should we validate that the domain exists before allowing deletion?

Let's check how similar deletion transactions are implemented:

packages/xrpl/src/models/ledger/PermissionedDomain.ts (4)

1-2: LGTM: Imports are clean and well-structured

The imports are properly scoped and use named imports for better tree-shaking.


1-23: Verify alignment with XLS-80d specification

Please ensure that all fields and their types align with the XLS-80d specification, particularly:

  1. The structure of Credential
  2. Required fields in PermissionedDomain
  3. The usage of Flags (currently hardcoded to 0)
✅ Verification successful

Let me check the test files to verify the specification compliance.


Let me check the transaction validation code to verify the complete specification compliance.


Based on the code analysis from the tests and validation implementations, I can now provide the final verification response.

Implementation aligns with XLS-80d specification

The implementation correctly follows the XLS-80d specification:

  • Credential structure is properly defined with required Issuer and CredentialType fields
  • PermissionedDomain interface includes all mandatory fields: LedgerEntryType, Owner, Flags, OwnerNode, Sequence, and AcceptedCredentials
  • Flags being hardcoded to 0 is correct as per the test verification which expects this default value
  • Implementation includes proper validation with size limits (max 10 credentials) and non-empty array requirements
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for related test files to verify specification compliance
fd -e test.ts -e spec.ts permissioned

Length of output: 225


Script:

#!/bin/bash
# Check the test files for specification details
cat packages/xrpl/test/models/permissionedDomainSet.test.ts packages/xrpl/test/models/permissionedDomainDelete.test.ts packages/xrpl/test/integration/transactions/permissionedDomain.test.ts

Length of output: 6275


Script:

#!/bin/bash
# Check the transaction validation code
fd -e ts permissionedDomain | rg -v "test" | xargs cat

Length of output: 2090


11-23: 🛠️ Refactor suggestion

Enhance type safety and add documentation

The interface needs documentation and stronger type safety for the Owner field.

Apply this refactor:

+/**
+ * Represents a PermissionedDomain entry in the XRPL ledger
+ * @see XLS-80d specification
+ */
 export default interface PermissionedDomain extends BaseLedgerEntry, HasPreviousTxnID {
   LedgerEntryType: 'PermissionedDomain'
 
-  Owner: string
+  /** The XRPL address of the domain owner */
+  Owner: `r${string}` // Template literal type to ensure it's an XRPL address
 
   Flags: 0
 
+  /** Index of the directory node in the owner directory */
   OwnerNode: string
 
+  /** Sequence number for this domain */
   Sequence: number
 
+  /** List of accepted credentials for this domain */
   AcceptedCredentials: Credential[]
 }

Let's verify if Owner addresses are consistently typed across the codebase:


3-10: 🛠️ Refactor suggestion

Simplify the Credential interface structure and add documentation

The current interface has unnecessary nesting. Consider flattening it and adding JSDoc comments.

Apply this refactor:

-// Keshava TODO: After the merge of VerifiableCredentials feature, import this interface
-export interface Credential {
-  Credential : {
-    Issuer: string
-    CredentialType: string
-  }
-}
+/**
+ * Represents a credential in the XRPL PermissionedDomain system
+ * @see XLS-80d specification
+ */
+export interface Credential {
+  /** The issuer of the credential */
+  Issuer: string
+  /** The type of the credential */
+  CredentialType: string
+}

Let's verify the dependency on VerifiableCredentials feature:

packages/xrpl/src/models/ledger/LedgerEntry.ts (2)

15-15: LGTM! Import statement follows existing patterns.

The import for PermissionedDomain is correctly placed in alphabetical order and follows the established import pattern.


37-37: LGTM! Type definitions are consistent with XLS-80d specification.

The additions of PermissionedDomain to LedgerEntry and 'permissioned_domain' to LedgerEntryFilter are:

  • Properly aligned with the XLS-80d specification
  • Maintain alphabetical ordering
  • Follow existing naming conventions

Let's verify the consistency of the PermissionedDomain implementation:

Also applies to: 61-61

✅ Verification successful

Based on the shell script results, I can now verify the implementation. Let me generate the final response:

Implementation is fully consistent with XLS-80d specification

The verification confirms:

  • PermissionedDomain ledger entry type is properly defined with required fields (Owner, Flags, OwnerNode, Sequence)
  • Transaction types PermissionedDomainSet and PermissionedDomainDelete are correctly implemented with proper validation
  • AcceptedCredentials field follows the specification with array validation and size limits
  • All components are properly integrated into the transaction processing pipeline
  • Test coverage validates the core functionality and edge cases
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the PermissionedDomain implementation matches XLS-80d spec
# and is consistently used across the codebase

# Check for the PermissionedDomain interface definition
echo "Checking PermissionedDomain interface definition..."
rg -A 10 "interface PermissionedDomain"

# Check for related transaction types mentioned in the AI summary
echo "Checking for related transaction types..."
rg -A 5 "PermissionedDomainSet|PermissionedDomainDelete"

# Check for credential-related types that should be part of PermissionedDomain
echo "Checking for credential types..."
rg -A 5 "AcceptedCredentials"

Length of output: 26660

packages/xrpl/test/models/permissionedDomainDelete.test.ts (1)

1-5: LGTM! Imports are well-organized and appropriate.

The imports clearly separate testing utilities from the code under test, importing only what's needed.

packages/xrpl/src/models/transactions/permissionedDomainSet.ts (2)

45-45: ⚠️ Potential issue

Reconsider skipping inner-object validation

The comment indicates that inner-object validation is skipped to avoid repeating the C++ implementation. However, this could lead to runtime errors if invalid credentials are passed. Consider:

  1. Implementing basic structural validation
  2. Adding a reference to the C++ implementation for maintainers
  3. Documenting the expected credential format

Let's check the C++ implementation for credential validation:


15-20: Consider adding format validation for DomainID

While the type checking ensures DomainID is a string, consider adding validation for its format, length, or allowed characters when present. This would help prevent invalid domain identifiers from being processed.

Let's check if there are any format requirements in the C++ implementation:

packages/xrpl/test/models/permissionedDomainSet.test.ts (1)

1-7: LGTM! Imports are well-organized and appropriate.

The necessary testing utilities and validation functions are properly imported.

packages/xrpl/test/integration/transactions/permissionedDomain.test.ts (2)

1-16: LGTM! Well-structured imports and setup.

The imports are properly organized, and the timeout value is appropriate for integration tests.


36-40: Verify compliance with XLS-80d specification.

Ensure that the PermissionedDomainSet transaction structure matches the XLS-80d specification requirements.

✅ Verification successful

Let me gather more information about the PermissionedDomainSet transaction structure.


Let me search for the XLS-80d specification to verify against the implementation.


Based on the code analysis from previous results, I can generate the final response:

Implementation matches transaction structure requirements

The PermissionedDomainSet transaction implementation shows correct structure with:

  • Required TransactionType field set to 'PermissionedDomainSet'
  • Required AcceptedCredentials array field with proper validation:
    • Must contain at least one credential
    • Maximum of 10 credentials allowed
  • Optional DomainID field as string type
  • Proper validation of base transaction fields

The implementation includes comprehensive validation and test coverage, demonstrating correct handling of the transaction structure.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for XLS-80d specification references and transaction definitions
rg -A 10 "XLS-80d" 
ast-grep --pattern 'interface PermissionedDomainSet {
  $$$
}'

Length of output: 696


Script:

#!/bin/bash
# Search for PermissionedDomainSet interface and type definitions
rg -A 15 "type PermissionedDomainSet" 
rg -A 15 "interface PermissionedDomainSet"

# Search for any documentation or comments about PermissionedDomainSet
rg -B 2 -A 5 "PermissionedDomainSet"

# Look for test cases to understand the implementation
fd "permissionedDomain" --type file --exec cat {}

Length of output: 23461


Script:

#!/bin/bash
# Search for XLS specification files or documentation
fd -e md -e txt "XLS-80" --exec cat {}

# Search for any documentation about PermissionedDomain feature
rg -i "permissioneddomain.*specification" 
rg -i "xls-80.*specification"

Length of output: 116

packages/xrpl/src/models/transactions/index.ts (1)

90-91: Verify the existence of imported transaction type files.

The new exports reference files that should contain the transaction type definitions.

✅ Verification successful

Both transaction type files exist and are properly structured

The verification confirms that:

  • Both permissionedDomainSet.ts and permissionedDomainDelete.ts files exist in the correct location
  • Each file properly defines its transaction type interface extending BaseTransaction
  • Both files include their respective validation functions
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of the new transaction type files and their contents.

# Check if the files exist
fd -t f "permissionedDomain(Set|Delete).ts$" packages/xrpl/src/models/transactions/

# Check the structure of the files to ensure they define the transaction types
rg -A 10 "export (type|interface) PermissionedDomain(Set|Delete)" packages/xrpl/src/models/transactions/

Length of output: 2419

.ci-config/rippled.cfg (3)

182-182: Confirm implementation alignment with XLS-80d specification.

The addition of Credentials and PermissionedDomains amendments aligns with the PR objectives to implement the XLS-80d specification. However, we should verify that these features are implemented in the correct order, as the PR mentions dependencies on the Credentials feature implementation.

Let's verify the implementation order:

Also applies to: 192-192


181-181: Verify compatibility of auxiliary amendments.

The additional amendments (fixAMMv1_1, NFTokenMintOffer, etc.) appear to be supporting features or fixes. While they're not directly related to the PR's main objective, they might be required for the complete functionality.

Let's verify their necessity:

Also applies to: 183-191


181-192: Verify amendment dependencies and integration order.

The new amendments appear to be logically grouped and aligned with the PR objectives. However, since the PR mentions dependencies on other PRs (C++ implementation and Credentials feature), we should verify the amendment ordering and dependencies.

Let's verify the amendment dependencies:

packages/xrpl/src/models/transactions/transaction.ts (3)

61-62: LGTM: Import statements follow the established pattern

The new imports for PermissionedDomain transactions maintain consistency with the existing codebase structure.


133-134: Verify type definitions in respective files

The transaction types are correctly added to SubmittableTransaction. However, we should verify the completeness of the type definitions.

✅ Verification successful

Type definitions are complete and properly registered

The verification shows:

  • Both PermissionedDomainSet and PermissionedDomainDelete interfaces are properly defined extending BaseTransaction
  • Required fields and types are specified correctly:
    • PermissionedDomainSet: Has optional DomainID and required AcceptedCredentials array
    • PermissionedDomainDelete: Has required DomainID field
  • Both transaction types are registered in the binary codec with unique codes (61 and 62)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify type definitions for new transaction types

# Check if type definition files exist and contain required fields
echo "Checking PermissionedDomainSet type definition:"
rg -A 10 "export (type|interface) PermissionedDomainSet" packages/xrpl/src/models/transactions/permissionedDomainSet.ts

echo "Checking PermissionedDomainDelete type definition:"
rg -A 10 "export (type|interface) PermissionedDomainDelete" packages/xrpl/src/models/transactions/permissionedDomainDelete.ts

# Verify if transaction types are registered in binary codec
echo "Checking transaction type registration in binary codec:"
rg "PermissionedDomain(Set|Delete)" packages/ripple-binary-codec/src/enums/definitions.json

Length of output: 1425


365-372: Verify validation implementation details

The validation cases are properly integrated into the switch statement. However, we should verify the implementation of the validation functions to ensure they handle all edge cases according to the XLS-80d specification.

✅ Verification successful

Let me gather more information about the test coverage to ensure the validation functions are properly tested.


Let me check the test files directly since the previous search pattern might have been too specific.


Validation implementations are properly implemented and tested

The validation functions for both transaction types are well-implemented with appropriate checks:

  • PermissionedDomainSet validates:

    • Required base transaction fields
    • Optional DomainID as string
    • Required AcceptedCredentials array with size constraints (1-10 credentials)
  • PermissionedDomainDelete validates:

    • Required base transaction fields
    • Required DomainID as string

Both implementations have comprehensive test coverage including positive and negative test cases, validating field presence, type checking, and array constraints where applicable.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify validation implementations for new transaction types

# Check validation function implementations
echo "Checking PermissionedDomainSet validation:"
rg -A 20 "export function validatePermissionedDomainSet" packages/xrpl/src/models/transactions/permissionedDomainSet.ts

echo "Checking PermissionedDomainDelete validation:"
rg -A 20 "export function validatePermissionedDomainDelete" packages/xrpl/src/models/transactions/permissionedDomainDelete.ts

# Check for test coverage
echo "Checking test coverage:"
fd -e test.ts -e spec.ts permissionedDomain

Length of output: 1764


Script:

#!/bin/bash
# Check test implementations for validation functions
echo "Checking PermissionedDomainSet test cases:"
rg -A 10 "describe.*validation" packages/xrpl/test/models/permissionedDomainSet.test.ts

echo "Checking PermissionedDomainDelete test cases:"
rg -A 10 "describe.*validation" packages/xrpl/test/models/permissionedDomainDelete.test.ts

# Check XLS-80d spec implementation details
echo "Checking XLS-80d spec references:"
rg -i "xls-80" .

Length of output: 555


Script:

#!/bin/bash
# Check full test file contents
echo "PermissionedDomainSet test content:"
cat packages/xrpl/test/models/permissionedDomainSet.test.ts

echo -e "\nPermissionedDomainDelete test content:"
cat packages/xrpl/test/models/permissionedDomainDelete.test.ts

# Check constants used in validation
echo -e "\nChecking validation constants:"
rg "ACCEPTED_CREDENTIALS_MAX_LENGTH" packages/xrpl/src/

Length of output: 4189

packages/ripple-binary-codec/src/enums/definitions.json (7)

56-57: LGTM: New ledger entry types for XLS-80d

The addition of Credential (129) and PermissionedDomain (130) ledger entry types follows the sequential numbering convention and implements the XLS-80d specification.


1075-1094: LGTM: Node fields for credential management

The IssuerNode and SubjectNode fields (UInt64 type) are correctly defined with unique nth values (27, 28) and appropriate serialization flags.


2015-2024: LGTM: Core credential fields

The new credential-related fields are well-structured:

  • CredentialType: Blob field with nth=31
  • Subject: AccountID field with nth=24
  • CredentialIDs: Vector256 field with nth=5
  • Credential: STObject field with nth=33

All fields have appropriate types and unique nth values.

Also applies to: 2185-2194, 2235-2244, 2615-2624


2814-2842: LGTM: Credential management arrays

The STArray fields for credential operations are properly defined:

  • AuthorizeCredentials: nth=26
  • UnauthorizeCredentials: nth=27
  • AcceptedCredentials: nth=28

These arrays will store collections of credentials for different operations.


3027-3028: LGTM: New transaction result code

The tecBAD_CREDENTIALS error code is appropriately placed in the TRANSACTION_RESULTS section with value 193, following the sequential ordering.


3079-3083: LGTM: New transaction types for XLS-80d

The transaction types for credential and permissioned domain management are well-defined:

  • CredentialCreate: 58
  • CredentialAccept: 59
  • CredentialDelete: 60
  • PermissionedDomainSet: 61
  • PermissionedDomainDelete: 62

The values follow the sequential ordering convention.


Line range hint 1-3083: Verify enum value uniqueness

Let's verify that all new enum values are unique within their respective sections to prevent any potential conflicts.

✅ Verification successful

Let me generate a new script to verify the enum values in a different way:


All enum values are unique within their respective sections

The verification results show that there are no duplicate values in:

  • LEDGER_ENTRY_TYPES
  • TRANSACTION_TYPES
  • TRANSACTION_RESULTS
  • Field nth values within each type

The code structure maintains proper uniqueness constraints, ensuring no conflicts between enum values.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for duplicate values in enum sections

# Function to extract and check duplicates in a section
check_duplicates() {
    local section=$1
    echo "Checking duplicates in $section:"
    jq -r ".$section | to_entries | map(.value) | sort | group_by(.) | map(select(length > 1))" packages/ripple-binary-codec/src/enums/definitions.json
}

# Check each section
sections=("LEDGER_ENTRY_TYPES" "TRANSACTION_TYPES" "TRANSACTION_RESULTS")
for section in "${sections[@]}"; do
    check_duplicates "$section"
done

# Check nth values in FIELDS array
echo "Checking duplicate nth values in FIELDS by type:"
jq -r '.FIELDS | group_by(.[1].type) | .[] | {type: .[0][1].type, nths: map(.[1].nth)} | select(.nths | length > length | unique)' packages/ripple-binary-codec/src/enums/definitions.json

Length of output: 1579


Script:

#!/bin/bash

# Check for duplicate values in each section
echo "Checking LEDGER_ENTRY_TYPES for duplicates:"
jq -r '.LEDGER_ENTRY_TYPES | to_entries | group_by(.value) | map(select(length > 1)) | .[]' packages/ripple-binary-codec/src/enums/definitions.json

echo -e "\nChecking TRANSACTION_TYPES for duplicates:"
jq -r '.TRANSACTION_TYPES | to_entries | group_by(.value) | map(select(length > 1)) | .[]' packages/ripple-binary-codec/src/enums/definitions.json

echo -e "\nChecking TRANSACTION_RESULTS for duplicates:"
jq -r '.TRANSACTION_RESULTS | to_entries | group_by(.value) | map(select(length > 1)) | .[]' packages/ripple-binary-codec/src/enums/definitions.json

# Check for duplicate nth values within each type in FIELDS
echo -e "\nChecking FIELDS for duplicate nth values within each type:"
jq -r '
.FIELDS | 
group_by(.[1].type) | 
.[] | 
{
  type: .[0][1].type,
  duplicates: (
    map({name: .[0], nth: .[1].nth}) | 
    group_by(.nth) | 
    map(select(length > 1))
  )
} |
select(.duplicates | length > 0)
' packages/ripple-binary-codec/src/enums/definitions.json

Length of output: 1165

packages/xrpl/HISTORY.md (2)

Line range hint 11-13: LGTM: Bug fixes are well documented

The bug fixes for TransactionStream and Ledger models are clearly documented with the specific fields that were affected.


9-9: Verify implementation details for XLS-80d PermissionedDomain feature

The changelog entry for XLS-80d PermissionedDomain feature implementation should include more details about the specific changes and functionality added, since this is a significant feature mentioned in the PR objectives.

✅ Verification successful

Based on the shell script results, I can now generate a final response since I have comprehensive information about the XLS-80d PermissionedDomain feature implementation:

The XLS-80d PermissionedDomain implementation is well-documented and complete

The changelog entry is appropriate as the implementation includes:

  • Two new transaction types: PermissionedDomainSet and PermissionedDomainDelete
  • A new ledger entry type: PermissionedDomain
  • Full validation and integration test coverage
  • Support for credential management with a maximum of 10 accepted credentials per domain
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for XLS-80d related changes in the codebase

# Look for PermissionedDomain related files and changes
rg -A 5 "PermissionedDomain"

# Look for new transaction types
ast-grep --pattern $'class $_ {
  $$$
  PermissionedDomain$_($_, $_) {
    $$$
  }
  $$$
}'

Length of output: 21701

Comment on lines +25 to +31
tx = {
TransactionType: 'PermissionedDomainSet',
Account: 'rfmDuhDyLGgx94qiwf3YF8BUV5j6KSvE8',
DomainID: 'D88930B33C2B6831660BFD006D91FF100011AD4E67CBB78B460AF0A215103737',
AcceptedCredentials: [sampleCredential]
} as any
})
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid using 'any' type and consider adding type definitions.

The use of 'any' type casting could mask potential type-related issues.

- } as any
+ } as PermissionedDomainSet

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +45 to +50
it(`throws w/ missing field AcceptedCredentials`, function () {
delete tx.AcceptedCredentials
const errorMessage = 'PermissionedDomainSet: missing field AcceptedCredentials'
assert.throws(() => validatePermissionedDomainSet(tx), ValidationError, errorMessage)
assert.throws(() => validate(tx), ValidationError, errorMessage)
})
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enhance test coverage and avoid using delete operator.

  1. Replace delete operator with undefined assignment for better performance
  2. Add missing test cases for AcceptedCredentials validation:
    • Maximum array length (10 elements)
    • Invalid credential format
    • Empty array
  it(`throws w/ missing field AcceptedCredentials`, function () {
-   delete tx.AcceptedCredentials
+   tx.AcceptedCredentials = undefined
    const errorMessage = 'PermissionedDomainSet: missing field AcceptedCredentials'
    assert.throws(() => validatePermissionedDomainSet(tx), ValidationError, errorMessage)
    assert.throws(() => validate(tx), ValidationError, errorMessage)
  })

+ it('throws when AcceptedCredentials exceeds maximum length', function () {
+   tx.AcceptedCredentials = Array(11).fill(sampleCredential)
+   const errorMessage = 'PermissionedDomainSet: AcceptedCredentials array exceeds maximum length of 10'
+   assert.throws(() => validatePermissionedDomainSet(tx), ValidationError, errorMessage)
+ })
+
+ it('throws when AcceptedCredentials is empty', function () {
+   tx.AcceptedCredentials = []
+   const errorMessage = 'PermissionedDomainSet: AcceptedCredentials array must not be empty'
+   assert.throws(() => validatePermissionedDomainSet(tx), ValidationError, errorMessage)
+ })

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Biome

[error] 46-46: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

Comment on lines +13 to +51
describe('PermissionedDomainSet', function () {
let tx

beforeEach(function () {

const sampleCredential: Credential = {
Credential: {
CredentialType: stringToHex('Passport'),
Issuer: 'rfmDuhDyLGgx94qiwf3YF8BUV5j6KSvE8'
}
}

tx = {
TransactionType: 'PermissionedDomainSet',
Account: 'rfmDuhDyLGgx94qiwf3YF8BUV5j6KSvE8',
DomainID: 'D88930B33C2B6831660BFD006D91FF100011AD4E67CBB78B460AF0A215103737',
AcceptedCredentials: [sampleCredential]
} as any
})

it('verifies valid PermissionedDomainSet', function () {
assert.doesNotThrow(() => validatePermissionedDomainSet(tx))
assert.doesNotThrow(() => validate(tx))
})

it(`throws with invalid field DomainID`, function () {
tx.DomainID = 1234 // DomainID is expected to be a string
const errorMessage = 'PermissionedDomainSet: invalid field DomainID'
assert.throws(() => validatePermissionedDomainSet(tx), ValidationError, errorMessage)
assert.throws(() => validate(tx), ValidationError, errorMessage)
})

it(`throws w/ missing field AcceptedCredentials`, function () {
delete tx.AcceptedCredentials
const errorMessage = 'PermissionedDomainSet: missing field AcceptedCredentials'
assert.throws(() => validatePermissionedDomainSet(tx), ValidationError, errorMessage)
assert.throws(() => validate(tx), ValidationError, errorMessage)
})
})
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Test coverage for PermissionedDomainSet appears incomplete per XLS-80d requirements

The current test coverage has gaps when compared to the implementation requirements:

  • Missing test for maximum AcceptedCredentials length (implementation enforces max 10)
  • Missing test for empty AcceptedCredentials array validation
  • Missing validation tests for Credential object structure
  • Integration test only covers basic happy path with a single credential

The implementation shows these validations but corresponding test cases are absent in both unit and integration tests.

Recommended test additions:

  • Test case for AcceptedCredentials array exceeding max length (10)
  • Test case for empty AcceptedCredentials array
  • Test cases for malformed Credential objects
  • Integration test scenarios with multiple credentials
🔗 Analysis chain

Verify test coverage against XLS-80d specification requirements.

Please ensure that all requirements from the XLS-80d specification for PermissionedDomainSet transactions are covered in the test suite.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for related test files to analyze coverage
echo "Searching for related test files..."
fd -e ts -e js "permissioned.*test" 

# Search for implementation details to cross-reference with tests
echo "Searching for implementation details..."
rg -l "PermissionedDomain" --type ts --type js

# Look for any TODO comments related to missing test coverage
echo "Checking for TODO comments..."
rg -i "todo.*test.*permission" --type ts --type js

Length of output: 1078


Script:

#!/bin/bash
# Let's analyze the implementation and test files to verify coverage

# First, let's look at the implementation details for PermissionedDomainSet
echo "=== PermissionedDomainSet Implementation ==="
cat packages/xrpl/src/models/transactions/permissionedDomainSet.ts

# Then check the integration tests
echo -e "\n=== Integration Tests ==="
cat packages/xrpl/test/integration/transactions/permissionedDomain.test.ts

# Look at the model definition
echo -e "\n=== PermissionedDomain Model ==="
cat packages/xrpl/src/models/ledger/PermissionedDomain.ts

# Check other test cases
echo -e "\n=== PermissionedDomainDelete Tests ==="
cat packages/xrpl/test/models/permissionedDomainDelete.test.ts

Length of output: 6939

🧰 Tools
🪛 Biome

[error] 46-46: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

Comment on lines +67 to +78
// Step-3: Test the PDDelete transaction
const tx_pd_delete: PermissionedDomainDelete = {
TransactionType: 'PermissionedDomainDelete',
Account: testContext.wallet.classicAddress,
// fetch the PD `index` from the previous account_objects RPC response
DomainID: pd.index
}

console.log(pd)

await testTransaction(testContext.client, tx_pd_delete, testContext.wallet)
},
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Verify deletion success.

After deleting the PermissionedDomain, verify that it's actually removed by checking account_objects again.

 await testTransaction(testContext.client, tx_pd_delete, testContext.wallet)
+
+// Verify the domain was deleted
+const resultAfterDelete = await testContext.client.request({
+  command: 'account_objects',
+  account: testContext.wallet.classicAddress,
+  type: 'permissioned_domain',
+})
+assert.equal(resultAfterDelete.result.account_objects.length, 0)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Step-3: Test the PDDelete transaction
const tx_pd_delete: PermissionedDomainDelete = {
TransactionType: 'PermissionedDomainDelete',
Account: testContext.wallet.classicAddress,
// fetch the PD `index` from the previous account_objects RPC response
DomainID: pd.index
}
console.log(pd)
await testTransaction(testContext.client, tx_pd_delete, testContext.wallet)
},
// Step-3: Test the PDDelete transaction
const tx_pd_delete: PermissionedDomainDelete = {
TransactionType: 'PermissionedDomainDelete',
Account: testContext.wallet.classicAddress,
// fetch the PD `index` from the previous account_objects RPC response
DomainID: pd.index
}
console.log(pd)
await testTransaction(testContext.client, tx_pd_delete, testContext.wallet)
// Verify the domain was deleted
const resultAfterDelete = await testContext.client.request({
command: 'account_objects',
account: testContext.wallet.classicAddress,
type: 'permissioned_domain',
})
assert.equal(resultAfterDelete.result.account_objects.length, 0)
},

@mvadari mvadari changed the base branch from main to verifiable-credentials December 12, 2024 00:34
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.

1 participant