Skip to content

refactor: refactor model tests to use a helper function #2965

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

mvadari
Copy link
Collaborator

@mvadari mvadari commented Apr 16, 2025

High Level Overview of Change

This PR refactors the transaction model tests to be more consistent via a couple of helper functions, and fixes a couple of minor bugs along the way.

While the diff is rather large, most of the changes are fairly systematic.

Context of Change

Pulled out of #2895 to make that PR simpler

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

CI passes.

Copy link

coderabbitai bot commented Apr 16, 2025

Walkthrough

This update refactors transaction validation tests across a wide range of transaction models in the codebase. The main changes involve replacing direct assertion and validation calls with standardized utility functions (assertTxIsValid, assertTxValidationError) and local helpers for asserting valid and invalid transactions. This approach streamlines test code, reduces duplication, and centralizes validation logic. Additionally, minor validation logic improvements were made to transaction model validators to handle undefined or null Flags fields more robustly. No changes were made to the signatures or declarations of exported or public entities, except for the addition of the new test utilities.

Changes

Files/Paths Change Summary
packages/xrpl/test/models/*.test.ts Refactored validation tests for all transaction models to use helper functions (assertValid, assertInvalid) wrapping new utility functions for validation assertion. Removed direct usage of chai assertions and manual validation calls. Explicitly typed transaction variables as any. No changes to validation logic or test coverage.
packages/xrpl/src/models/transactions/MPTokenIssuanceCreate.ts
.../MPTokenIssuanceSet.ts
.../NFTokenCreateOffer.ts
Improved handling of the Flags field in transaction validators: now defaults to 0 if Flags is null or undefined before type checks, ensuring robust flag evaluation and preventing errors due to missing values. For NFTokenCreateOffer, added support for both numeric and object flag representations. No changes to exported/public APIs.
packages/xrpl/HISTORY.md Updated changelog to document the fix for crashes during transaction validation due to missing or undefined Flags.
packages/xrpl/test/testUtils.ts Added utility functions assertTxIsValid and assertTxValidationError to standardize assertions for transaction validation tests. These functions check that both transaction-specific and general validation functions behave as expected for valid and invalid transactions. Updated imports accordingly.
jest.config.base.js Added coverageReporters configuration with text (skipping full report) and text-summary formats for Jest coverage reporting.

Possibly related PRs

  • XRPLF/xrpl.js#2856: Enhances MPT flag validations in MPTokenIssuanceCreate and MPTokenIssuanceSet with additional flag checks and error conditions; both PRs modify validation logic for MPT-related transactions, focusing on different aspects of flag handling and validation rules.
  • XRPLF/xrpl.js#2825: Refactors flag handling by replacing setTransactionFlagsToNumber with convertTxFlagsToNumber to avoid mutation of transaction flags; related to flag conversion logic in transaction validation.
  • XRPLF/xrpl.js#2829: Adds credential-related transaction types and validation logic; related as both PRs implement and test credential features in the XRPL.js codebase.

Suggested reviewers

  • pdp2121
  • achowdhry-ripple

Poem

In the warren where test cases hop,
Rabbits tidy code, they never stop.
With helpers to check what’s valid or not,
Flags now behave, no more error-spot!
Tests run smooth, as carrots in spring—
For robust validation, let the bunnies sing!
🐇✨

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 config production Use --omit=dev instead.
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: '@es-joy/[email protected]',
npm warn EBADENGINE required: { node: '^14 || ^16 || ^17 || ^18 || ^19' },
npm warn EBADENGINE current: { node: 'v24.1.0', npm: '11.3.0' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: '[email protected]',
npm warn EBADENGINE required: { node: '^14 || ^16 || ^17 || ^18 || ^19' },
npm warn EBADENGINE current: { node: 'v24.1.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-05-27T17_19_34_699Z-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 8da758e and 776a7e6.

📒 Files selected for processing (2)
  • packages/xrpl/HISTORY.md (1 hunks)
  • packages/xrpl/test/models/baseTransaction.test.ts (15 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/xrpl/test/models/baseTransaction.test.ts
  • packages/xrpl/HISTORY.md
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: integration (18.x)
  • GitHub Check: integration (20.x)
  • GitHub Check: browser (18.x)
  • GitHub Check: integration (22.x)
  • GitHub Check: snippets (22.x)
  • GitHub Check: snippets (20.x)
  • GitHub Check: snippets (18.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.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the model tests by replacing inline validation calls with helper functions (assertValid and assertInvalid) to improve consistency, while also addressing a couple of minor bugs in the transaction validations.

  • Replaced direct validation assertions (assert.doesNotThrow/assert.throws) in tests with helper function calls.
  • Updated flag handling in transaction validators to ensure proper conversion (using convertTxFlagsToNumber for NFTokenCreateOffer, and defaulting undefined Flags to 0).
  • Fixed a test inconsistency in the DIDDelete tests.

Reviewed Changes

Copilot reviewed 60 out of 60 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/xrpl/test/models/MPTokenIssuanceSet.test.ts Updated tests to use assertValid and assertInvalid helpers; fixed flag casting.
packages/xrpl/test/models/MPTokenIssuanceCreate.test.ts Refactored validation assertions; adjusted flag type coercion.
packages/xrpl/test/models/DIDDelete.test.ts Refactored test assertions; note potential test description mismatch.
packages/xrpl/src/models/transactions/NFTokenCreateOffer.ts Updated flag conversion to use convertTxFlagsToNumber.
packages/xrpl/src/models/transactions/MPTokenIssuanceSet.ts & MPTokenIssuanceCreate.ts Changed flag handling to default undefined Flags to 0.
... (other test and source files) Similar refactoring and minor bug fixes across multiple transaction tests.
Comments suppressed due to low confidence (1)

packages/xrpl/test/models/DIDDelete.test.ts:25

  • The test case titled 'throws on invalid DIDDelete' is asserting that the transaction is valid using assertValid(tx) even though the description implies that the transaction should fail validation (e.g., when an extra field 'FakeField' is present). Please review whether extra fields are allowed in DIDDelete transactions and update the test description or assertion accordingly.
assertValid(tx)

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: 1

🧹 Nitpick comments (30)
packages/xrpl/test/models/oracleDelete.test.ts (1)

28-31: Consider alternative to delete operator

While the functionality is correct, consider replacing the delete operator with an assignment to undefined for better performance.

-    delete tx.OracleDocumentID
+    tx.OracleDocumentID = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

35-38: Consider alternatives to the delete operator

Static analysis has flagged the use of the delete operator which can impact performance.

-    delete cancel.Owner
+    cancel.Owner = undefined

-    delete cancel.OfferSequence
+    cancel.OfferSequence = undefined

While performance isn't typically a concern in test code, using assignment for consistency is preferred.

Also applies to: 41-44

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

29-29: Consider using undefined assignment instead of delete operator.

The delete operator can impact performance. Consider using undefined assignment instead.

-    delete ticketCreate.TicketCount
+    ticketCreate.TicketCount = undefined
🧰 Tools
🪛 Biome (1.9.4)

[error] 29-29: 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 (1)

48-48: Consider using undefined assignment instead of delete operator.

The delete operator can impact performance. Consider using undefined assignment instead.

-    delete tx.AcceptedCredentials
+    tx.AcceptedCredentials = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

45-45: Consider using assignment instead of delete for better performance.

While not directly related to your current changes, the static analysis tool flagged multiple uses of the delete operator, which can impact performance.

-  delete tx.OracleDocumentID
+  tx.OracleDocumentID = undefined

Apply similar changes to other instances of the delete operator in this file.

Also applies to: 57-57, 114-114, 128-128, 135-135, 142-142, 149-149

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

40-40: Consider replacing delete with undefined assignment

The static analysis tool has flagged the use of the delete operator as a potential performance issue. While this is less critical in test code, consider using undefined assignment instead.

-delete trustSet.LimitAmount
+trustSet.LimitAmount = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

36-36: Consider replacing delete operators with undefined assignments

The static analysis tool has flagged multiple uses of the delete operator as potential performance issues. While less critical in test code, consider using undefined assignments instead.

// Line 36
-delete escrow.Amount
+escrow.Amount = undefined

// Line 42
-delete escrow.Destination
+escrow.Destination = undefined

// Lines 84-85
-delete escrow.CancelAfter
-delete escrow.FinishAfter
+escrow.CancelAfter = undefined
+escrow.FinishAfter = undefined

// Lines 94-95
-delete escrow.Condition
-delete escrow.FinishAfter
+escrow.Condition = undefined
+escrow.FinishAfter = undefined

Also applies to: 42-42, 84-85, 94-95

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

45-45: Consider replacing delete operators with undefined assignments

The static analysis tool has flagged multiple uses of the delete operator as potential performance issues. While less critical in test code, consider using undefined assignments instead for better performance.

// Line 45
-delete tx.XChainBridge
+tx.XChainBridge = undefined

// Line 57
-delete tx.SignatureReward
+tx.SignatureReward = undefined

// Line 75
-delete tx.Destination
+tx.Destination = undefined

// Line 87
-delete tx.Amount
+tx.Amount = undefined

Also applies to: 57-57, 75-75, 87-87

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

37-39: Consider using undefined assignment instead of delete operator

The static analysis tool has flagged the use of the delete operator as potentially impacting performance. While this is likely not a significant concern in test code, for consistency with best practices, consider using undefined assignment instead.

-    delete channel.CancelAfter
-    delete channel.DestinationTag
-    delete channel.SourceTag
+    channel.CancelAfter = undefined
+    channel.DestinationTag = undefined
+    channel.SourceTag = undefined

Similar changes can be applied to other occurrences of the delete operator.

Also applies to: 45-45, 51-51, 57-57, 63-63

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

37-37: Consider using undefined assignment instead of delete operator

The static analysis tool has flagged the use of the delete operator as potentially impacting performance. While this is likely not a significant concern in test code, for consistency with best practices, consider using undefined assignment instead.

-    delete vote.Asset
+    vote.Asset = undefined

Similar changes can be applied to the other instances of delete in this file.

Also applies to: 49-49, 61-61

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

36-36: Consider using undefined assignment instead of delete operator

The static analysis tool has flagged the use of the delete operator as potentially impacting performance. While this is likely not a significant concern in test code, for consistency with best practices, consider using undefined assignment instead.

-    delete ammCreate.Amount
+    ammCreate.Amount = undefined

Similar changes can be applied to the other instances of delete in this file.

Also applies to: 48-48, 60-60

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

53-53: Consider using assignment to undefined instead of delete

Static analysis is flagging the use of the delete operator as potentially impacting performance. For test code, this is generally not a concern, but for consistency with best practices you might consider using assignment to undefined instead.

-delete tx.Amount
+tx.Amount = undefined

Also applies to: 65-65, 83-83, 107-107, 125-125, 137-137, 149-149, 167-167, 179-179

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

44-44: Consider using assignment to undefined instead of delete

Static analysis flags the use of delete for potential performance issues. While this is a minor concern for test code, you might consider using undefined assignment for consistency with best practices:

-delete tx.XChainBridge
+tx.XChainBridge = undefined

Also applies to: 56-56

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

47-47: Consider using assignment to undefined instead of delete

Static analysis flags the use of delete for potential performance concerns. For consistency with best practices, consider:

-delete offer.OfferSequence
+offer.OfferSequence = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

37-37: Consider using assignment to undefined instead of delete.

The static analysis tool suggests avoiding the delete operator for performance reasons.

-    delete ammDelete.Asset
+    ammDelete.Asset = undefined
-    delete ammDelete.Asset2
+    ammDelete.Asset2 = undefined

Also applies to: 49-49

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

68-68: Consider using assignment to undefined instead of delete.

The static analysis tool suggests avoiding the delete operator for performance reasons.

-    delete bid.Asset
+    bid.Asset = undefined
-    delete bid.Asset2
+    bid.Asset2 = undefined

Also applies to: 80-80

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

45-45: Consider using assignment to undefined instead of delete.

The static analysis tool suggests avoiding the delete operator for performance reasons.

-    delete ammClawback.Amount
+    ammClawback.Amount = undefined

-    delete ammClawback.Holder
+    ammClawback.Holder = undefined

-    delete ammClawback.Asset
+    ammClawback.Asset = undefined

-    delete ammClawback.Asset2
+    ammClawback.Asset2 = undefined

Also applies to: 55-55, 73-73, 91-91

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

52-54: Consider using assignment to undefined instead of delete.

The static analysis tool suggests avoiding the delete operator for performance reasons.

-    delete tx.Data
-    delete tx.DIDDocument
-    delete tx.URI
+    tx.Data = undefined
+    tx.DIDDocument = undefined
+    tx.URI = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

44-44: Consider alternative to delete operator for better performance.

The delete operator can impact performance. Consider using assignment to undefined instead:

-    delete tx.XChainBridge
+    tx.XChainBridge = undefined

and similar for other properties.

Also applies to: 56-56, 68-68, 86-86

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

78-78: Consider alternative to delete operator for better performance.

The delete operator can impact performance. Consider using assignment to undefined instead:

-    delete deposit.Asset
+    deposit.Asset = undefined

and similar for other properties.

Also applies to: 90-90

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

33-33: Consider alternatives to the delete operator for better performance.

While functional in test code, using the delete operator can impact performance. Consider using assignment to undefined instead.

-    delete channel.Expiration
+    channel.Expiration = undefined

This is a minor optimization that's most relevant in performance-critical code. Since this is test code, it's less critical, but it's a good practice to follow.

Also applies to: 39-39, 45-45

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

31-31: Consider alternative to delete operator for better performance.

While appropriate for test code, using the delete operator can impact performance. Consider using assignment to undefined as an alternative.

-    delete tx.DomainID
+    tx.DomainID = undefined

This is a minor optimization that's less critical in test code, but would align with performance best practices.

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

43-43: Consider using property assignment instead of delete

Static analysis flagged the use of delete operator which can impact performance. While the impact is negligible in test code, consider using undefined assignment instead for consistency with best practices.

- delete tx.XChainBridge
+ tx.XChainBridge = undefined

- delete tx.XChainClaimID
+ tx.XChainClaimID = undefined

- delete tx.Amount
+ tx.Amount = undefined

Also applies to: 55-55, 73-73

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

44-47: Consider using assignment instead of delete

For better performance in JavaScript/TypeScript, consider using undefined assignment instead of the delete operator.

- delete tx.XChainBridge
+ tx.XChainBridge = undefined

This applies to all similar test cases in this file.

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMWithdraw.test.ts (2)

89-90: Consider avoiding the delete operator

Static analysis tools flag the delete operator as potentially impacting performance.

While performance is less critical in test code, consider using undefined assignment instead:

-    delete withdraw.Asset
+    withdraw.Asset = undefined
     const errorMessage = 'AMMWithdraw: missing field Asset'
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


101-102: Consider avoiding the delete operator

Static analysis tools flag the delete operator as potentially impacting performance.

While performance is less critical in test code, consider using undefined assignment instead:

-    delete withdraw.Asset2
+    withdraw.Asset2 = undefined
     const errorMessage = 'AMMWithdraw: missing field Asset2'
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/paymentChannelClaim.test.ts (2)

36-42: Consider avoiding the delete operator

Static analysis tools flag the delete operator as potentially impacting performance. While this is less critical in test code, consider using undefined assignments for consistency.

-    delete channel.Balance
-    delete channel.Amount
-    delete channel.Signature
-    delete channel.PublicKey
+    channel.Balance = undefined
+    channel.Amount = undefined
+    channel.Signature = undefined
+    channel.PublicKey = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


46-48: Consider avoiding the delete operator

Static analysis tools flag the delete operator as potentially impacting performance.

-    delete channel.Channel
+    channel.Channel = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/payment.test.ts (2)

73-74: Use assignment instead of delete operator

The delete operator can impact performance. Consider using an undefined assignment instead.

-    delete payment.Amount
+    payment.Amount = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


83-84: Use assignment instead of delete operator

The delete operator can impact performance. Consider using an undefined assignment instead.

-    delete payment.Destination
+    payment.Destination = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b58acbb and 8a0d681.

📒 Files selected for processing (60)
  • packages/xrpl/HISTORY.md (1 hunks)
  • packages/xrpl/src/models/transactions/MPTokenIssuanceCreate.ts (1 hunks)
  • packages/xrpl/src/models/transactions/MPTokenIssuanceSet.ts (1 hunks)
  • packages/xrpl/src/models/transactions/NFTokenCreateOffer.ts (1 hunks)
  • packages/xrpl/test/models/AMMBid.test.ts (5 hunks)
  • packages/xrpl/test/models/AMMClawback.test.ts (2 hunks)
  • packages/xrpl/test/models/AMMCreate.test.ts (2 hunks)
  • packages/xrpl/test/models/AMMDelete.test.ts (2 hunks)
  • packages/xrpl/test/models/AMMDeposit.test.ts (5 hunks)
  • packages/xrpl/test/models/AMMVote.test.ts (2 hunks)
  • packages/xrpl/test/models/AMMWithdraw.test.ts (5 hunks)
  • packages/xrpl/test/models/CredentialAccept.test.ts (2 hunks)
  • packages/xrpl/test/models/CredentialCreate.test.ts (2 hunks)
  • packages/xrpl/test/models/CredentialDelete.test.ts (2 hunks)
  • packages/xrpl/test/models/DIDDelete.test.ts (2 hunks)
  • packages/xrpl/test/models/DIDSet.test.ts (2 hunks)
  • packages/xrpl/test/models/MPTokenAuthorize.test.ts (6 hunks)
  • packages/xrpl/test/models/MPTokenIssuanceCreate.test.ts (9 hunks)
  • packages/xrpl/test/models/MPTokenIssuanceDestroy.test.ts (3 hunks)
  • packages/xrpl/test/models/MPTokenIssuanceSet.test.ts (6 hunks)
  • packages/xrpl/test/models/NFTokenAcceptOffer.test.ts (11 hunks)
  • packages/xrpl/test/models/NFTokenBurn.test.ts (3 hunks)
  • packages/xrpl/test/models/NFTokenCancelOffer.test.ts (4 hunks)
  • packages/xrpl/test/models/NFTokenCreateOffer.test.ts (12 hunks)
  • packages/xrpl/test/models/NFTokenMint.test.ts (9 hunks)
  • packages/xrpl/test/models/NFTokenModify.test.ts (5 hunks)
  • packages/xrpl/test/models/XChainAccountCreateCommit.test.ts (2 hunks)
  • packages/xrpl/test/models/XChainAddAccountCreateAttestation.test.ts (2 hunks)
  • packages/xrpl/test/models/XChainAddClaimAttestation.test.ts (2 hunks)
  • packages/xrpl/test/models/XChainClaim.test.ts (2 hunks)
  • packages/xrpl/test/models/XChainCommit.test.ts (2 hunks)
  • packages/xrpl/test/models/XChainCreateBridge.test.ts (2 hunks)
  • packages/xrpl/test/models/XChainCreateClaimID.test.ts (2 hunks)
  • packages/xrpl/test/models/XChainModifyBridge.test.ts (2 hunks)
  • packages/xrpl/test/models/accountDelete.test.ts (5 hunks)
  • packages/xrpl/test/models/accountSet.test.ts (2 hunks)
  • packages/xrpl/test/models/baseTransaction.test.ts (15 hunks)
  • packages/xrpl/test/models/checkCancel.test.ts (3 hunks)
  • packages/xrpl/test/models/checkCash.test.ts (6 hunks)
  • packages/xrpl/test/models/checkCreate.test.ts (7 hunks)
  • packages/xrpl/test/models/clawback.test.ts (9 hunks)
  • packages/xrpl/test/models/depositPreauth.test.ts (10 hunks)
  • packages/xrpl/test/models/escrowCancel.test.ts (2 hunks)
  • packages/xrpl/test/models/escrowCreate.test.ts (3 hunks)
  • packages/xrpl/test/models/escrowFinish.test.ts (6 hunks)
  • packages/xrpl/test/models/offerCancel.test.ts (2 hunks)
  • packages/xrpl/test/models/offerCreate.test.ts (8 hunks)
  • packages/xrpl/test/models/oracleDelete.test.ts (2 hunks)
  • packages/xrpl/test/models/oracleSet.test.ts (3 hunks)
  • packages/xrpl/test/models/payment.test.ts (5 hunks)
  • packages/xrpl/test/models/paymentChannelClaim.test.ts (3 hunks)
  • packages/xrpl/test/models/paymentChannelCreate.test.ts (2 hunks)
  • packages/xrpl/test/models/paymentChannelFund.test.ts (2 hunks)
  • packages/xrpl/test/models/permissionedDomainDelete.test.ts (2 hunks)
  • packages/xrpl/test/models/permissionedDomainSet.test.ts (2 hunks)
  • packages/xrpl/test/models/setRegularKey.test.ts (2 hunks)
  • packages/xrpl/test/models/signerListSet.test.ts (5 hunks)
  • packages/xrpl/test/models/ticketCreate.test.ts (1 hunks)
  • packages/xrpl/test/models/trustSet.test.ts (2 hunks)
  • packages/xrpl/test/testUtils.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (6)
packages/xrpl/test/models/MPTokenIssuanceDestroy.test.ts (1)
Learnt from: shawnxie999
PR: XRPLF/xrpl.js#2661
File: packages/xrpl/test/models/MPTokenAuthorize.test.ts:60-71
Timestamp: 2024-12-06T18:44:55.095Z
Learning: In the XRPL.js library's TypeScript test file `packages/xrpl/test/models/MPTokenAuthorize.test.ts`, negative test cases for invalid `Account` address format, invalid `Holder` address format, invalid `MPTokenIssuanceID` format, and invalid flag combinations are not necessary.
packages/xrpl/test/models/MPTokenAuthorize.test.ts (1)
Learnt from: shawnxie999
PR: XRPLF/xrpl.js#2661
File: packages/xrpl/test/models/MPTokenAuthorize.test.ts:60-71
Timestamp: 2024-12-06T18:44:55.095Z
Learning: In the XRPL.js library's TypeScript test file `packages/xrpl/test/models/MPTokenAuthorize.test.ts`, negative test cases for invalid `Account` address format, invalid `Holder` address format, invalid `MPTokenIssuanceID` format, and invalid flag combinations are not necessary.
packages/xrpl/test/models/clawback.test.ts (1)
Learnt from: shawnxie999
PR: XRPLF/xrpl.js#2661
File: packages/xrpl/test/integration/transactions/clawback.test.ts:165-178
Timestamp: 2024-12-06T19:27:11.147Z
Learning: In the integration tests for `clawback.test.ts`, it's acceptable to use `@ts-expect-error` to bypass type checking when verifying ledger entries, and no additional type safety improvements are needed.
packages/xrpl/test/models/MPTokenIssuanceSet.test.ts (1)
Learnt from: shawnxie999
PR: XRPLF/xrpl.js#2661
File: packages/xrpl/test/models/MPTokenAuthorize.test.ts:60-71
Timestamp: 2024-12-06T18:44:55.095Z
Learning: In the XRPL.js library's TypeScript test file `packages/xrpl/test/models/MPTokenAuthorize.test.ts`, negative test cases for invalid `Account` address format, invalid `Holder` address format, invalid `MPTokenIssuanceID` format, and invalid flag combinations are not necessary.
packages/xrpl/test/models/AMMClawback.test.ts (1)
Learnt from: shawnxie999
PR: XRPLF/xrpl.js#2661
File: packages/xrpl/test/integration/transactions/clawback.test.ts:165-178
Timestamp: 2024-12-06T19:27:11.147Z
Learning: In the integration tests for `clawback.test.ts`, it's acceptable to use `@ts-expect-error` to bypass type checking when verifying ledger entries, and no additional type safety improvements are needed.
packages/xrpl/test/models/MPTokenIssuanceCreate.test.ts (1)
Learnt from: shawnxie999
PR: XRPLF/xrpl.js#2661
File: packages/xrpl/test/models/MPTokenAuthorize.test.ts:60-71
Timestamp: 2024-12-06T18:44:55.095Z
Learning: In the XRPL.js library's TypeScript test file `packages/xrpl/test/models/MPTokenAuthorize.test.ts`, negative test cases for invalid `Account` address format, invalid `Holder` address format, invalid `MPTokenIssuanceID` format, and invalid flag combinations are not necessary.
🧬 Code Graph Analysis (41)
packages/xrpl/test/models/oracleDelete.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/oracleDelete.ts (1)
  • validateOracleDelete (28-32)
packages/xrpl/test/models/checkCash.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/checkCash.ts (1)
  • validateCheckCash (40-72)
packages/xrpl/test/models/MPTokenIssuanceDestroy.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/MPTokenIssuanceDestroy.ts (1)
  • validateMPTokenIssuanceDestroy (29-34)
packages/xrpl/test/models/CredentialDelete.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/CredentialDelete.ts (1)
  • validateCredentialDelete (39-55)
packages/xrpl/test/models/XChainAccountCreateCommit.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/XChainAccountCreateCommit.ts (1)
  • validateXChainAccountCreateCommit (57-69)
packages/xrpl/test/models/permissionedDomainSet.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/permissionedDomainSet.ts (1)
  • validatePermissionedDomainSet (33-54)
packages/xrpl/test/models/DIDSet.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/DIDSet.ts (1)
  • validateDIDSet (31-49)
packages/xrpl/test/models/XChainCreateBridge.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/XChainCreateBridge.ts (1)
  • validateXChainCreateBridge (48-56)
packages/xrpl/test/models/XChainClaim.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/XChainClaim.ts (1)
  • validateXChainClaim (63-79)
packages/xrpl/test/models/trustSet.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/trustSet.ts (1)
  • validateTrustSet (137-156)
packages/xrpl/test/models/signerListSet.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/signerListSet.ts (1)
  • validateSignerListSet (39-88)
packages/xrpl/test/models/MPTokenAuthorize.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/MPTokenAuthorize.ts (1)
  • validateMPTokenAuthorize (63-67)
packages/xrpl/test/models/NFTokenBurn.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/NFTokenBurn.ts (1)
  • validateNFTokenBurn (48-52)
packages/xrpl/test/models/escrowFinish.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/escrowFinish.ts (1)
  • validateEscrowFinish (49-81)
packages/xrpl/test/models/checkCancel.test.ts (1)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/test/models/AMMVote.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/AMMVote.ts (1)
  • validateAMMVote (39-71)
packages/xrpl/test/models/setRegularKey.test.ts (1)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/test/models/paymentChannelCreate.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/paymentChannelCreate.ts (1)
  • validatePaymentChannelCreate (65-106)
packages/xrpl/test/models/XChainAddAccountCreateAttestation.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/XChainAddAccountCreateAttestation.ts (1)
  • validateXChainAddAccountCreateAttestation (89-123)
packages/xrpl/test/models/NFTokenCancelOffer.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/NFTokenCancelOffer.ts (1)
  • validateNFTokenCancelOffer (41-51)
packages/xrpl/test/models/AMMBid.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/AMMBid.ts (1)
  • validateAMMBid (61-106)
packages/xrpl/test/models/CredentialCreate.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/CredentialCreate.ts (1)
  • validateCredentialCreate (47-59)
packages/xrpl/test/models/AMMWithdraw.test.ts (3)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/AMMWithdraw.ts (1)
  • validateAMMWithdraw (83-125)
packages/xrpl/src/models/transactions/index.ts (1)
  • AMMWithdrawFlags (32-32)
packages/xrpl/test/models/offerCancel.test.ts (1)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/test/models/clawback.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/clawback.ts (1)
  • validateClawback (43-70)
packages/xrpl/src/models/transactions/NFTokenCreateOffer.ts (2)
packages/xrpl/src/models/transactions/index.ts (2)
  • NFTokenCreateOfferFlagsInterface (72-72)
  • NFTokenCreateOfferFlags (71-71)
packages/xrpl/src/models/utils/index.ts (1)
  • isFlagEnabled (25-28)
packages/xrpl/test/models/ticketCreate.test.ts (1)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/test/models/NFTokenCreateOffer.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/NFTokenCreateOffer.ts (1)
  • validateNFTokenCreateOffer (123-161)
packages/xrpl/test/models/AMMCreate.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/AMMCreate.ts (1)
  • validateAMMCreate (48-80)
packages/xrpl/test/models/MPTokenIssuanceSet.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/MPTokenIssuanceSet.ts (1)
  • validateMPTokenIssuanceSet (66-86)
packages/xrpl/test/models/XChainCommit.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/XChainCommit.ts (1)
  • validateXChainCommit (62-76)
packages/xrpl/test/models/XChainCreateClaimID.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/XChainCreateClaimID.ts (1)
  • validateXChainCreateClaimID (46-54)
packages/xrpl/test/models/XChainModifyBridge.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/XChainModifyBridge.ts (1)
  • validateXChainModifyBridge (69-77)
packages/xrpl/test/models/AMMDelete.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/AMMDelete.ts (1)
  • validateAMMDelete (37-55)
packages/xrpl/test/models/paymentChannelFund.test.ts (1)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/test/models/AMMDeposit.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/AMMDeposit.ts (1)
  • validateAMMDeposit (85-131)
packages/xrpl/test/models/MPTokenIssuanceCreate.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/MPTokenIssuanceCreate.ts (1)
  • validateMPTokenIssuanceCreate (124-180)
packages/xrpl/test/models/NFTokenMint.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/NFTokenMint.ts (1)
  • validateNFTokenMint (146-180)
packages/xrpl/test/models/payment.test.ts (3)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/payment.ts (1)
  • validatePayment (173-212)
packages/xrpl/src/models/transactions/index.ts (1)
  • PaymentFlags (88-88)
packages/xrpl/test/models/oracleSet.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/oracleSet.ts (1)
  • validateOracleSet (75-198)
packages/xrpl/test/models/XChainAddClaimAttestation.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/XChainAddClaimAttestation.ts (1)
  • validateXChainAddClaimAttestation (85-117)
🪛 Biome (1.9.4)
packages/xrpl/test/models/oracleDelete.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainAccountCreateCommit.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


[error] 87-87: 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] 48-48: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/DIDSet.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainCreateBridge.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/paymentChannelClaim.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/permissionedDomainDelete.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainClaim.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/trustSet.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMVote.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/paymentChannelCreate.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainAddAccountCreateAttestation.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMBid.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMWithdraw.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/offerCancel.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/ticketCreate.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMCreate.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMClawback.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainCommit.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainCreateClaimID.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainModifyBridge.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMDelete.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/paymentChannelFund.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMDeposit.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/payment.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/escrowCreate.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/escrowCancel.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/oracleSet.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainAddClaimAttestation.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

🔇 Additional comments (211)
packages/xrpl/HISTORY.md (1)

14-14: Good addition of documentation for the fix.

This entry clearly explains that a bug was fixed which caused some transactions to crash during validation.

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

72-72: Improved robustness by adding default value for Flags.

The addition of the nullish coalescing operator (??) ensures that flags will default to 0 when tx.Flags is undefined or null, preventing potential runtime errors during flag checks.

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

160-162: Fixed potential crash by adding default value for Flags.

Using the nullish coalescing operator to default tx.Flags to 0 when undefined or null prevents potential runtime errors during flag validation. This aligns with the related fix in MPTokenIssuanceSet.ts.

packages/xrpl/test/models/baseTransaction.test.ts (2)

6-9: Good refactoring with helper functions.

Creating assertValid and assertInvalid helper functions improves code readability and reduces duplication. This follows good DRY (Don't Repeat Yourself) principles.


64-64: Test code refactored for better maintainability.

All assertions have been updated to use the new helper functions, making the tests more consistent and easier to maintain while preserving the original test logic.

Also applies to: 73-73, 83-83, 93-93, 103-103, 113-116, 126-126, 136-136, 146-149, 159-159, 169-169, 183-183, 200-200, 209-209

packages/xrpl/test/models/NFTokenCancelOffer.test.ts (4)

1-7: Good refactoring approach with centralized test utilities

The introduction of helper functions assertValid and assertInvalid that utilize the shared test utilities creates a more consistent and maintainable test structure. This approach reduces duplication and standardizes validation assertions.


28-28: LGTM - Clean test refactoring

The refactored assertion using the helper function makes the test more concise while preserving the functionality.


40-40: LGTM - Consistent error validation

The refactored error assertion using assertInvalid enforces consistent validation between the specific validator and the generic validator.


53-53: LGTM - Consistent error validation

The refactored error assertion for empty NFTokenOffers now follows the same pattern as other validations.

packages/xrpl/test/models/escrowFinish.test.ts (4)

1-6: Good separation of concerns with helper functions

The introduction of assertValid and assertInvalid helper functions properly encapsulates the validation logic, making tests more readable and consistent.


14-14: LGTM - Explicit type annotation

Explicitly typing escrow as any makes the type expectations clearer.


31-31: LGTM - Consistent validation assertions

The positive validation tests now use the standardized assertValid helper, ensuring both specific and generic validation are checked consistently.

Also applies to: 39-39, 45-45


51-51: LGTM - Standardized error validation

The negative validation tests now use the standardized assertInvalid helper, which ensures both specific and generic validation throw the same errors.

Also applies to: 57-57, 63-63, 69-69, 78-78, 97-97, 105-105, 116-116, 128-128

packages/xrpl/test/models/checkCash.test.ts (3)

1-6: Good pattern for test utilities

The helper functions assertValid and assertInvalid effectively wrap the shared utilities, providing a clean interface specific to CheckCash validation.


24-24: LGTM - Improved valid transaction testing

Using the helper ensures both specific and generic validation are checked consistently.


35-35: LGTM - Improved error validation testing

The refactored error assertions using assertInvalid make the tests more concise while ensuring both validators are checked with the same error message.

Also applies to: 47-47, 60-63, 75-75

packages/xrpl/test/models/oracleDelete.test.ts (4)

1-6: Good extraction of test utilities

The helper functions create a clean abstraction for the validation testing, making the test code more focused and maintainable.


14-14: LGTM - Explicit type annotation

Explicitly typing tx as any improves code clarity.


25-25: LGTM - Standardized validation testing

The positive validation test now uses the standardized assertValid helper.


37-37: LGTM - Consistent error validation

Using the assertInvalid helper for invalid OracleDocumentID ensures both validators are checked with the same error message.

packages/xrpl/test/models/NFTokenModify.test.ts (3)

1-9: Improved test structure with reusable validation helpers

The implementation of helper functions assertValid and assertInvalid that wrap the transaction-specific validation creates a cleaner testing pattern. This approach reduces code duplication and simplifies test assertions throughout the file.


27-27: Standardized hex conversion

Good change replacing convertStringToHex with stringToHex from the isomorphic utilities package, which helps maintain consistency across the codebase.


30-30: Simplified validation assertions

The use of specialized helper functions improves test readability and makes error messages more consistent across the test suite.

Also applies to: 41-41, 54-54, 67-67

packages/xrpl/test/models/CredentialAccept.test.ts (3)

4-9: Improved test structure with reusable validation helpers

Good implementation of helper functions to standardize validation assertions, consistent with the pattern applied across other transaction test files.


17-17: Enhanced type clarity

Explicitly typing credentialAccept as any improves code readability and makes it clear that the variable has a flexible structure for testing different validation scenarios.


31-31: Consistent validation pattern

The consistent use of helper functions for all validation assertions improves maintainability and makes the test logic more apparent.

Also applies to: 37-37, 43-43, 49-49, 55-55, 61-61, 68-68, 75-75, 82-82

packages/xrpl/test/models/escrowCancel.test.ts (2)

2-6: Improved test structure with reusable validation helpers

The helper functions create a consistent pattern for testing transaction validation, making the tests more readable and maintainable.


14-14: Enhanced type clarity

Explicitly typing cancel as any improves code readability and clarifies its usage in the test cases.

packages/xrpl/test/models/checkCreate.test.ts (2)

2-6: Improved test structure with reusable validation helpers

The implementation of validation helper functions follows the consistent pattern applied across the transaction test files, improving code organization and readability.


27-27: Streamlined validation assertions

The use of the specialized helper functions makes the test assertions more concise and consistent, improving the overall quality of the test suite.

Also applies to: 43-43, 59-59, 75-78, 94-94, 109-109

packages/xrpl/test/models/ticketCreate.test.ts (5)

2-6: LGTM! Well-structured test helper extraction.

The addition of utility functions assertTxIsValid and assertTxValidationError from testUtils and the creation of local helper wrappers assertValid and assertInvalid makes the test code cleaner and more maintainable.


14-14: Appropriate type annotation for test object.

Changing the type to any is appropriate for test variables since we're testing validation scenarios with potentially invalid data structures.


25-25: Clean assertion replacement.

The use of the helper function assertValid simplifies the test code while maintaining the same validation checks.


30-30: Simplified validation error assertion.

Using assertInvalid with the specific error message improves readability while ensuring both specific and generic validators throw the expected error.


35-35: Consistent error validation pattern.

The rest of the test cases follow the same pattern of using assertInvalid with the appropriate error message. This consistent approach improves maintainability and readability.

Also applies to: 40-43, 48-51, 56-59

packages/xrpl/test/models/CredentialDelete.test.ts (3)

4-9: LGTM! Consistent test utilities implementation.

The implementation of test utilities follows the same pattern as other test files, enhancing consistency across the codebase.


17-17: Appropriate type annotation.

The explicit any type annotation for credentialDelete is appropriate for testing scenarios with potentially invalid data.


32-32: Consistent assertion refactoring across test cases.

All test assertions have been systematically refactored to use the helper functions, which improves code consistency and reduces duplication.

Also applies to: 38-38, 44-44, 50-50, 56-56, 64-64, 70-70, 77-77, 84-84, 91-91

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

3-10: LGTM! Well-structured imports and helper functions.

The refactoring includes appropriate imports and helper function definitions that follow the consistent pattern established across test files.


18-18: Clear variable naming.

Renaming to tx is more clear and consistent with the variable's purpose as a transaction object under test.


37-37: Simplified validation assertion.

Using assertValid simplifies the test code while maintaining the same validation checks.


44-44: Consistent error validation pattern.

All validation error test cases have been systematically refactored to use the assertInvalid helper, which improves code consistency and reduces duplication.

Also applies to: 51-51, 57-60, 65-68, 73-76, 81-84, 89-89

packages/xrpl/test/models/accountSet.test.ts (4)

2-6: LGTM! Consistent utility implementation.

The implementation of test utilities follows the same pattern as other test files, enhancing consistency across the codebase.


14-14: Improved variable naming.

Renaming from account to tx makes the variable name clearer and more consistent with its purpose as a transaction object under test.


30-30: Simplified validation assertion.

Using assertValid simplifies the test code while maintaining the same validation checks.


34-35: Consistent error validation pattern.

All validation error test cases have been systematically refactored to use the assertInvalid helper, which improves code consistency and readability.

Also applies to: 39-40, 44-45, 49-50, 54-55, 59-60, 64-65, 69-70, 74-75

packages/xrpl/test/models/oracleSet.test.ts (3)

4-8: Well-structured utility function implementation.

The addition of these helper functions greatly improves test readability and maintenance. By wrapping the generic assertion utilities with transaction-specific validation functions, you've created a clean interface for validation tests.


16-16: Good explicit typing for test variables.

Explicitly typing tx as any improves code clarity and follows the TypeScript pattern used in other test files.


41-42: Consistent test assertion pattern improves readability.

The replaced validation assertions with assertValid and assertInvalid helper functions make tests more consistent and easier to maintain. This standardized approach eliminates the need for repetitive try-catch blocks or direct assertion handling.

Also applies to: 47-48, 53-54, 59-60, 65-66, 71-72, 77-78, 83-84, 89-90, 96-97, 110-111, 117-118, 124-125, 131-132, 138-139, 145-146, 152-153, 160-161, 166-167, 173-174, 179-180, 185-186, 191-192

packages/xrpl/test/models/MPTokenIssuanceDestroy.test.ts (2)

1-7: Clean implementation of test utilities.

The refactoring follows the same pattern applied to other model test files, creating a consistent approach across the codebase. The helper functions assertValid and assertInvalid improve test clarity and maintainability.


24-24: Improved assertion pattern for validation tests.

The new assertion pattern is more concise and consistent with other test files in the codebase. This standardized approach eliminates the need for repetitive error handling code.

Also applies to: 33-36

packages/xrpl/test/models/NFTokenAcceptOffer.test.ts (2)

1-7: Consistent utility function implementation.

The refactoring follows the same pattern applied to other model test files, creating a consistent approach across the codebase. The helper functions provide a clean interface for validation tests.


30-30: Standardized assertion pattern improves test clarity.

The replacement of direct validation calls with helper functions makes the tests more concise and easier to understand. This consistent pattern across all test cases enhances maintainability.

Also applies to: 43-43, 55-58, 72-75, 89-92, 106-106, 121-121, 136-139, 154-157, 172-172

packages/xrpl/test/models/clawback.test.ts (2)

1-6: Well-structured utility function implementation.

The refactoring follows the same pattern applied throughout the test suite, improving consistency and readability. The helper functions encapsulate validation logic, making test assertions more concise.


25-25: Consistent test assertion pattern enhances readability.

The standardized approach to validation assertions eliminates repetitive error handling code and creates a consistent pattern across all test cases. This refactoring improves maintainability without changing the test coverage or validation criteria.

Also applies to: 34-34, 44-44, 52-52, 66-66, 80-80, 94-94, 107-107, 122-122

packages/xrpl/test/models/trustSet.test.ts (4)

2-6: Good refactoring: Helper functions improve test readability

The introduction of assertTxIsValid and assertTxValidationError utility functions, along with the local wrapper functions assertValid and assertInvalid, greatly improves the readability and maintainability of these tests. This approach centralizes the validation logic and makes test assertions more concise.


14-14: Type annotation improves code clarity

Adding the explicit any type to the trustSet variable makes the code more maintainable by clearly indicating the expected type, which is appropriate for test fixtures that need flexibility.


36-36: Simplified test assertion

Replacing the direct validation calls with the assertValid helper function makes the test more concise and focuses on what's being tested rather than how it's being tested.


41-41: Consistent error validation pattern

Using the assertInvalid helper provides a consistent way to test validation failures across all tests, which improves maintainability.

packages/xrpl/test/models/MPTokenIssuanceCreate.test.ts (13)

1-5: Good import refactoring

Replacing convertStringToHex with stringToHex from the isomorphic utilities package and updating the imports to include the validation utilities is a good practice that aligns with modern dependency management.


7-10: Helper functions improve test clarity

The introduction of assertValid and assertInvalid helper functions creates a more readable and maintainable testing pattern by abstracting away the validation details.


27-27: Updated to use stringToHex utility

Correctly updated to use the stringToHex utility function from the isomorphic package, which improves cross-platform compatibility.


30-30: Improved test assertion

The test assertion has been simplified by using the assertValid helper, focusing the test on what's being validated rather than the validation mechanics.


41-44: Consistent error message testing

The refactored code maintains the same validation error message checks but in a more standardized and readable format using the helper functions.


55-58: Standardized validation testing

The refactored code ensures consistent validation testing across different test cases, making the codebase more maintainable.


68-68: Simplified error case testing

The single-line assertion makes the test case more concise while still validating the same error condition.


76-76: Consistent error validation pattern

The consistent use of assertInvalid across all error test cases improves code readability and maintainability.


84-84: Standardized error validation

Using the same helper function for different error scenarios ensures consistent testing patterns throughout the test suite.


94-97: Improved error message testing

The helper function correctly validates that both the specific validator and the generic validate function throw the expected error message.


105-108: Consistent validation testing

Maintaining the same pattern across different test cases improves code readability and reduces cognitive load when reviewing the tests.


116-119: Consistent error validation

Using a standardized approach for validating complex error conditions involving flag checks improves test clarity.


128-131: Standardized complex validation testing

The helper function handles complex validation scenarios involving flag combinations consistently across the test suite.

packages/xrpl/test/models/escrowCreate.test.ts (13)

2-6: Good refactoring: Helper functions improve test consistency

Adding assertTxIsValid and assertTxValidationError utilities with local wrappers assertValid and assertInvalid provides a more consistent testing approach across the codebase.


14-14: Type annotation improves code clarity

Adding the explicit any type to the escrow variable makes the code more maintainable by clearly indicating the expected type.


32-32: Simplified test assertion

The replaced assertion improves readability while maintaining the same validation logic.


38-38: Consistent error validation pattern

Using the assertInvalid helper provides a consistent pattern for testing validation failures.


44-44: Standardized error testing

The consistent use of assertInvalid across different test cases reduces code duplication and improves maintainability.


50-50: Improved error validation

The helper function correctly validates that both the specific validator and the generic validate function throw the expected error message.


56-56: Consistent validation approach

Maintaining the same assertion pattern across different test cases enhances readability.


62-62: Standardized validation testing

Using a consistent approach for validating different field types improves code readability.


68-68: Consistent error testing pattern

The helper function effectively validates error conditions for the FinishAfter field.


74-74: Standardized validation testing

The consistent use of helper functions across different test cases simplifies the test code.


80-80: Improved error validation

The helper function effectively validates the error condition for invalid DestinationTag fields.


87-90: Cleaner validation of complex conditions

Using the helper function to test more complex validation rules involving multiple fields creates more maintainable test code.


97-100: Consistent complex validation testing

The helper functions handle complex validation scenarios involving multiple fields consistently across the test suite.

packages/xrpl/test/models/XChainAccountCreateCommit.test.ts (11)

2-7: Good refactoring: Helper functions improve test consistency

The introduction of assertTxIsValid and assertTxValidationError utilities with local wrappers assertValid and assertInvalid provides a more consistent testing approach across the codebase. This standardizes validation testing and improves readability.


15-15: Type annotation improves code clarity

Adding the explicit any type to the tx variable makes the code more maintainable by clearly indicating the expected type for the test fixture.


41-41: Simplified test assertion

Using the assertValid helper function makes the test more concise and readable.


47-47: Standardized error validation

The consistent use of assertInvalid for testing validation failures improves test code readability.


53-53: Consistent validation approach

Maintaining the same assertion pattern across different test cases enhances readability and maintainability.


59-62: Standardized multi-line validation

The helper function effectively handles multi-line validation error messages in a consistent format.


68-71: Improved error validation

Using the helper function consistently for different validation scenarios reduces code duplication.


77-77: Standardized validation testing

The consistent approach for testing missing required fields improves code readability.


83-83: Consistent error testing pattern

Using the helper function for testing invalid field types maintains consistency across test cases.


89-89: Standardized validation testing

The helper function effectively tests missing required fields in a consistent manner.


95-95: Consistent validation approach

The helper function maintains consistent validation testing for invalid field types.

packages/xrpl/test/models/paymentChannelCreate.test.ts (3)

2-7: Good refactoring to improve test consistency

The introduction of helper functions assertValid and assertInvalid that wrap the utility functions from testUtils simplifies the test code and makes it more consistent across the test suite. This pattern makes the test assertions more readable and maintainable.


15-15: LGTM: Explicit type annotation added

Explicitly typing the channel variable as any clarifies the intent and prevents potential type errors.


33-33: Consistent assertion pattern applied throughout tests

The consistent use of the new helper functions assertValid and assertInvalid across all test cases improves code clarity and maintainability. This standardized approach makes it easier to understand the expected behavior in each test case.

Also applies to: 41-41, 47-47, 53-53, 59-59, 65-65, 71-71, 77-77, 83-83, 89-89, 95-95, 101-101

packages/xrpl/test/models/AMMVote.test.ts (3)

2-6: Good refactoring to standardize test assertions

The introduction of helper functions assertValid and assertInvalid that wrap the utility functions from testUtils improves code clarity and consistency across the test suite. This approach centralizes validation logic and makes tests more maintainable.


14-14: LGTM: Explicit type annotation added

Explicitly typing the vote variable as any clarifies the intent and prevents potential type errors in the test code.


33-33: Consistent assertion pattern applied throughout tests

The consistent use of the new helper functions across all test cases improves code clarity and maintainability. This standardized approach makes it easier to understand the expected behavior in each test case.

Also applies to: 39-39, 45-45, 51-51, 57-57, 63-63, 69-69, 75-75, 81-81

packages/xrpl/test/models/AMMCreate.test.ts (3)

2-6: Good refactoring to standardize test assertions

The introduction of helper functions assertValid and assertInvalid that wrap the utility functions from testUtils improves code clarity and consistency across the test suite. This approach centralizes validation logic and makes tests more maintainable.


14-14: LGTM: Type annotations improved

The explicit typing of ammCreate as any and removal of the redundant as any type casting at the end of the object declaration improves type clarity in the code.

Also applies to: 28-28


32-32: Consistent assertion pattern applied throughout tests

The consistent use of the new helper functions across all test cases improves code clarity and maintainability. This standardized approach makes it easier to understand the expected behavior in each test case.

Also applies to: 38-38, 44-44, 50-50, 56-56, 62-62, 68-68, 74-74, 80-80

packages/xrpl/test/models/NFTokenBurn.test.ts (2)

1-6: Good refactoring to standardize test assertions

The introduction of helper functions assertValid and assertInvalid that wrap the utility functions from testUtils improves code clarity and makes the tests more consistent with the rest of the test suite. This approach centralizes validation logic and makes tests more maintainable.


27-27: Consistent assertion pattern applied throughout tests

The refactoring to use the new helper functions assertValid and assertInvalid makes the test assertions more consistent with the test patterns used in other files, improving overall code readability and maintainability.

Also applies to: 39-39

packages/xrpl/test/models/XChainAddClaimAttestation.test.ts (3)

2-7: Great abstraction with helper functions!

The introduction of assertValid and assertInvalid helper functions makes the test code more concise and consistent. This approach centralizes validation logic and reduces code duplication across test cases.


15-15: Good practice adding explicit typing

Explicitly typing tx as any improves code clarity and makes the TypeScript compiler happy.


49-49: Clean implementation of the refactored assertions

Replacing direct validation calls with the helper functions makes the tests more readable and maintainable. The refactoring maintains the same validation logic while streamlining the code.

Also applies to: 55-55, 61-61, 67-69

packages/xrpl/test/models/XChainCreateBridge.test.ts (3)

2-7: Excellent use of utility functions for consistent test patterns

The introduction of assertValid and assertInvalid helper functions follows the same pattern as other test files, providing a consistent approach to transaction validation testing throughout the codebase.


15-15: Good practice with explicit typing

Explicitly typing tx as any improves code clarity and helps with TypeScript's type checking.


40-40: Clean and consistent implementation

The refactored assertions maintain the same validation checks but with cleaner, more maintainable code. This approach makes error messages more visible and centralizes the validation logic.

Also applies to: 46-46, 52-52, 58-58, 64-64, 70-73

packages/xrpl/test/models/offerCancel.test.ts (4)

2-6: Good pattern with helper functions

The addition of assertValid and assertInvalid helper functions follows the same consistent pattern seen in other test files, making the test code more concise and easier to maintain.


14-14: Good practice with explicit typing

Explicitly typing the offer variable as any improves code clarity and TypeScript type awareness.


33-33: Clean implementation of refactored assertions

The updated assertion calls make the tests more readable and consistent with other transaction model tests.

Also applies to: 38-38, 43-44, 48-48


42-42: Good improvement to test clarity

Changing the invalid OfferSequence value from what was likely a numeric string to a clearly non-numeric string 'abcd' makes the test more explicit about what's being tested - that OfferSequence must be a number.

packages/xrpl/test/models/signerListSet.test.ts (3)

2-7: Well-implemented helper functions

The introduction of assertValid and assertInvalid helper functions follows the same consistent pattern as other test files, improving code readability and maintaining consistent validation checks.


15-15: Good practice with explicit typing

Explicitly typing signerListSetTx as any improves code clarity and TypeScript type checking.


48-48: Clean and consistent assertion implementation

The refactored assertions maintain the same validation logic while making the code more concise and easier to read. The consistent pattern across tests enhances maintainability.

Also applies to: 54-54, 60-63, 69-69, 121-121, 151-151, 173-173

packages/xrpl/test/models/AMMDelete.test.ts (3)

2-6: Clean refactoring using utility functions!

The introduction of assertTxIsValid and assertTxValidationError utilities, wrapped in local helper functions assertValid and assertInvalid, is an excellent refactoring choice. This approach simplifies the test code and provides a consistent validation pattern across the test suite.


14-14: Good type annotation.

Explicitly typing ammDelete as any improves clarity about the variable's intended usage.


33-33: Tests are simplified and consistent.

The test assertions are now more readable and consistent, using the new helper functions while maintaining the same validation coverage.

Also applies to: 39-39, 45-45, 51-51, 57-57

packages/xrpl/test/models/AMMBid.test.ts (3)

2-6: Well-structured refactoring using utility functions!

The introduction of imported assertion utilities and local helper functions creates a clean abstraction and improves test readability. This consistent pattern makes the validation logic more maintainable.


14-14: Good type annotation.

Explicitly typing bid as any improves code clarity.


64-64: Tests are simplified and consistent.

The test assertions have been successfully refactored to use the new helper functions, making them more concise while maintaining the same validation coverage.

Also applies to: 70-70, 76-76, 82-82, 88-88, 94-94, 100-100, 111-111, 117-117, 133-133, 141-141, 151-151, 162-162

packages/xrpl/test/models/AMMClawback.test.ts (3)

5-9: Excellent refactoring using utility functions!

The introduction of assertion utilities and helper functions simplifies the test code and provides a consistent pattern for validation. This approach improves maintainability and readability.


17-17: Good type annotation.

Explicitly typing ammClawback as any improves code clarity.


41-41: Tests are simplified and consistent.

The test assertions are now more readable and consistent using the new helper functions while maintaining the same validation coverage.

Also applies to: 46-46, 51-51, 57-57, 63-63, 69-69, 75-75, 81-81, 87-87, 93-93, 99-99, 105-105, 112-112, 118-118

packages/xrpl/test/models/DIDSet.test.ts (3)

2-6: Great refactoring with utility functions!

The introduction of assertion utilities and helper functions provides a clean abstraction that simplifies test code and creates a consistent validation pattern.


14-14: Good type annotation.

Explicitly typing tx as any improves code clarity.


30-30: Tests are simplified and consistent.

The test assertions have been successfully refactored to use the new helper functions, making them more concise while maintaining the same validation coverage.

Also applies to: 36-36, 42-42, 48-48, 56-59

packages/xrpl/test/models/XChainClaim.test.ts (3)

2-6: Helper functions improve code maintainability.

The introduction of utility imports and helper functions is a good refactoring. This centralizes validation logic and makes test assertions more consistent and concise.


14-14: Explicit type annotation clarifies variable usage.

Explicitly typing tx as any makes it clear that the transaction object doesn't conform to a specific interface, which is helpful for understanding the test context.


40-40: Test assertions refactored to use helper functions.

The replacement of direct validation calls with helper functions makes the test code more concise and easier to maintain. This approach ensures consistent validation behavior across tests.

Also applies to: 46-46, 52-52, 58-58, 64-64, 70-70, 76-76, 82-82, 88-88, 94-94

packages/xrpl/test/models/checkCancel.test.ts (2)

2-6: Improved test structure with helper functions.

The addition of utility imports and helper functions simplifies the test code and ensures consistent validation behavior across test cases.


22-22: Simplified test assertions.

Using the helper functions makes the test assertions more concise while maintaining the same validation coverage. This is a good refactoring that aligns with the pattern used across other test files.

Also applies to: 32-32

packages/xrpl/test/models/AMMDeposit.test.ts (3)

3-9: Streamlined test setup with helper functions.

The refactoring improves code maintainability by:

  1. Using specific import for AMMDepositFlags instead of a broader import
  2. Adding utility functions for consistent validation assertions
  3. Creating helper functions that encapsulate the validation logic

This approach reduces duplication and ensures consistent testing patterns.


22-22: Explicit type annotation adds clarity.

Explicitly typing deposit as any clarifies that the transaction object is loosely typed in the test context, which is appropriate for testing validation behavior.


43-43: Simplified test assertions with helper functions.

The replacement of direct assertions with helper functions makes the test code more concise and easier to maintain, while preserving the same validation logic.

Also applies to: 49-49, 60-60, 67-67, 74-74, 80-80, 86-86, 92-92, 98-98, 103-103, 113-113, 119-119, 126-126, 132-132, 139-139, 146-146

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

149-155: Improved robustness for flags handling.

This change properly handles the Flags field by:

  1. Setting a default value of 0 when Flags is undefined or null
  2. Supporting both numeric and object representations for flags
  3. Using nullish coalescing to provide a default value for tfSellNFToken

This prevents potential runtime errors when checking flags and makes the validation more robust.


156-156: Simplified conditional using extracted flag value.

Using the previously computed isTfSellNFToken value for the conditional makes the code more readable and directly connects to the logic in lines 151-154.

packages/xrpl/test/models/MPTokenAuthorize.test.ts (7)

2-3: Clean import restructuring to support the refactoring pattern.

Nice job updating the imports to include only what's needed for the new helper pattern, removing unnecessary imports.


5-8: Good introduction of helper functions for cleaner test assertions.

These helper functions nicely encapsulate the validation logic, making the test code more readable and maintainable. The pattern of creating local wrapper functions makes the test assertions much more concise.


25-25: Clean replacement of direct assertion with helper function.

The new assertion style is more concise and consistent with the broader refactoring pattern being applied across test files.


34-34: Consistent application of the assertion helper pattern.

This change follows the same pattern as the previous test case, maintaining consistency throughout the file.


43-43: Consistent validation approach for flag testing.

Good job applying the same validation pattern when testing with flags.


53-53: Consistent validation approach for complex test cases.

The helper pattern is consistently applied even for more complex test cases, improving readability.


62-62: Effective use of the error assertion helper for validation testing.

The assertInvalid helper appropriately checks for the expected validation error, maintaining the same validation logic while simplifying the test code.

packages/xrpl/test/models/paymentChannelFund.test.ts (3)

2-7: Well-structured helper functions for consistent test assertions.

Good job introducing the helper functions that standardize validation patterns across test files. This makes the tests more maintainable and easier to understand.


15-15: Improved type clarity by explicitly typing the channel variable.

Explicitly typing channel as any makes the code more readable and consistent with TypeScript best practices.


29-29: Consistent application of assertion helpers throughout all test cases.

All test assertions have been consistently updated to use the new helper functions, making the test suite more uniform and easier to maintain.

Also applies to: 35-35, 41-41, 47-47, 53-53, 59-59, 65-65

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

2-7: Well-structured helper functions that simplify the test code.

The helper functions effectively encapsulate the validation logic, making the test assertions more concise and readable.


15-15: Improved type clarity with explicit typing.

Explicitly typing tx as any improves code readability and TypeScript compliance.


27-27: Consistent application of the assertion pattern across all test cases.

Good job applying the new assertion pattern consistently throughout all test cases, maintaining a uniform testing approach.

Also applies to: 33-33, 39-39

packages/xrpl/test/models/offerCreate.test.ts (4)

2-6: Well-designed helper functions that improve test readability.

The helper functions effectively encapsulate the validation logic, making the test assertions more concise and consistent across the codebase.


36-37: Clean replacement of validation assertions with helper functions.

The new assertion style is more concise and readable, reducing boilerplate code while maintaining the same test logic.

Also applies to: 59-60, 86-87


39-39: Clear, descriptive test case titles.

The test case titles accurately describe what's being tested, making the test suite easier to understand and maintain.

Also applies to: 62-62


110-110: Consistent error validation pattern across all test cases.

Good job applying the same error validation pattern consistently across all invalid test cases, which improves maintainability.

Also applies to: 134-134, 154-154, 178-178

packages/xrpl/test/models/setRegularKey.test.ts (3)

2-7: Good refactoring to use assertion utilities!

The introduction of the assertTxIsValid and assertTxValidationError utilities with local wrapper functions assertValid and assertInvalid improves code consistency and readability. This pattern encapsulates both the specific and generic validation checks in a cleaner way.


15-15: Improved variable naming for clarity

Renaming the variable from account to tx makes the purpose clearer and matches the naming convention used across other test files.


28-28: Standardized validation approach

The replacement of direct validation calls with the helper functions creates a consistent pattern for validation, making the tests more maintainable and easier to understand.

Also applies to: 32-34, 37-39

packages/xrpl/test/models/NFTokenCreateOffer.test.ts (3)

1-8: Well-structured test utilities setup

Good implementation of the helper functions that wrap the transaction validation utilities. This pattern encapsulates the validation logic and makes the tests more concise and readable.


32-32: Improved validation assertions for successful cases

The refactoring to use assertValid() simplifies the positive test cases and ensures consistent validation via both the specific validator and the generic validate function.

Also applies to: 50-50, 66-66


81-84: Improved error validation consistency

The refactoring to use assertInvalid() with expected error messages creates a more consistent pattern for error validation across all test cases. This approach ensures that both the specific validator and the generic validate function throw the same error with the expected message.

Also applies to: 100-103, 118-118, 134-134, 149-149, 165-168, 182-185, 200-203

packages/xrpl/test/models/XChainCommit.test.ts (3)

2-6: Clean implementation of validation utilities

The helper functions are concisely defined and maintain the same validation behavior while improving code readability.


14-14: Explicit typing improves code clarity

Adding explicit type annotation tx: any improves code clarity and maintainability.


39-39: Consistent validation pattern across test cases

The updated validation assertions create a uniform pattern that's easier to follow and maintain.

Also applies to: 45-45, 51-51, 57-57, 63-63, 69-69, 75-75, 81-81

packages/xrpl/test/models/MPTokenIssuanceSet.test.ts (3)

1-8: Good implementation of test utilities

The import of specific flags and validation functions along with the implementation of helper functions for validation assertions creates a clean and maintainable test structure.


26-26: Simplified validation for successful test cases

The refactoring to use assertValid() improves code readability while maintaining the same validation logic.

Also applies to: 36-36, 46-46


55-58: Consistent error validation

The refactoring to use assertInvalid() creates a uniform pattern for validating error cases, improving consistency across the test suite.

Also applies to: 72-72, 76-76

packages/xrpl/test/models/XChainAddAccountCreateAttestation.test.ts (4)

2-11: Excellent refactoring to improve test consistency

The introduction of helper functions assertValid and assertInvalid that wrap the utility functions from testUtils greatly improves code readability and maintainability. This pattern centralizes validation logic and simplifies all test cases by removing redundant code.


19-19: Good explicit typing

Explicitly typing tx as any clarifies the intention and matches the parameter types expected by the utility functions.


55-56: Improved test assertion

Replacing the direct validation with the assertValid helper function makes the test more concise and consistent with the rest of the test suite.


61-62: Simplified validation error assertion

Using the assertInvalid helper function reduces boilerplate and makes the test intent clearer.

packages/xrpl/test/models/accountDelete.test.ts (5)

2-7: Consistent refactoring approach

The helper functions match the pattern used across other test files, providing a unified approach to transaction validation testing.


15-15: Proper variable typing

Explicitly typing validAccountDelete as any ensures type consistency with the helper functions.


29-30: Enhanced test fixture definition

The test fixture is now more cleanly defined with proper typing.


32-33: Simplified valid transaction testing

The assertValid helper function makes the successful validation test more readable.


38-39: Consistent error validation pattern

Using the assertInvalid helper maintains consistency with the project's new testing pattern.

packages/xrpl/test/models/XChainCreateClaimID.test.ts (4)

2-7: Well-implemented helper functions

These helper functions effectively wrap the imported utility functions, providing a clean interface for test assertions.


15-15: Appropriate typing

Explicitly typing tx as any matches the approach taken across the codebase.


40-41: Clear and concise validation testing

The assertValid helper simplifies the test and improves readability.


46-47: Consistent error validation

The assertInvalid helper function provides a clean way to test for specific validation errors.

packages/xrpl/test/models/XChainModifyBridge.test.ts (4)

2-7: Consistent helper function implementation

The helper functions here match the pattern used across other test files, maintaining consistency throughout the test suite.


15-15: Proper type declaration

Explicitly typing tx as any matches the approach used in other test files.


40-41: Simplified validation testing

Using assertValid makes the test more readable and consistent with other test files.


64-67: Improved multi-line assertion

The multi-line format for longer error messages improves readability while maintaining the consistent testing pattern.

packages/xrpl/test/models/depositPreauth.test.ts (3)

3-10: Clean refactoring with improved test utilities

The introduction of assertTxIsValid and assertTxValidationError utilities with local wrapper functions assertValid and assertInvalid is a good improvement that removes duplicate validation code across test files.


18-18: Good practice explicitly typing test variables

Explicitly typing the test variable as any improves code clarity, especially when dealing with test fixtures.


36-36: Clean test assertion

The refactored code uses the new utility function which improves readability while maintaining the same validation logic.

packages/xrpl/test/models/NFTokenMint.test.ts (2)

1-9: Good refactoring to use standardized utilities

The file now uses the centralized validation utilities and adds local wrapper functions to improve test readability. Using the standardized stringToHex from the isomorphic utilities package is also a good improvement.


29-29: Consistent hex encoding for URIs

Using the standard stringToHex function ensures consistent encoding of URIs across the codebase.

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

3-9: Good refactoring with standardized test utilities

The refactored code now uses the centralized test utilities with local wrapper functions that improve test readability and maintainability.

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

1-7: Good refactoring with standardized test utilities

The refactored code follows the consistent pattern of using centralized test utilities with local wrapper functions that improve readability and maintainability.

packages/xrpl/test/models/CredentialCreate.test.ts (5)

4-5: Good refactoring: Using utility functions for validation tests

The import of assertTxIsValid and assertTxValidationError from testUtils is a good addition that will simplify test code and standardize validation patterns across the test suite.


6-9: LGTM: Helper functions improve readability

Creating assertValid and assertInvalid helper functions is a good approach that makes the test code more concise and readable while still maintaining the validation logic consistency.


17-17: LGTM: Explicit type annotation

Explicitly typing credentialCreate as any improves code clarity.


33-33: LGTM: Simplified validation assertion

Using the helper function assertValid simplifies the test code while maintaining the same validation checks.


39-39: LGTM: Consistent error validation pattern

Using assertInvalid consistently across all error test cases improves code readability and maintainability.

packages/xrpl/test/models/payment.test.ts (5)

3-5: Good refactoring: Improved imports

Importing PaymentFlags directly and adding the test utility functions improves code organization and makes the intention of the code clearer.


7-9: LGTM: Helper functions improve readability

Creating assertValid and assertInvalid helper functions is a good approach that makes the test assertions more consistent and easier to understand.


17-17: LGTM: Renaming for brevity

Shortening the variable name from paymentTransaction to payment improves readability throughout the test file.


98-99: LGTM: Testing X-address validation

Good test case ensuring validation works correctly with X-addresses.


128-130: LGTM: Clear validation with flags

Using the imported PaymentFlags enum improves code clarity compared to using numeric literals.

packages/xrpl/test/models/DIDDelete.test.ts (3)

2-4: LGTM: Consistent test refactoring

The refactoring aligns with the pattern used in other test files, making the codebase more consistent.


12-12: LGTM: Explicit type annotation

Explicitly typing tx as any improves code clarity.


25-25: LGTM: Simplified validation assertion

Using the helper function simplifies the test while maintaining the validation logic.

packages/xrpl/test/testUtils.ts (3)

8-13: LGTM: Updated imports

Adding validate and ValidationError imports is necessary for the new utility functions.


60-69: LGTM: Excellent utility function for validation success

Well-documented function that encapsulates the pattern of checking both transaction-specific validation and generic validation, improving code reuse across test files.


71-85: LGTM: Great complementary utility for validation failures

This function pairs well with assertTxIsValid to provide a complete validation testing toolkit. The JSDoc comments clearly explain the purpose and parameters.

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: 0

🧹 Nitpick comments (35)
packages/xrpl/test/models/escrowCancel.test.ts (1)

36-36: Minor suggestion regarding delete operator.

Consider using undefined assignment instead of the delete operator for slightly better performance, e.g., cancel.Owner = undefined instead of delete cancel.Owner.

-    delete cancel.Owner
+    cancel.Owner = undefined
-    delete cancel.OfferSequence
+    cancel.OfferSequence = undefined

Also applies to: 42-42

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

44-44: Consider using undefined assignment instead of delete.

The static analysis tool flagged the use of the delete operator, which can impact performance.

-    delete tx.XChainBridge
+    tx.XChainBridge = undefined
-    delete tx.SignatureReward
+    tx.SignatureReward = undefined

Also applies to: 56-56

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

37-39: Consider using undefined assignment instead of delete operator.

The static analysis tool flagged the use of the delete operator, which can impact performance.

-    delete channel.CancelAfter
-    delete channel.DestinationTag
-    delete channel.SourceTag
+    channel.CancelAfter = undefined
+    channel.DestinationTag = undefined
+    channel.SourceTag = undefined

Similarly for the other delete operations in the file.

Also applies to: 45-45, 51-51, 57-57, 63-63

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMVote.test.ts (3)

37-40: Consider using undefined assignment instead of delete.

The static analysis tool suggests avoiding the delete operator which can impact performance.

-    delete vote.Asset
+    vote.Asset = undefined
     const errorMessage = 'AMMVote: missing field Asset'
     assertInvalid(vote, errorMessage)
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


49-52: Consider using undefined assignment instead of delete.

The static analysis tool suggests avoiding the delete operator which can impact performance.

-    delete vote.Asset2
+    vote.Asset2 = undefined
     const errorMessage = 'AMMVote: missing field Asset2'
     assertInvalid(vote, errorMessage)
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


61-64: Consider using undefined assignment instead of delete.

The static analysis tool suggests avoiding the delete operator which can impact performance.

-    delete vote.TradingFee
+    vote.TradingFee = undefined
     const errorMessage = 'AMMVote: missing field TradingFee'
     assertInvalid(vote, errorMessage)
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

29-32: Consider using undefined assignment instead of delete.

The static analysis tool suggests avoiding the delete operator which can impact performance.

-    delete tx.OracleDocumentID
+    tx.OracleDocumentID = undefined
     const errorMessage = 'OracleDelete: missing field OracleDocumentID'
     assertInvalid(tx, errorMessage)
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

40-42: Consider using undefined assignment instead of delete.

The static analysis tool suggests avoiding the delete operator which can impact performance.

-    delete trustSet.LimitAmount
+    trustSet.LimitAmount = undefined
     assertInvalid(trustSet, 'TrustSet: missing field LimitAmount')
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

15-15: Consider using a more specific type than any

While using any is acceptable for test code, consider using a more specific type for better type safety. You could create an interface or type that matches the expected structure of the transaction object.

-  let tx: any
+  let tx: {
+    TransactionType: string
+    Account: string
+    DomainID?: string
+    [key: string]: unknown
+  }

31-31: Consider alternatives to the delete operator

The static analysis tool flagged the use of the delete operator, which can have performance implications. While not critical in test code, you might consider setting properties to undefined instead.

-    delete tx.DomainID
+    tx.DomainID = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMCreate.test.ts (2)

14-14: Consider using a more specific type than any

While using any works for test code, a more specific type would provide better type safety and documentation of the expected structure.

-  let ammCreate: any
+  let ammCreate: {
+    TransactionType: string
+    Account: string
+    Amount: string | object
+    Amount2: object
+    TradingFee?: number
+    Sequence: number
+    [key: string]: unknown
+  }

36-36: Static analysis warning about delete operator

The static analysis tool flagged multiple uses of the delete operator. While this is not critical in test code, consider alternative approaches for consistency with coding standards.

-    delete ammCreate.Amount
+    ammCreate.Amount = undefined

-    delete ammCreate.Amount2
+    ammCreate.Amount2 = undefined

-    delete ammCreate.TradingFee
+    ammCreate.TradingFee = undefined

Also applies to: 48-48, 60-60

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

17-17: Consider using a more specific type than any

Using a more specific type would improve type safety and better document the expected structure of the transaction object.

-  let credentialAccept: any
+  let credentialAccept: {
+    TransactionType: string
+    Issuer: string | number | undefined
+    Account: string | number | undefined
+    CredentialType: string | undefined
+    Sequence: number
+    Flags: number
+    [key: string]: unknown
+  }
packages/xrpl/test/models/NFTokenCancelOffer.test.ts (1)

26-26: Consider using more specific types

The test objects are cast to any type. While this works for test code, consider using more specific types to improve type safety.

-    } as any
+    } as {
+      TransactionType: string
+      NFTokenOffers?: string[]
+      Account: string
+      Fee: string
+      Sequence: number
+      Flags: number
+    }

Also applies to: 38-38, 51-51

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

45-45: Consider replacing delete with undefined assignment.

The delete operator can impact performance. Consider using undefined assignment instead.

-    delete tx.XChainBridge
+    tx.XChainBridge = undefined

-    delete tx.SignatureReward
+    tx.SignatureReward = undefined

-    delete tx.Destination
+    tx.Destination = undefined

-    delete tx.Amount
+    tx.Amount = undefined

Also applies to: 57-57, 75-75, 87-87

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

52-54: Consider using undefined assignment instead of delete for better performance

Static analysis suggests avoiding the delete operator for performance reasons.

-    delete tx.Data
-    delete tx.DIDDocument
-    delete tx.URI
+    tx.Data = undefined
+    tx.DIDDocument = undefined
+    tx.URI = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

36-36: Consider using undefined assignment instead of delete for better performance

Static analysis suggests avoiding the delete operator for performance reasons.

For example, replace:

-    delete escrow.Amount
+    escrow.Amount = undefined

Similarly for other delete operations in this file.

Also applies to: 42-42, 84-85, 94-95

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

37-37: Consider using undefined assignment instead of delete for better performance

Static analysis suggests avoiding the delete operator for performance reasons.

-    delete ammDelete.Asset
+    ammDelete.Asset = undefined

And similarly for ammDelete.Asset2.

Also applies to: 49-49

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

33-33: Consider using undefined assignment instead of delete.

The static analysis tool flags multiple uses of the delete operator. While this works, it can impact performance.

- delete channel.Expiration
+ channel.Expiration = undefined
- delete channel.Amount
+ channel.Amount = undefined
- delete channel.Channel
+ channel.Channel = undefined

Also applies to: 39-39, 45-45

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

59-59: Consider using undefined assignment instead of delete.

The static analysis tool flags multiple uses of the delete operator. While this works, it can impact performance.

- delete tx.Amount
+ tx.Amount = undefined

Apply similar changes to the other delete operations throughout the file.

Also applies to: 71-71, 89-89, 107-107, 125-125, 143-143, 161-161, 179-179, 197-197, 215-215, 233-233

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

73-73: Consider alternatives to the delete operator.

The delete operator can negatively impact performance. Consider using undefined assignment instead.

-    delete payment.Amount
+    payment.Amount = undefined
-    delete payment.Destination
+    payment.Destination = undefined

Also applies to: 83-83

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

89-89: Consider alternatives to the delete operator.

The delete operator can impact performance. Consider using undefined assignment instead.

-    delete withdraw.Asset
+    withdraw.Asset = undefined
-    delete withdraw.Asset2
+    withdraw.Asset2 = undefined

Also applies to: 101-101

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

44-44: Consider using undefined assignment instead of delete operator.

The static analysis tool flagged the use of the delete operator, which can have minor performance implications. While not critical for test code, consider using undefined assignment instead.

-delete tx.XChainBridge
+tx.XChainBridge = undefined

Also applies to: 56-56, 68-68, 86-86

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

46-46: Consider using undefined assignment instead of delete operator.

The static analysis tool flagged the use of the delete operator. For consistency with best practices:

-delete channel.Channel
+channel.Channel = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

45-45: Consider using undefined assignment instead of delete operator.

Multiple uses of the delete operator were flagged by static analysis. While acceptable in test code, consider using undefined assignment for consistency with best practices:

-delete tx.OracleDocumentID
+tx.OracleDocumentID = undefined

Also applies to: 57-57, 114-114, 128-128, 135-135, 142-142, 149-149

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

53-53: Consider using undefined assignment instead of delete operator.

Multiple uses of the delete operator were flagged by static analysis. While not critical for test code, using undefined assignment would be more consistent with best practices:

-delete tx.Amount
+tx.Amount = undefined

Also applies to: 65-65, 83-83, 107-107, 125-125, 137-137, 149-149, 167-167, 179-179

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

44-44: Consider using undefined assignment instead of delete.

Using the delete operator can impact performance. Consider using undefined assignment instead.

-    delete tx.XChainBridge
+    tx.XChainBridge = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

29-30: Consider using assignment instead of delete.

The delete operator can impact performance. Consider using undefined assignment instead.

-  delete ticketCreate.TicketCount
+  ticketCreate.TicketCount = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainCreateClaimID.test.ts (3)

44-46: Consider using assignment instead of delete.

The delete operator can impact performance. Consider using undefined assignment instead.

-    delete tx.XChainBridge
+    tx.XChainBridge = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


56-58: Consider using assignment instead of delete.

The delete operator can impact performance. Consider using undefined assignment instead.

-    delete tx.SignatureReward
+    tx.SignatureReward = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


68-70: Consider using assignment instead of delete.

The delete operator can impact performance. Consider using undefined assignment instead.

-    delete tx.OtherChainSource
+    tx.OtherChainSource = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

43-43: Consider replacing delete operator with undefined assignment.

The delete operator can impact performance as flagged by static analysis. Consider using undefined assignment instead:

-    delete tx.XChainBridge
+    tx.XChainBridge = undefined

-    delete tx.XChainClaimID
+    tx.XChainClaimID = undefined

-    delete tx.Amount
+    tx.Amount = undefined

Also applies to: 55-55, 73-73

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

47-48: Consider using undefined assignment instead of delete

Static analysis suggests avoiding the delete operator for performance reasons.

-  delete offer.OfferSequence
+  offer.OfferSequence = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

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

44-47: Performance optimization opportunity

Static analysis suggests avoiding the delete operator for performance reasons. Consider using undefined assignment instead.

-  delete ammClawback.Amount
+  ammClawback.Amount = undefined

This same pattern could be applied to all other instances of delete in this file (lines 55, 73, and 91).

🧰 Tools
🪛 Biome (1.9.4)

[error] 45-45: 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 (1)

47-51: Performance optimization suggestion

Static analysis suggests avoiding the delete operator. Consider using undefined assignment instead.

-  delete tx.AcceptedCredentials
+  tx.AcceptedCredentials = undefined
🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8bcd386 and 8c649e5.

📒 Files selected for processing (60)
  • packages/xrpl/HISTORY.md (1 hunks)
  • packages/xrpl/src/models/transactions/MPTokenIssuanceCreate.ts (1 hunks)
  • packages/xrpl/src/models/transactions/MPTokenIssuanceSet.ts (1 hunks)
  • packages/xrpl/src/models/transactions/NFTokenCreateOffer.ts (1 hunks)
  • packages/xrpl/test/models/AMMBid.test.ts (5 hunks)
  • packages/xrpl/test/models/AMMClawback.test.ts (2 hunks)
  • packages/xrpl/test/models/AMMCreate.test.ts (2 hunks)
  • packages/xrpl/test/models/AMMDelete.test.ts (2 hunks)
  • packages/xrpl/test/models/AMMDeposit.test.ts (5 hunks)
  • packages/xrpl/test/models/AMMVote.test.ts (2 hunks)
  • packages/xrpl/test/models/AMMWithdraw.test.ts (5 hunks)
  • packages/xrpl/test/models/CredentialAccept.test.ts (2 hunks)
  • packages/xrpl/test/models/CredentialCreate.test.ts (2 hunks)
  • packages/xrpl/test/models/CredentialDelete.test.ts (2 hunks)
  • packages/xrpl/test/models/DIDDelete.test.ts (2 hunks)
  • packages/xrpl/test/models/DIDSet.test.ts (2 hunks)
  • packages/xrpl/test/models/MPTokenAuthorize.test.ts (6 hunks)
  • packages/xrpl/test/models/MPTokenIssuanceCreate.test.ts (9 hunks)
  • packages/xrpl/test/models/MPTokenIssuanceDestroy.test.ts (3 hunks)
  • packages/xrpl/test/models/MPTokenIssuanceSet.test.ts (6 hunks)
  • packages/xrpl/test/models/NFTokenAcceptOffer.test.ts (11 hunks)
  • packages/xrpl/test/models/NFTokenBurn.test.ts (3 hunks)
  • packages/xrpl/test/models/NFTokenCancelOffer.test.ts (4 hunks)
  • packages/xrpl/test/models/NFTokenCreateOffer.test.ts (12 hunks)
  • packages/xrpl/test/models/NFTokenMint.test.ts (9 hunks)
  • packages/xrpl/test/models/NFTokenModify.test.ts (5 hunks)
  • packages/xrpl/test/models/XChainAccountCreateCommit.test.ts (2 hunks)
  • packages/xrpl/test/models/XChainAddAccountCreateAttestation.test.ts (2 hunks)
  • packages/xrpl/test/models/XChainAddClaimAttestation.test.ts (2 hunks)
  • packages/xrpl/test/models/XChainClaim.test.ts (2 hunks)
  • packages/xrpl/test/models/XChainCommit.test.ts (2 hunks)
  • packages/xrpl/test/models/XChainCreateBridge.test.ts (2 hunks)
  • packages/xrpl/test/models/XChainCreateClaimID.test.ts (2 hunks)
  • packages/xrpl/test/models/XChainModifyBridge.test.ts (2 hunks)
  • packages/xrpl/test/models/accountDelete.test.ts (5 hunks)
  • packages/xrpl/test/models/accountSet.test.ts (2 hunks)
  • packages/xrpl/test/models/baseTransaction.test.ts (15 hunks)
  • packages/xrpl/test/models/checkCancel.test.ts (3 hunks)
  • packages/xrpl/test/models/checkCash.test.ts (6 hunks)
  • packages/xrpl/test/models/checkCreate.test.ts (7 hunks)
  • packages/xrpl/test/models/clawback.test.ts (9 hunks)
  • packages/xrpl/test/models/depositPreauth.test.ts (10 hunks)
  • packages/xrpl/test/models/escrowCancel.test.ts (2 hunks)
  • packages/xrpl/test/models/escrowCreate.test.ts (3 hunks)
  • packages/xrpl/test/models/escrowFinish.test.ts (6 hunks)
  • packages/xrpl/test/models/offerCancel.test.ts (2 hunks)
  • packages/xrpl/test/models/offerCreate.test.ts (8 hunks)
  • packages/xrpl/test/models/oracleDelete.test.ts (2 hunks)
  • packages/xrpl/test/models/oracleSet.test.ts (3 hunks)
  • packages/xrpl/test/models/payment.test.ts (5 hunks)
  • packages/xrpl/test/models/paymentChannelClaim.test.ts (3 hunks)
  • packages/xrpl/test/models/paymentChannelCreate.test.ts (2 hunks)
  • packages/xrpl/test/models/paymentChannelFund.test.ts (2 hunks)
  • packages/xrpl/test/models/permissionedDomainDelete.test.ts (2 hunks)
  • packages/xrpl/test/models/permissionedDomainSet.test.ts (2 hunks)
  • packages/xrpl/test/models/setRegularKey.test.ts (2 hunks)
  • packages/xrpl/test/models/signerListSet.test.ts (5 hunks)
  • packages/xrpl/test/models/ticketCreate.test.ts (1 hunks)
  • packages/xrpl/test/models/trustSet.test.ts (2 hunks)
  • packages/xrpl/test/testUtils.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (6)
packages/xrpl/test/models/MPTokenAuthorize.test.ts (1)
Learnt from: shawnxie999
PR: XRPLF/xrpl.js#2661
File: packages/xrpl/test/models/MPTokenAuthorize.test.ts:60-71
Timestamp: 2024-12-06T18:44:55.095Z
Learning: In the XRPL.js library's TypeScript test file `packages/xrpl/test/models/MPTokenAuthorize.test.ts`, negative test cases for invalid `Account` address format, invalid `Holder` address format, invalid `MPTokenIssuanceID` format, and invalid flag combinations are not necessary.
packages/xrpl/test/models/MPTokenIssuanceSet.test.ts (1)
Learnt from: shawnxie999
PR: XRPLF/xrpl.js#2661
File: packages/xrpl/test/models/MPTokenAuthorize.test.ts:60-71
Timestamp: 2024-12-06T18:44:55.095Z
Learning: In the XRPL.js library's TypeScript test file `packages/xrpl/test/models/MPTokenAuthorize.test.ts`, negative test cases for invalid `Account` address format, invalid `Holder` address format, invalid `MPTokenIssuanceID` format, and invalid flag combinations are not necessary.
packages/xrpl/test/models/clawback.test.ts (1)
Learnt from: shawnxie999
PR: XRPLF/xrpl.js#2661
File: packages/xrpl/test/integration/transactions/clawback.test.ts:165-178
Timestamp: 2024-12-06T19:27:11.147Z
Learning: In the integration tests for `clawback.test.ts`, it's acceptable to use `@ts-expect-error` to bypass type checking when verifying ledger entries, and no additional type safety improvements are needed.
packages/xrpl/test/models/MPTokenIssuanceCreate.test.ts (1)
Learnt from: shawnxie999
PR: XRPLF/xrpl.js#2661
File: packages/xrpl/test/models/MPTokenAuthorize.test.ts:60-71
Timestamp: 2024-12-06T18:44:55.095Z
Learning: In the XRPL.js library's TypeScript test file `packages/xrpl/test/models/MPTokenAuthorize.test.ts`, negative test cases for invalid `Account` address format, invalid `Holder` address format, invalid `MPTokenIssuanceID` format, and invalid flag combinations are not necessary.
packages/xrpl/test/models/MPTokenIssuanceDestroy.test.ts (1)
Learnt from: shawnxie999
PR: XRPLF/xrpl.js#2661
File: packages/xrpl/test/models/MPTokenAuthorize.test.ts:60-71
Timestamp: 2024-12-06T18:44:55.095Z
Learning: In the XRPL.js library's TypeScript test file `packages/xrpl/test/models/MPTokenAuthorize.test.ts`, negative test cases for invalid `Account` address format, invalid `Holder` address format, invalid `MPTokenIssuanceID` format, and invalid flag combinations are not necessary.
packages/xrpl/test/models/AMMClawback.test.ts (1)
Learnt from: shawnxie999
PR: XRPLF/xrpl.js#2661
File: packages/xrpl/test/integration/transactions/clawback.test.ts:165-178
Timestamp: 2024-12-06T19:27:11.147Z
Learning: In the integration tests for `clawback.test.ts`, it's acceptable to use `@ts-expect-error` to bypass type checking when verifying ledger entries, and no additional type safety improvements are needed.
🧬 Code Graph Analysis (48)
packages/xrpl/test/models/checkCancel.test.ts (1)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/test/models/XChainCreateBridge.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/XChainCreateBridge.ts (1)
  • validateXChainCreateBridge (48-56)
packages/xrpl/src/models/transactions/NFTokenCreateOffer.ts (2)
packages/xrpl/src/models/transactions/index.ts (2)
  • NFTokenCreateOfferFlagsInterface (72-72)
  • NFTokenCreateOfferFlags (71-71)
packages/xrpl/src/models/utils/index.ts (1)
  • isFlagEnabled (25-28)
packages/xrpl/test/models/escrowFinish.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/escrowFinish.ts (1)
  • validateEscrowFinish (49-81)
packages/xrpl/test/models/NFTokenBurn.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/NFTokenBurn.ts (1)
  • validateNFTokenBurn (48-52)
packages/xrpl/test/models/oracleDelete.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/oracleDelete.ts (1)
  • validateOracleDelete (28-32)
packages/xrpl/test/models/paymentChannelCreate.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/paymentChannelCreate.ts (1)
  • validatePaymentChannelCreate (65-106)
packages/xrpl/test/models/MPTokenAuthorize.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/MPTokenAuthorize.ts (1)
  • validateMPTokenAuthorize (63-67)
packages/xrpl/test/models/trustSet.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/trustSet.ts (1)
  • validateTrustSet (137-156)
packages/xrpl/test/models/payment.test.ts (3)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/payment.ts (1)
  • validatePayment (173-212)
packages/xrpl/src/models/transactions/index.ts (1)
  • PaymentFlags (88-88)
packages/xrpl/test/models/paymentChannelClaim.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/paymentChannelClaim.ts (1)
  • validatePaymentChannelClaim (149-183)
packages/xrpl/test/models/DIDSet.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/DIDSet.ts (1)
  • validateDIDSet (31-49)
packages/xrpl/test/models/oracleSet.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/oracleSet.ts (1)
  • validateOracleSet (75-198)
packages/xrpl/test/models/paymentChannelFund.test.ts (1)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/test/models/CredentialCreate.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/CredentialCreate.ts (1)
  • validateCredentialCreate (47-59)
packages/xrpl/test/models/XChainModifyBridge.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/XChainModifyBridge.ts (1)
  • validateXChainModifyBridge (69-77)
packages/xrpl/test/models/offerCreate.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/offerCreate.ts (1)
  • validateOfferCreate (117-143)
packages/xrpl/test/models/NFTokenCancelOffer.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/NFTokenCancelOffer.ts (1)
  • validateNFTokenCancelOffer (41-51)
packages/xrpl/test/models/permissionedDomainSet.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/permissionedDomainSet.ts (1)
  • validatePermissionedDomainSet (33-54)
packages/xrpl/test/models/escrowCreate.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/escrowCreate.ts (1)
  • validateEscrowCreate (58-95)
packages/xrpl/test/models/CredentialAccept.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/CredentialAccept.ts (1)
  • validateCredentialAccept (36-44)
packages/xrpl/test/models/NFTokenAcceptOffer.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/NFTokenAcceptOffer.ts (1)
  • validateNFTokenAcceptOffer (98-110)
packages/xrpl/test/models/DIDDelete.test.ts (2)
packages/xrpl/test/testUtils.ts (1)
  • assertTxIsValid (66-69)
packages/xrpl/src/models/transactions/DIDDelete.ts (1)
  • validateDIDDelete (18-20)
packages/xrpl/test/models/MPTokenIssuanceSet.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/MPTokenIssuanceSet.ts (1)
  • validateMPTokenIssuanceSet (66-86)
packages/xrpl/test/models/NFTokenModify.test.ts (3)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/index.ts (1)
  • validateNFTokenModify (79-79)
packages/xrpl/src/models/transactions/NFTokenModify.ts (1)
  • validateNFTokenModify (52-67)
packages/xrpl/test/models/XChainAccountCreateCommit.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/XChainAccountCreateCommit.ts (1)
  • validateXChainAccountCreateCommit (57-69)
packages/xrpl/test/models/AMMVote.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/AMMVote.ts (1)
  • validateAMMVote (39-71)
packages/xrpl/test/models/checkCreate.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/checkCreate.ts (1)
  • validateCheckCreate (57-82)
packages/xrpl/test/models/checkCash.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/checkCash.ts (1)
  • validateCheckCash (40-72)
packages/xrpl/test/models/AMMDelete.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/AMMDelete.ts (1)
  • validateAMMDelete (37-55)
packages/xrpl/test/testUtils.ts (1)
packages/xrpl/src/errors.ts (1)
  • ValidationError (156-156)
packages/xrpl/test/models/setRegularKey.test.ts (1)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/test/models/XChainClaim.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/XChainClaim.ts (1)
  • validateXChainClaim (63-79)
packages/xrpl/test/models/XChainCommit.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/XChainCommit.ts (1)
  • validateXChainCommit (62-76)
packages/xrpl/test/models/clawback.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/clawback.ts (1)
  • validateClawback (43-70)
packages/xrpl/test/models/depositPreauth.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/depositPreauth.ts (1)
  • validateDepositPreauth (45-87)
packages/xrpl/test/models/MPTokenIssuanceCreate.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/MPTokenIssuanceCreate.ts (1)
  • validateMPTokenIssuanceCreate (124-180)
packages/xrpl/test/models/accountDelete.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/accountDelete.ts (1)
  • validateAccountDelete (47-60)
packages/xrpl/test/models/offerCancel.test.ts (1)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/test/models/XChainCreateClaimID.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/XChainCreateClaimID.ts (1)
  • validateXChainCreateClaimID (46-54)
packages/xrpl/test/models/NFTokenCreateOffer.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/NFTokenCreateOffer.ts (1)
  • validateNFTokenCreateOffer (123-161)
packages/xrpl/test/models/CredentialDelete.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/CredentialDelete.ts (1)
  • validateCredentialDelete (39-55)
packages/xrpl/test/models/XChainAddAccountCreateAttestation.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/XChainAddAccountCreateAttestation.ts (1)
  • validateXChainAddAccountCreateAttestation (89-123)
packages/xrpl/test/models/NFTokenMint.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/NFTokenMint.ts (1)
  • validateNFTokenMint (146-180)
packages/xrpl/test/models/ticketCreate.test.ts (1)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/test/models/accountSet.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/accountSet.ts (1)
  • validateAccountSet (175-225)
packages/xrpl/test/models/signerListSet.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/signerListSet.ts (1)
  • validateSignerListSet (39-88)
packages/xrpl/test/models/MPTokenIssuanceDestroy.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
  • assertTxIsValid (66-69)
  • assertTxValidationError (78-85)
packages/xrpl/src/models/transactions/MPTokenIssuanceDestroy.ts (1)
  • validateMPTokenIssuanceDestroy (29-34)
🪛 Biome (1.9.4)
packages/xrpl/test/models/XChainCreateBridge.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/oracleDelete.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/paymentChannelCreate.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/trustSet.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/payment.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/paymentChannelClaim.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/DIDSet.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/oracleSet.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/paymentChannelFund.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainModifyBridge.test.ts

[error] 44-44: 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] 48-48: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainAddClaimAttestation.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/escrowCancel.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMWithdraw.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMBid.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/escrowCreate.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainAccountCreateCommit.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMVote.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMCreate.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMDelete.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMDeposit.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainClaim.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainCommit.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/permissionedDomainDelete.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/offerCancel.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainCreateClaimID.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/XChainAddAccountCreateAttestation.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/ticketCreate.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

packages/xrpl/test/models/AMMClawback.test.ts

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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


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

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: snippets (22.x)
  • GitHub Check: snippets (18.x)
  • GitHub Check: browser (18.x)
  • GitHub Check: snippets (20.x)
🔇 Additional comments (186)
packages/xrpl/test/models/escrowCancel.test.ts (3)

2-6: Good refactoring to improve test readability and consistency.

The introduction of the helper functions assertValid and assertInvalid wrapping the common utilities makes the tests more concise and easier to read. This standardized approach will make tests more maintainable across the codebase.


14-14: Type declaration helps with clarity.

Adding the explicit any type for the cancel variable improves code clarity, even though TypeScript could infer the type.


25-27: Test readability improved with helper functions.

Using the specialized assertion helpers makes the test assertions more concise and focused on what's being tested rather than the mechanics of validation and error handling.

Also applies to: 29-33, 35-39, 41-45, 47-51, 53-57

packages/xrpl/test/models/escrowFinish.test.ts (3)

2-6: Well-structured helper function implementation.

The introduction of utility functions from testUtils and the local helper functions assertValid and assertInvalid provides a clean abstraction that simplifies test assertions. This approach improves readability and maintainability by standardizing the validation pattern across tests.


14-14: Explicit type annotation improves clarity.

Explicitly typing escrow as any improves type clarity, which is good practice especially when working with test fixtures that may have dynamic properties.


31-31: Consistent use of helper functions across all test cases.

The consistent replacement of direct assertion calls with the helper functions assertValid and assertInvalid across all test cases streamlines the test code and makes it more maintainable.

Also applies to: 39-39, 45-45, 51-51, 57-57, 63-63, 69-69, 78-78, 97-97, 105-105, 116-116, 128-128

packages/xrpl/test/models/baseTransaction.test.ts (3)

6-9: Direct implementation of assertion helpers.

Unlike the other files that use imported utility functions, this file implements the helpers directly with assert.doesNotThrow and assert.throws. Note that this approach doesn't validate against the generic validate function like the imported utilities do. This inconsistency might be intentional for base transaction tests.


18-18: Explicit type annotation for test fixture.

Adding the explicit type annotation : any to the test fixture improves type clarity and consistency with other test files.


64-64: Consistent use of helper functions simplifies assertions.

The consistent use of assertValid and assertInvalid helper functions across all test cases improves code readability and maintainability.

Also applies to: 73-73, 83-83, 93-93, 103-103, 113-115, 126-126, 136-136, 146-148, 159-159, 169-169, 183-183, 200-200, 209-209

packages/xrpl/test/models/XChainCreateBridge.test.ts (3)

2-7: Helper functions improve test structure.

The introduction of utility functions and local helper wrappers standardizes the test assertions, following the same pattern used across other transaction model tests.


15-15: Explicit type annotation for test fixture.

Explicitly typing tx as any improves clarity and consistency with other test files.


40-40: Consistent use of helper functions streamlines test assertions.

The consistent use of assertValid and assertInvalid helper functions across all test cases simplifies the test code.

Also applies to: 46-46, 52-52, 58-58, 64-64, 70-72

packages/xrpl/test/models/paymentChannelCreate.test.ts (3)

2-7: Helper functions standardize validation approach.

The introduction of utility functions and local helper wrappers provides a consistent pattern for asserting validation success and failure across all transaction model tests.


15-15: Explicit type annotation improves clarity.

Explicitly typing channel as any improves type clarity and consistency with other test files.


33-33: Consistent use of helper functions simplifies validation assertions.

The consistent replacement of direct assertion calls with the helper functions across all test cases streamlines the test code.

Also applies to: 41-41, 47-47, 53-53, 59-59, 65-65, 71-71, 77-77, 83-83, 89-89, 95-95, 101-101

packages/xrpl/test/models/AMMVote.test.ts (3)

2-6: Well-structured helper functions introduced for test standardization.

The introduction of assertValid and assertInvalid helper functions provides a cleaner abstraction for validation tests. This approach reduces code duplication and improves readability by encapsulating the validation logic.


14-14: Good type clarification.

Adding the explicit any type for the vote variable improves code clarity and aligns with TypeScript best practices by making implicit types explicit.


33-33: Simplified test assertion.

Using the new assertValid helper function makes the test more concise while still maintaining the same validation checks.

packages/xrpl/test/models/NFTokenBurn.test.ts (3)

1-6: Well-implemented helper functions for consistent test structure.

The use of assertValid and assertInvalid helper functions creates a consistent testing pattern across the codebase, which improves maintainability. This matches the pattern introduced in the AMMVote test file.


27-27: Simplified validation check.

Using the assertValid helper function streamlines the test while maintaining the same validation coverage.


39-39: Clean error validation.

Using assertInvalid simplifies error validation while still ensuring both the specific validator and generic validate function throw the expected error.

packages/xrpl/test/models/oracleDelete.test.ts (2)

2-6: Consistent helper function implementation.

The utility functions follow the same pattern as in other test files, providing a unified approach to transaction validation testing.


14-14: Explicit type annotation.

Adding the explicit any type for the tx variable improves code clarity and follows good TypeScript practices.

packages/xrpl/test/models/trustSet.test.ts (2)

2-6: Consistent helper functions for standardized testing.

The helper functions follow the same pattern as in other test files, maintaining consistency across the codebase.


14-14: Appropriate type annotation.

The explicit typing of trustSet as any improves code clarity and type safety.

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

2-7: Good implementation of test utilities for consistency

The addition of assertTxIsValid and assertTxValidationError imports along with the local helper functions assertValid and assertInvalid is a great refactoring choice. This approach centralizes validation logic and reduces duplication across test files.

The helper functions make the test code more readable and maintainable by encapsulating the validation logic and error checking in a concise way.


27-27: Good use of helper functions for validation assertions

Replacing direct assertion calls with the helper functions assertValid and assertInvalid makes the tests much cleaner and more consistent. The refactoring helps standardize how validation is tested across the suite.

Also applies to: 33-33, 39-39

packages/xrpl/test/models/AMMCreate.test.ts (2)

2-6: Good implementation of test utilities

The addition of assertTxIsValid and assertTxValidationError imports along with the local helper functions is consistent with the refactoring pattern seen across test files. This standardization helps improve code maintainability.


32-32: Consistent use of helper functions

The consistent replacement of direct assertion calls with helper functions improves readability and makes the validation pattern uniform. This is a good example of the "Don't Repeat Yourself" (DRY) principle.

Also applies to: 38-38, 44-44, 50-50, 56-56, 62-62, 68-68, 74-74, 80-80

packages/xrpl/test/models/CredentialAccept.test.ts (2)

4-9: Good implementation of test utilities

The addition of specialized assertion utilities and local helper functions follows the consistent pattern used throughout the codebase refactoring. This approach centralizes validation logic and improves maintenance.


31-31: Consistent use of helper functions

The refactoring to use helper functions for validation assertions is consistent with the approach seen in other test files. This uniformity makes the codebase easier to understand and maintain.

Also applies to: 37-37, 43-43, 49-49, 55-55, 61-61, 68-68, 75-75, 82-82

packages/xrpl/test/models/NFTokenCancelOffer.test.ts (2)

1-7: Good implementation of test utilities

The addition of import for the validator function and test utilities, along with the local helper functions, creates a consistent pattern for transaction validation testing. This approach encapsulates validation logic and makes tests more readable.


28-28: Consistent use of helper functions

The replacement of direct validation calls with helper functions follows the same pattern as other test files, ensuring consistency across the test suite. This standardization makes the code easier to maintain and understand.

Also applies to: 40-40, 53-53

packages/xrpl/test/models/CredentialCreate.test.ts (3)

4-9: Well-structured helper functions for validation testing.

The introduction of helper functions assertValid and assertInvalid is a clean approach that improves readability by abstracting the validation logic.


17-17: Appropriate type annotation for test variable.

The explicit any type for the credentialCreate variable improves type clarity, which is good practice for test code.


33-33: Consistent use of helper functions across test cases.

Replacing the direct validation calls with the helper functions makes the test more concise and consistent, reducing duplication and improving maintainability.

Also applies to: 39-39, 45-45, 51-51, 57-57, 63-63, 70-70, 77-77, 84-84, 90-90, 96-96, 102-102, 108-108, 114-114

packages/xrpl/test/models/XChainAccountCreateCommit.test.ts (3)

4-7: Well-structured helper functions for validation testing.

The helper functions assertValid and assertInvalid nicely encapsulate the validation logic and improve code readability.


15-15: Appropriate type annotation for test variable.

The explicit any type for the tx variable improves type clarity in test code.


41-41: Consistent use of helper functions across test cases.

Using the helper functions consistently throughout the test suite improves readability and maintainability.

Also applies to: 47-47, 53-53, 59-62, 68-71, 77-77, 83-83, 89-89, 95-95

packages/xrpl/test/models/checkCancel.test.ts (2)

4-6: Cleaner validation helpers with simplified function syntax.

The helper functions use a concise arrow function syntax, which is consistent with modern JavaScript/TypeScript practices and improves readability.


22-22: Consistent use of helper functions in test assertions.

The test cases have been updated to use the new helper functions, making the code more maintainable and consistent with the rest of the codebase.

Also applies to: 32-32

packages/xrpl/test/models/NFTokenAcceptOffer.test.ts (2)

1-7: Well-structured helpers with proper imports.

The code properly imports the specific validation function and test utilities, then wraps them in concise helper functions that improve test readability.


30-30: Consistent use of helper functions across all test cases.

All test cases now use the helper functions consistently, which reduces code duplication and improves maintainability. The multiline formatting for complex assertions is also well-structured and readable.

Also applies to: 43-43, 55-58, 72-75, 89-92, 106-106, 121-121, 136-139, 154-157, 172-172

packages/xrpl/test/models/DIDSet.test.ts (3)

2-6: Helper functions improve consistency and readability

The introduction of assertTxIsValid and assertTxValidationError utilities along with local assertValid and assertInvalid wrapper functions is a good refactoring. This approach centralizes validation logic and reduces duplication across test cases.


14-14: Explicit typing adds clarity

Explicitly typing tx as any improves code clarity and maintainability.


30-30: Simplified test assertions

The new assertion pattern nicely streamlines the test code while maintaining the same validation logic. These helpers appropriately encapsulate both the specific and generic validators.

Also applies to: 36-36, 42-42, 48-48, 56-59

packages/xrpl/test/models/escrowCreate.test.ts (3)

2-6: Consistent helper function pattern improves test organization

The use of assertTxIsValid and assertTxValidationError with local wrapper functions follows the same consistent pattern adopted across test files, improving code readability and maintainability.


14-14: Explicit typing clarifies variable usage

Explicitly typing escrow as any improves code clarity.


32-32: Streamlined test assertions maintain validation integrity

The refactored assertions properly maintain the validation logic while simplifying the code structure. Each test case appropriately uses the helper functions to verify validation behavior.

Also applies to: 38-38, 44-44, 50-50, 56-56, 62-62, 68-68, 74-74, 80-80, 87-90, 97-100

packages/xrpl/test/models/AMMDelete.test.ts (3)

2-6: Consistent helper function pattern maintains testing standards

The adoption of the assertTxIsValid and assertTxValidationError utility functions with local wrappers follows the same pattern as other test files, creating a standardized testing approach.


14-14: Explicit typing enhances code clarity

Explicitly typing ammDelete as any improves clarity about the variable's intended usage.


33-33: Simplified assertions maintain validation integrity

The refactored assertions provide a clear and consistent pattern for verifying validation logic. The named constants for error messages add clarity to the test cases.

Also applies to: 39-39, 45-45, 51-51, 57-57

packages/xrpl/test/models/checkCreate.test.ts (2)

2-6: Consistent helper pattern improves test readability

Using the assertTxIsValid and assertTxValidationError utilities with local wrapper functions follows the standardized pattern adopted across test files, improving readability and maintenance.


27-27: Streamlined test assertions maintain validation correctness

The refactored assertions effectively test the same validation logic while reducing code duplication. Each test case now follows a consistent pattern that clearly communicates its intent.

Also applies to: 43-43, 59-59, 75-77, 94-94, 109-109

packages/xrpl/test/models/checkCash.test.ts (6)

2-6: Good refactoring with reusable test assertions.

The introduction of utility functions assertTxIsValid and assertTxValidationError along with the local helpers assertValid and assertInvalid creates a cleaner and more consistent approach to transaction validation testing. This pattern eliminates duplication and makes the test cases more readable.


24-24: LGTM: Simplified test assertion.

Replaced direct assertion calls with the helper function for cleaner code.


35-35: LGTM: Consistent error assertion pattern.

The use of the assertInvalid helper provides a consistent way to check validation errors.


47-47: LGTM: Consistent validation pattern.

Maintains the same validation behavior while improving code readability.


60-63: LGTM: Improved test readability.

Using the helper function with proper formatting for longer error messages improves readability.


75-75: LGTM: Consistent test pattern.

Follows the established pattern for validation error assertions.

packages/xrpl/test/models/paymentChannelFund.test.ts (5)

2-7: Good implementation of reusable test utilities.

The introduction of helper functions improves test consistency and reduces duplication across test cases.


15-15: LGTM: Explicit type annotation.

Adding explicit type annotation for channel as any improves code clarity.


29-29: LGTM: Simplified valid transaction testing.

Replacing direct assertion with the helper function improves code consistency.


35-35: LGTM: Consistent validation approach.

Maintains test behavior while improving code readability.


41-41: LGTM: Consistent error validation patterns.

All error assertions follow the same pattern, making the code more maintainable.

Also applies to: 47-47, 53-53, 59-59, 65-65

packages/xrpl/test/models/XChainAddAccountCreateAttestation.test.ts (4)

2-11: Good implementation of reusable test utilities.

The introduction of helper functions with clear formatting improves readability and consistency across test cases.


19-19: LGTM: Explicit type annotation.

Adding explicit type annotation for tx as any improves code clarity.


55-55: LGTM: Simplified valid transaction testing.

Replacing direct assertion with the helper function improves code consistency.


61-62: LGTM: Consistent error validation patterns.

All error validation assertions now follow a consistent pattern, improving readability and maintainability of the test suite.

Also applies to: 67-68, 73-76, 82-85, 91-94, 100-103, 109-112, 118-121, 127-130, 136-139, 145-148, 154-157, 163-166, 172-175, 181-184, 190-193, 199-202, 208-211, 217-220, 226-229, 235-238, 244-247

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

149-155: Improved flag handling with null/undefined safety.

The changes enhance the Flags handling by:

  1. Providing a default value of 0 when Flags is undefined
  2. Supporting both numeric and interface-based flag representations
  3. Adding null safety with defaults when checking flag values

This makes the validation more robust and less prone to runtime errors.


156-156: Simplified conditional check.

Using the calculated boolean value directly for the conditional statement improves code readability.

packages/xrpl/test/models/NFTokenModify.test.ts (3)

1-9: Good refactoring of imports and introduction of helper functions.

The code now uses the more standardized stringToHex from @xrplf/isomorphic and introduces helper functions to simplify test assertions. This follows good DRY principles by wrapping the utility functions from testUtils in more concise helpers specific to this test file.


27-27: Updated to use standard utility function.

Correctly updated to use the imported stringToHex function, maintaining consistent utility usage across the codebase.


30-30: Improved test assertions using helper functions.

The refactoring to use assertValid and assertInvalid helper functions makes the tests more readable and maintainable. This standardized approach ensures consistent validation across test files and reduces code duplication.

Also applies to: 41-41, 54-54, 67-67

packages/xrpl/test/models/payment.test.ts (3)

3-9: Clean implementation of shared test utilities.

Good refactoring to import assertTxIsValid and assertTxValidationError from testUtils and create local helper functions. This makes test assertions more consistent and reduces code duplication across the test suite.


17-17: Improved variable naming.

Renamed variable from likely paymentTransaction to payment provides better semantic clarity and consistency with other test files.


43-44: Streamlined validation assertions.

Replaced direct validation calls with the helper functions, making the test code more readable and maintainable. This approach ensures consistent validation across the codebase.

Also applies to: 56-56, 69-70, 74-74, 79-79, 84-85, 89-90, 94-95, 99-99, 104-105, 109-110, 114-115, 119-120, 124-125, 130-131, 136-137, 141-142

packages/xrpl/test/models/accountSet.test.ts (3)

2-6: Effective implementation of test utility functions.

Good adoption of the assertTxIsValid and assertTxValidationError utilities with local helper functions, improving code readability and consistency with other test files in the codebase.


14-14: Improved variable naming.

Renaming from account to tx provides better semantic clarity and aligns with the convention used in other test files.


30-31: Successfully refactored test assertions.

The test cases now use the helper functions assertValid and assertInvalid, which makes the test code more concise and maintainable. This follows the consistent pattern applied across various test files in this PR.

Also applies to: 35-36, 40-41, 45-46, 50-51, 55-56, 60-61, 65-66, 70-71, 75-76

packages/xrpl/test/models/AMMWithdraw.test.ts (3)

3-9: Well-structured test utilities implementation.

Good refactoring to use the centralized assertTxIsValid and assertTxValidationError utilities and create local helper functions for cleaner test assertions.


22-22: Explicit typing improves code clarity.

Explicitly typing withdraw as any clarifies the intention and aligns with TypeScript best practices, even though the type is inferred from the assignment.


43-43: Consistent use of assertion helpers across tests.

Successfully replaced direct validation calls with helper functions, making the tests more readable and consistent with the rest of the codebase.

Also applies to: 49-49, 60-60, 67-67, 74-74, 80-80, 85-85, 91-91, 97-97, 103-103, 109-109, 119-119, 125-125, 132-132, 138-138, 145-145, 152-152

packages/xrpl/test/models/XChainClaim.test.ts (3)

2-6: Good centralization of validation logic.

The refactoring effectively centralizes the validation logic using utility functions from testUtils, creating local helpers that improve code readability and maintainability.


14-14: Adding explicit typing improves code clarity.

Explicitly typing tx as any clearly communicates the variable type, though in a future refactoring consider using a more specific type if possible.


40-40: Test assertions are now more consistent and concise.

The use of helper functions assertValid and assertInvalid makes test assertions more readable, consistent, and maintainable across the test suite.

Also applies to: 46-46, 52-52, 58-58, 64-64, 70-70, 76-76, 82-82, 88-88, 94-94

packages/xrpl/test/models/paymentChannelClaim.test.ts (3)

2-7: Good use of utility functions for consistent testing.

The refactoring nicely leverages assertTxIsValid and assertTxValidationError utilities, wrapping them in descriptive local helper functions that improve code readability.


15-15: Explicit typing improves code clarity.

Adding explicit typing to channel as any makes the variable type clear, enhancing code readability.


33-33: Consistent test assertion pattern applied.

All test assertions now follow a consistent pattern using the helper functions, which simplifies the code and improves maintainability.

Also applies to: 42-42, 48-48, 54-54, 60-60, 66-66, 72-72, 78-78

packages/xrpl/test/models/oracleSet.test.ts (3)

4-8: Well-structured helper functions improve test readability.

The addition of assertValid and assertInvalid helper functions provides a clean abstraction for validation testing, making the code more readable and maintainable.


16-16: Explicit typing enhances code clarity.

Explicitly typing tx as any clearly communicates the variable type, which is good for code readability.


41-41: Consistent test assertions improve maintainability.

The refactoring to use consistent assertion patterns across all test cases significantly improves code maintainability and readability.

Also applies to: 47-47, 53-53, 59-59, 65-65, 71-71, 77-77, 89-89, 96-96, 110-110, 117-117, 124-124, 131-131, 138-138, 145-145, 152-152, 159-159, 165-165, 173-173, 179-179, 185-185, 191-191

packages/xrpl/test/models/XChainAddClaimAttestation.test.ts (3)

2-7: Good refactoring to centralized validation utilities.

The introduction of utility functions from testUtils and local helper wrappers creates a more consistent validation pattern across the test suite.


15-15: Explicit typing improves code clarity.

Explicitly typing tx as any makes the intended type clear, which enhances code readability.


49-49: Consistent validation assertions improve test maintainability.

Using the helper functions consistently across all test cases significantly improves code maintainability and readability. The multiline assertions with proper indentation ensure clear error messages.

Also applies to: 55-55, 61-61, 67-70, 76-79, 85-88, 94-97, 103-103, 109-112, 118-121, 127-127, 133-133, 139-139, 145-145, 151-154, 160-163, 169-169, 175-175, 181-181, 187-187

packages/xrpl/test/models/signerListSet.test.ts (5)

2-7: Good refactoring approach with helper functions

The introduction of assertValid and assertInvalid helper functions makes the test code more readable and maintainable by encapsulating the validation logic.


15-15: Explicit typing as any is appropriate here

Since this is test code and the variable is used for various validation scenarios with different properties, the any type is reasonable.


48-48: Simplified validation assertion

Replaced direct validation calls with the helper function, improving readability while maintaining the same functionality.


54-54: Consistent error validation pattern

Using assertInvalid creates a consistent pattern for error validation throughout the tests.


60-63: Multiline assertion refactored effectively

The multiline assertion is properly refactored to use the helper function while maintaining readability.

packages/xrpl/test/models/AMMBid.test.ts (4)

2-6: Good use of helper functions for test assertions

Creating local helpers assertValid and assertInvalid that wrap the imported utilities provides a concise way to handle validation in test cases.


14-14: Appropriate use of any type for test object

The any type gives flexibility for testing various scenarios with different properties.


64-64: Consistent application of helper functions

Helper functions are consistently applied throughout the test file, making test assertions more readable and maintainable.

Also applies to: 70-70, 76-76, 82-82, 88-88, 94-94, 100-100, 111-111, 117-117, 125-125, 133-133, 141-141, 151-151, 162-162


60-60:

❌ Incorrect review comment

Consider addressing static analysis warning about delete operator

While not directly part of your changes, the static analysis tool flags potential performance issues with the delete operator on lines 68 and 80.

Biome suggests using undefined assignment instead:

-  delete bid.Asset
+  bid.Asset = undefined

🏁 Script executed:

#!/bin/bash
# Check if delete operator is used elsewhere in test files and how it's handled
rg -g "*.test.ts" "delete \w+\." --count packages/xrpl/test/

Length of output: 1832


Ignore performance warnings for delete in tests

The delete operator is used widely across our test suite (e.g. 30+ occurrences) and has no meaningful impact on test‑execution performance. There’s no need to refactor these tests to use foo = undefined. If you’d like to silence the linter, you can locally disable the rule:

// eslint-disable-next-line no-delete
delete bid.Asset

Likely an incorrect or invalid review comment.

packages/xrpl/test/models/depositPreauth.test.ts (5)

3-10: Good refactoring of import structure and helper functions

The imports are properly organized and the helper functions effectively encapsulate the validation logic.


18-18: Appropriate use of any type for flexible test object

Using any for the test object is appropriate in test code where properties are dynamically added and removed.


36-36: Simplified positive validation tests

The assertValid helper function makes the positive validation tests more concise and readable.

Also applies to: 41-41, 46-46, 51-51


60-70: Effectively refactored multiple validation tests

The multiple validation tests in this section are refactored consistently while maintaining the test coverage.


104-107: Previous duplication issue fixed

The duplication issue identified in a previous review has been successfully addressed.

packages/xrpl/test/models/AMMDeposit.test.ts (5)

3-9: Consistent approach to refactoring

The same refactoring pattern is applied here with imports and helper functions, maintaining consistency across the codebase.


22-22: Appropriate type annotation

Using any type for the test object is appropriate given its dynamic nature in tests.


43-43: Simplified positive validation tests

All positive validation tests are refactored consistently using the assertValid helper function.

Also applies to: 49-49, 60-60, 67-67, 74-74


80-80: Consider addressing static analysis warning about delete operator

Similar to the AMMBid.test.ts file, the static analysis tool flags potential performance issues with the delete operator on lines 78 and 90.

Biome suggests using undefined assignment instead:

-  delete deposit.Asset
+  deposit.Asset = undefined

NOTE: If you decide to address this, the change should be applied consistently across all test files that use the delete operator.


86-86: Consistent validation error handling

Error validation is consistently implemented using the assertInvalid helper function throughout the file.

Also applies to: 92-92, 98-98, 103-103, 113-113, 119-119, 126-126, 132-132, 139-139, 146-146

packages/xrpl/test/models/offerCreate.test.ts (3)

2-6: LGTM! Good refactoring with helper functions.

The introduction of utility functions and local helpers significantly improves the test's readability and maintainability. This approach centralizes validation logic, reduces code duplication, and creates a consistent pattern for testing.


36-36: Good standardization of assertion patterns.

Replacing direct assertions with the helper functions provides consistency across all positive test cases while maintaining the same validation logic.

Also applies to: 59-59, 86-86


110-110: Improved error validation approach.

The refactored error validation is more readable and ensures consistent error checking behavior across all negative test cases.

Also applies to: 134-134, 154-154, 178-178

packages/xrpl/test/models/accountDelete.test.ts (3)

2-7: LGTM! Consistent application of the refactoring pattern.

The helper functions provide a clean abstraction for validation assertions, following the same pattern as other refactored test files.


15-15: Good type annotation.

Explicit type annotation improves code clarity and TypeScript type checking.


32-32: Standardized validation approach across test cases.

The consistent use of helper functions across all test cases improves readability and maintainability while preserving the original validation logic.

Also applies to: 38-38, 44-44, 50-50, 58-58, 76-76, 83-83, 93-93, 104-104

packages/xrpl/test/models/MPTokenIssuanceDestroy.test.ts (2)

1-7: LGTM! Clean implementation of the helper pattern.

The refactoring maintains the same validation logic while making the code more maintainable through abstraction of common validation patterns.


24-24: Improved validation assertions.

The new assertion pattern makes the code more readable and ensures consistent validation behavior between the transaction-specific validator and the generic validator.

Also applies to: 33-35

packages/xrpl/test/models/XChainModifyBridge.test.ts (2)

2-7: LGTM! Consistent application of the helper pattern.

The refactoring follows the same helper function pattern as the other files, providing consistency across the test suite.


40-40: Improved validation assertions.

The consistent use of helper functions across all test cases improves readability and maintainability while preserving the original validation logic.

Also applies to: 46-46, 52-52, 58-58, 64-65

packages/xrpl/test/models/MPTokenAuthorize.test.ts (6)

1-8: Well-structured helper functions for validation testing.

The refactoring introduces local helper functions assertValid and assertInvalid that wrap the utilities from testUtils, making the tests more concise and readable. The imports have been appropriately scoped to include only what's needed.


25-25: Improved test readability.

Replacing direct validation calls with the assertValid helper function makes the test more concise and consistent with the broader refactoring pattern.


34-34: Consistent validation approach.

The change ensures both the specific validator and generic validation are checked consistently, improving test reliability.


43-43: Improved test readability.

Same improvement pattern as the previous assertion replacements.


53-53: Improved test readability.

Same improvement pattern as the previous assertion replacements.


62-62: Improved test readability.

Using assertInvalid provides a cleaner way to test for validation errors with the expected message.

packages/xrpl/test/models/ticketCreate.test.ts (4)

2-6: Well-structured helper functions for validation testing.

The introduction of helper functions improves test readability and ensures consistent validation across the test suite.


14-14: Added explicit type annotation.

Adding the any type to the ticketCreate variable makes the type intention clear, which is good for code readability.


25-25: Improved test readability.

Using the assertValid helper function makes the test more concise and maintains consistency.


35-35: Improved test readability and consistency.

Using the assertInvalid helper function improves readability and ensures consistent validation across all test cases.

Also applies to: 40-42, 48-50, 56-58

packages/xrpl/test/models/CredentialDelete.test.ts (4)

4-9: Well-structured helper functions for validation testing.

The helper functions follow the established pattern across the codebase refactoring, making tests more consistent and readable.


17-17: Added explicit type annotation.

Adding the any type annotation to the credentialDelete variable improves code clarity.


32-32: Improved test readability.

Using the assertValid helper function ensures the validation logic is consistent.


38-38: Consistent validation error handling.

Replacing direct assertions with the assertInvalid helper function ensures consistent validation error handling across all test cases.

Also applies to: 44-44, 50-50, 56-56, 64-64, 70-70, 77-77, 84-84, 91-91

packages/xrpl/test/models/XChainCreateClaimID.test.ts (6)

2-7: Well-structured helper functions for validation testing.

The helper functions maintain consistency with the broader refactoring pattern and improve test readability.


15-15: Added explicit type annotation.

Adding the any type annotation to the tx variable improves code clarity.


40-40: Improved test readability.

Using the assertValid helper function makes the test more concise and maintains consistency.


52-52: Improved test readability and consistency.

Using the assertInvalid helper function improves readability and ensures consistent validation.


64-64: Improved test readability and consistency.

Using the assertInvalid helper function ensures consistent validation.


76-76: Improved test readability and consistency.

Using the assertInvalid helper function ensures consistent validation.

packages/xrpl/test/models/XChainCommit.test.ts (3)

2-6: Improved test organization with helper functions.

The introduction of utility functions assertTxIsValid and assertTxValidationError along with the local wrapper functions assertValid and assertInvalid creates a more maintainable and consistent approach to validation testing.


14-14: Good explicit typing.

Explicitly typing tx as any improves code clarity and sets clear expectations about the variable type.


39-39: Streamlined test assertions with helper functions.

Replacing direct assertion calls with the helper functions makes the tests more concise and readable while maintaining the same validation logic.

Also applies to: 45-45, 51-51, 57-57, 63-63, 69-69, 75-75, 81-81

packages/xrpl/test/models/DIDDelete.test.ts (3)

2-4: Good use of helper function for concise test assertions.

The introduction of the assertValid helper function improves code readability and consistency with other test files.


12-12: Good explicit typing.

Explicitly typing tx as any improves code clarity and sets clear expectations about the variable type.


25-25: Streamlined test assertion with helper function.

Using the helper function makes the test more concise and consistent with the rest of the test suite.

packages/xrpl/test/models/setRegularKey.test.ts (4)

2-7: Improved test organization with helper functions.

The introduction of utility functions and local wrapper functions creates a more maintainable and consistent approach to validation testing.


15-15: Improved variable naming from account to tx.

Renaming the variable from account to tx improves semantic clarity since the variable represents a transaction object, not just an account.

Also applies to: 18-18


32-32: Good practice using undefined assignment instead of delete operator.

Using tx.RegularKey = undefined rather than the delete operator is a better practice for performance, as recommended by static analysis tools.


28-28: Streamlined test assertions with helper functions.

Replacing direct assertion calls with the helper functions makes the tests more concise and readable while maintaining the same validation logic.

Also applies to: 33-33, 39-39

packages/xrpl/test/models/clawback.test.ts (2)

1-6: Improved test organization with helper functions.

The introduction of utility functions and local wrapper functions creates a more maintainable and consistent approach to validation testing across the codebase.


25-25: Streamlined test assertions with helper functions.

Replacing direct assertion calls with the helper functions makes the tests more concise and readable while maintaining the same validation logic and expected error messages.

Also applies to: 34-34, 44-44, 52-52, 66-66, 80-80, 94-94, 107-107, 122-122

packages/xrpl/test/models/offerCancel.test.ts (4)

2-6: Improved test structure with utility functions

The refactored code now uses centralized utility functions for validation, making the tests more concise and maintainable. Good addition of helper functions assertValid and assertInvalid to encapsulate the validation logic.


14-14: Type annotation adds clarity

Explicitly typing offer as any improves code clarity and prevents potential type-related issues.


33-33: Streamlined validation assertion

Replacing the direct validation call with the wrapper function assertValid makes the code more readable and consistent with other tests.


42-43: Better test case and improved error validation

Changed from numeric string '99' to 'abcd' for invalid OfferSequence, which is a more obvious non-numeric value. The validation error handling is now more consistent with the use of assertInvalid.

packages/xrpl/test/models/NFTokenCreateOffer.test.ts (3)

1-8: Well-structured helper functions

Good implementation of utility functions with clear parameter typing. The helper functions make the test assertions more concise while maintaining proper validation.


32-32: Simplified valid transaction testing

Using assertValid instead of direct validation calls makes the code cleaner and easier to maintain.


81-84: Improved error validation readability

The refactored code places the transaction object and error message on separate lines, improving readability while maintaining the same validation logic.

packages/xrpl/test/models/AMMClawback.test.ts (2)

5-9: Good use of utility functions

The implementation of utility functions with proper type annotation improves code readability and maintainability.


17-17: Explicit type annotation adds clarity

Properly typing ammClawback as any improves code clarity.

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

3-10: Well-structured utility functions

Good implementation of helper functions with proper type annotations. The imports and utility functions are well-organized.


18-18: Explicit typing improves clarity

Properly typing tx as any adds clarity to the code.


37-37: Simplified validation assertion

Using assertValid makes the code more concise while maintaining the same validation logic.

packages/xrpl/test/models/NFTokenMint.test.ts (6)

1-9: Improved test utilities implementation.

The changes introduce better structured imports and helper functions for validation assertions. The switch to stringToHex from the isomorphic package standardizes string conversion across the codebase, and the local helper functions make test assertions more readable and consistent.


29-32: Well-structured test validation.

Replacing direct assertions with the helper function improves readability and maintainability. The validation now checks both the specific validateNFTokenMint function and the generic validate function.


48-49: Standardized validation approach.

The helper function provides a consistent way to validate the transaction without repetitive code, ensuring both the specific and generic validators are checked.


60-61: Consistent error assertion pattern.

Using the helper function for validation error checks improves consistency across all test cases while maintaining the same validation logic and error messages.

Also applies to: 63-64


76-77: Streamlined validation error checking.

The helper function simplifies error validation while ensuring both the specific validator and generic validator throw the expected error.

Also applies to: 79-80


95-96: Uniform validation error handling across all test cases.

All error validation cases now follow the same pattern, making the test suite more maintainable while preserving the validation rules and error messages.

Also applies to: 111-112, 125-127, 142-144

packages/xrpl/test/models/MPTokenIssuanceSet.test.ts (3)

1-8: Improved test structure with specialized helpers.

The changes introduce focused imports and helper functions that streamline validation in the test cases. This approach reduces duplication and promotes consistency across test files.


26-27: Consistent validation pattern for all test cases.

All validation cases now use the same helper function, ensuring both the specific validator and generic validator are checked consistently. This maintains the validation logic while improving code clarity.

Also applies to: 36-37, 46-47


55-58: Standardized error validation approach.

Error cases now follow a consistent pattern with the helper function, ensuring proper validation error checking while maintaining the same test coverage.

Also applies to: 72-73, 76-77

packages/xrpl/test/testUtils.ts (3)

8-13: Enhanced imports for validation utilities.

Adding validate and ValidationError to the imports provides the necessary components for the new utility functions. This centralizes validation logic for all transaction tests.


60-69: Well-designed validation success utility.

The assertTxIsValid function provides a standardized way to assert that a transaction passes both the specific validator and the generic validator. This eliminates duplicate assertion code across test files.


71-85: Robust validation error utility.

The assertTxValidationError function ensures that both the specific validator and the generic validator throw the expected error with the correct message. This provides consistent error checking across all transaction tests.

packages/xrpl/test/models/MPTokenIssuanceCreate.test.ts (3)

1-10: Improved test structure with standardized helpers.

The import of stringToHex from the isomorphic package ensures consistent string conversion. The helper functions provide a clean interface for validation assertions throughout the test file.


27-28: Standardized string encoding and validation assertion.

Using the standardized stringToHex function and the helper validation function improves consistency and readability while maintaining the same test coverage.

Also applies to: 30-31


41-44: Consistent error validation across all test cases.

All error validation tests now follow the same pattern using the helper function, ensuring both validators are checked with the expected error messages. This maintains test coverage while improving code maintainability.

Also applies to: 55-58, 68-69, 76-77, 84-85, 94-97, 105-108, 116-119, 128-131

packages/xrpl/HISTORY.md (1)

14-14: Clear documentation of bug fix.

The changelog entry accurately documents the bug fix for transactions that would crash during validation, which aligns with the code changes in MPTokenIssuanceCreate.ts and MPTokenIssuanceSet.ts files.

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

160-162: Good defensive coding with nullish coalescing operator.

Using ?? 0 to default tx.Flags to zero when it's undefined or null prevents potential crashes during validation. This is a good defensive programming practice that handles edge cases gracefully.

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

72-72: Good defensive coding with nullish coalescing operator.

Using ?? 0 to default tx.Flags to zero when it's undefined or null prevents potential crashes during validation. This is consistent with similar changes in MPTokenIssuanceCreate.ts.

@@ -69,7 +69,7 @@ export function validateMPTokenIssuanceSet(tx: Record<string, unknown>): void {
validateOptionalField(tx, 'Holder', isAccount)

// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Not necessary
const flags = tx.Flags as number | MPTokenIssuanceSetFlagsInterface
const flags = (tx.Flags ?? 0) as number | MPTokenIssuanceSetFlagsInterface
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is the default needed here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The ternary below breaks otherwise. Not really sure what changed in this PR such that it didn't break before, tbh - maybe just more consistent testing/that's set somewhere else?

Copy link
Collaborator

@achowdhry-ripple achowdhry-ripple left a comment

Choose a reason for hiding this comment

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

good cleanup

Comment on lines +6 to +9
const assertValid = (tx: any): void =>
assertTxIsValid(tx, validateCredentialAccept)
const assertInvalid = (tx: any, message: string): void =>
assertTxValidationError(tx, validateCredentialAccept, message)
Copy link
Collaborator

Choose a reason for hiding this comment

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

continuing off of the thread in the other PR, I like the new assertTxIsValid methods, but I'm not sure about aliasing it here again as assertInvalid, since it seems to not simplify anything besides the function name

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It passes in the validate[TxType] function as a parameter, so that you don't have to pass it in every time you run it. This makes tests a little cleaner - a basic assertValid and assertInvalid.

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.

2 participants