Skip to content

Config and Defaults #14

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

Merged
merged 11 commits into from
May 12, 2025
Merged

Config and Defaults #14

merged 11 commits into from
May 12, 2025

Conversation

tonyboylehub
Copy link
Contributor

Config File Location Standardization, Transaction Command Improvements, and Uploader Fixes

Major Changes

  1. Config File Location Standardization

    • Modified getDefaultConfigPath to use a consistent config file location across all operating systems
    • Added proper path handling using Node's path.join() for cross-platform compatibility
    • Standardized config location to ~/.config/mplx/config.json across all platforms
  2. Transaction Command Keypair Validation

    • Added transactionContext flag to enforce keypair requirements for transaction commands
    • Improved error handling for missing keypair files
    • Added clear error messages for keypair configuration
  3. Uploader Configuration

    • Fixed default uploader configuration in DEFAULT_CONFIG
    • Ensured proper initialization of storage provider
    • Added proper error handling for uploader initialization

Technical Details

Config File Handling

  • Uses process.env.HOME for Unix-like systems (macOS/Linux)
  • Falls back to process.env.USERPROFILE for Windows
  • Properly handles path separators for each OS using path.join()

Config File Locations

  • macOS: /Users/<username>/.config/mplx/config.json
  • Linux: /home/<username>/.config/mplx/config.json
  • Windows: C:\Users\<username>\.config\mplx\config.json

Transaction Command Improvements

  • Added validation in createContext to check for keypair presence
  • Improved error messages for missing keypair configuration
  • Maintains flexibility to specify keypair via config or command line

Uploader Improvements

  • Set default uploader to 'irys' in DEFAULT_CONFIG
  • Added proper initialization of storage provider in createContext
  • Improved error handling for uploader configuration

Benefits

  1. Config File Standardization

    • Consistent config file location across all platforms
    • Follows the XDG Base Directory Specification
    • Maintains backward compatibility with --config flag override
    • Proper path handling for Windows backslashes
  2. Transaction Command Reliability

    • Prevents accidental use of dummy signers for transaction commands
    • Provides clear error messages for missing keypair configuration
    • Maintains flexibility in keypair specification methods
  3. Uploader Reliability

    • Consistent default uploader configuration
    • Proper initialization of storage provider
    • Better error handling for uploader setup

Copy link
Contributor

coderabbitai bot commented May 8, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling for missing or invalid keypair files and configuration paths.
    • Fixed issues with storage provider initialization and configuration path resolution.
  • Refactor
    • Updated command inheritance to better distinguish between transaction and non-transaction commands.
    • Simplified and clarified import statements across multiple files.
    • Streamlined storage provider and uploader initialization logic.
  • Chores
    • Cleaned up and reorganized internal comments and metadata.
    • Updated CLI configuration and scripts for improved maintainability.

Summary by CodeRabbit

  • New Features

    • Improved error handling and validation for keypair and configuration paths.
    • Enhanced context creation with stricter requirements for transaction-related commands.
  • Refactor

    • Updated command inheritance to better distinguish between transaction and non-transaction commands.
    • Simplified and clarified storage provider initialization and uploader integration.
    • Reorganized and cleaned up import statements across multiple files for readability.
  • Style

    • Reformatted code and comments for consistency and clarity.
  • Chores

    • Updated CLI configuration and scripts for improved maintainability.

Walkthrough

This change refactors configuration, context, and command inheritance for a CLI application. It enforces stricter keypair requirements for transaction commands, updates context and signer initialization logic, modifies command base classes, and adjusts storage provider initialization. Several files receive import cleanups and script/configuration tweaks, without altering core command logic.

Changes

File(s) Change Summary
package.json Updated oclif configuration (topicSeparator, added dirname), removed "cli" script, retained "mplx" script.
src/lib/Context.ts Refactored config path logic to use user home directory; enforced keypair presence for transaction contexts; updated signer creation with explicit errors; added createNoopSigner; simplified storage provider init; reordered imports.
src/lib/uploader/initStorageProvider.ts
src/lib/uploader/uploadProviders/irys.ts
Removed Umi parameter from storage provider and uploader init functions; made config optional; removed irys case; always call initIrysUploader with optional config; cleaned imports.
src/TransactionCommand.ts Modified init method to pass true as third argument to createContext indicating transaction context; reordered imports.
src/commands/core/asset/burn.ts
src/commands/core/asset/update.ts
src/commands/core/collection/create.ts
Changed base classes from BaseCommand to TransactionCommand; updated imports accordingly.
src/commands/core/asset/fetch.ts
src/commands/toolbox/rent.ts
Changed base classes from TransactionCommand to BaseCommand; updated imports and reformatted code and comments for consistency.
src/commands/core/plugins/index.ts Changed base class from Command to custom BaseCommand; updated imports.
src/commands/core/asset/create.ts
src/commands/core/asset/index.ts
src/commands/core/asset/template.ts
src/commands/core/collection/fetch.ts
src/commands/core/collection/template.ts
src/commands/core/plugins/generate.ts
src/commands/toolbox/token/transfer.ts
src/commands/toolbox/token/update.ts
Cleaned up, reordered, or removed unused imports; simplified comments; no functional changes.
src/commands/core/collection/fetch.ts Removed unused import abort from node:process.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLICommand
    participant TransactionCommand
    participant Context
    participant Signer

    User->>CLICommand: invoke command
    CLICommand->>TransactionCommand: init()
    TransactionCommand->>Context: createContext(configPath, overrides, transactionContext=true)
    Context->>Context: resolve config path and load config
    Context->>Context: enforce keypair presence if transactionContext
    Context->>Signer: createSignerFromPath(keypairPath)
    Context-->>TransactionCommand: return context (with signer, config, etc.)
    TransactionCommand-->>CLICommand: proceed with command logic
Loading

Possibly related PRs

  • metaplex-foundation/cli#4: Refactors TransactionCommand and related command classes, touching similar class hierarchies and context logic.

Suggested reviewers

  • blockiosaurus

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Lite

📥 Commits

Reviewing files that changed from the base of the PR and between b857b68 and 282f4c3.

📒 Files selected for processing (1)
  • src/commands/toolbox/rent.ts (1 hunks)
🔇 Additional comments (2)
src/commands/toolbox/rent.ts (2)

4-6: Class inheritance change looks appropriate.

The change from TransactionCommand to BaseCommand makes sense for this command since it doesn't appear to submit any blockchain transactions, only retrieves rent information. This aligns with the PR's objective of clarifying command responsibilities.


7-9: Good TypeScript practices with override keyword.

Adding the override keyword improves type safety by explicitly indicating that these properties are overriding those from the parent class.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

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

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@tonyboylehub tonyboylehub marked this pull request as ready for review May 8, 2025 19:52
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d124e8b and 85804b8.

📒 Files selected for processing (19)
  • package.json (1 hunks)
  • src/TransactionCommand.ts (1 hunks)
  • src/commands/core/asset/burn.ts (2 hunks)
  • src/commands/core/asset/create.ts (1 hunks)
  • src/commands/core/asset/fetch.ts (2 hunks)
  • src/commands/core/asset/index.ts (1 hunks)
  • src/commands/core/asset/template.ts (1 hunks)
  • src/commands/core/asset/update.ts (2 hunks)
  • src/commands/core/collection/create.ts (1 hunks)
  • src/commands/core/collection/fetch.ts (0 hunks)
  • src/commands/core/collection/template.ts (1 hunks)
  • src/commands/core/plugins/generate.ts (1 hunks)
  • src/commands/core/plugins/index.ts (1 hunks)
  • src/commands/toolbox/rent.ts (1 hunks)
  • src/commands/toolbox/token/transfer.ts (1 hunks)
  • src/commands/toolbox/token/update.ts (1 hunks)
  • src/lib/Context.ts (7 hunks)
  • src/lib/uploader/initStorageProvider.ts (1 hunks)
  • src/lib/uploader/uploadProviders/irys.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • src/commands/core/collection/fetch.ts
🧰 Additional context used
🧬 Code Graph Analysis (3)
src/TransactionCommand.ts (1)
src/lib/Context.ts (1)
  • createContext (150-190)
src/lib/uploader/initStorageProvider.ts (1)
src/lib/Context.ts (1)
  • ConfigJson (25-44)
src/lib/Context.ts (1)
src/lib/util.ts (1)
  • DUMMY_UMI (35-35)
🪛 Biome (1.9.4)
src/lib/Context.ts

[error] 116-116: Template literals are preferred over string concatenation.

Unsafe fix: Use a template literal.

(lint/style/useTemplate)


[error] 150-150: This type annotation is trivially inferred from its initialization.

Safe fix: Remove the type annotation.

(lint/style/noInferrableTypes)


[error] 168-168: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 183-183: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 185-185: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)

🔇 Additional comments (18)
src/commands/core/plugins/generate.ts (2)

1-1: Cleanup of unused imports

The unnecessary Args import has been removed, keeping only the Flags import that's actually used in the code.


6-7: Import order reorganization

The imports from plugin-related files have been reordered. While this change is cosmetic, it contributes to better code organization.

package.json (1)

20-21: CLI configuration improvements

These changes enhance the oclif CLI configuration:

  1. Fixed the syntax for topicSeparator property
  2. Added "dirname": "mplx" to specify the CLI directory name

These updates align with the PR objective of standardizing configuration file locations and support the consistent CLI structure.

src/commands/core/asset/index.ts (1)

1-1: Removed unused imports

The import statement has been simplified by removing unused Args and Flags imports, keeping only the necessary Command import. This is part of a broader cleanup effort seen across the codebase.

src/commands/core/asset/create.ts (1)

8-8: Import reordering

The import for explorer-related utilities has been moved up in the import list. While this is a cosmetic change, it contributes to more consistent import organization across the codebase.

src/commands/core/collection/template.ts (1)

1-4: Import cleanup looks good

The import statements have been cleaned up by removing the unused Flags import and reordering imports. This makes the code cleaner without affecting functionality.

src/commands/core/asset/template.ts (1)

1-7: Import reorganization looks good

The imports have been cleaned up by removing unused imports and reordering them. This improves code readability without changing functionality.

src/commands/core/asset/update.ts (1)

11-11: Base class change aligns with transaction validation improvements

Changed from BaseCommand to TransactionCommand which is appropriate since this is a transaction-based command that requires keypair validation. This change aligns with the PR objective of enforcing the presence of a keypair for transaction commands.

This change ties into the broader improvement of enforcing proper keypair context for commands that interact with the blockchain.

Also applies to: 30-30

src/commands/core/asset/fetch.ts (1)

7-7: Base class change is appropriate

Changed from TransactionCommand to BaseCommand since fetching assets is a read-only operation that doesn't require transaction signing. This properly differentiates between commands that need transaction context and those that don't.

This change is consistent with the PR's goal of distinguishing between transaction and non-transaction commands, applying stricter keypair validation only where needed.

Also applies to: 21-21

src/commands/toolbox/token/update.ts (1)

11-17: Documentation simplification looks good.

The comment block has been simplified to be more general rather than listing specific update options, making the documentation more maintainable while still conveying the essential information.

src/commands/core/asset/burn.ts (1)

15-15: Appropriate inheritance change for transaction command.

The class now correctly extends TransactionCommand instead of BaseCommand, which enforces keypair validation for transaction operations. This is aligned with the PR objective of requiring keypairs for transaction commands.

Also applies to: 56-56

src/TransactionCommand.ts (1)

99-108: Good implementation of transaction context enforcement.

Setting transactionContext to true ensures that all commands extending TransactionCommand will require a keypair to be specified, preventing accidental use of dummy signers. This change properly implements the PR objective for transaction command keypair validation.

src/commands/core/plugins/index.ts (1)

1-4: Command inheritance standardization looks good.

Changing the base class from Command to BaseCommand<typeof CorePlugins> is consistent with the standardization of command inheritance across the codebase. Since this command doesn't perform transactions, using BaseCommand is the appropriate choice.

src/commands/core/collection/create.ts (1)

12-14: LGTM on command class inheritance change

The change from BaseCommand to TransactionCommand aligns with the PR objective to enforce keypair validation for transaction commands. Since this command creates collections on-chain, it requires a keypair for signing, making this inheritance change appropriate.

src/commands/toolbox/token/transfer.ts (1)

1-8: Clean import organization improvement

The imports have been reorganized for better clarity:

  1. Removed unused Flags import
  2. Consolidated imports from mpl-toolbox to only include used functions
  3. Improved logical grouping of imports

This enhances code maintainability without changing functionality.

src/lib/uploader/uploadProviders/irys.ts (1)

3-5: Simplified uploader initialization properly decouples dependencies

Removing the Umi parameter from initIrysUploader simplifies the function and aligns with the PR objective to fix uploader configuration. This makes the initialization more flexible and properly passes options directly to the underlying irysUploader.

src/commands/toolbox/rent.ts (1)

4-27: Appropriate command class refactoring

Changing ToolboxRent to extend BaseCommand instead of TransactionCommand is appropriate since this command only retrieves rent costs and doesn't require transaction signing. This aligns with the PR's command inheritance restructuring where commands are properly categorized based on their transaction requirements.

The code formatting improvements maintain the same behavior while enhancing readability.

src/lib/Context.ts (1)

168-170: Avoid non-null assertions – surface configuration errors early

Using config.rpcUrl!, config.commitment!, and later config.explorer || …
hides the possibility that these values are actually undefined.
Consider:

  1. Supplying defaults directly in DEFAULT_CONFIG (they mostly exist already).
  2. Narrowing the type after consolidation so non-null assertions are
    unnecessary.

Also applies to: 183-185

🧰 Tools
🪛 Biome (1.9.4)

[error] 168-168: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 169-169: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (3)
src/lib/Context.ts (3)

23-23: 🧹 Nitpick (assertive)

Remove unused abort import

abort is still imported but never referenced, leaving dead code behind.

-import { abort } from 'node:process'

76-82: 🛠️ Refactor suggestion

prefix parameter remains unused in getDefaultConfigPath

The parameter was called out in a previous review but is still unused, which can mislead future contributors.

-export const getDefaultConfigPath = (prefix: string): string => {
+export const getDefaultConfigPath = (): string => {

Alternatively, incorporate prefix into the returned path if that was the original intent.


116-117: 🧹 Nitpick (assertive)

Switch to template literal for clearer error message

Template literals are more readable and flagged by the linter.

-  throw new Error('Keypair file not found at: ' + path + ' please check your config file or use the --keypair flag')
+  throw new Error(
+    `Keypair file not found at: ${path}. Please check your config file or use the --keypair flag.`
+  )
🧰 Tools
🪛 Biome (1.9.4)

[error] 116-116: Template literals are preferred over string concatenation.

Unsafe fix: Use a template literal.

(lint/style/useTemplate)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 85804b8 and 8084bcf.

📒 Files selected for processing (1)
  • src/lib/Context.ts (7 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/lib/Context.ts (1)
src/lib/util.ts (1)
  • DUMMY_UMI (35-35)
🪛 Biome (1.9.4)
src/lib/Context.ts

[error] 116-116: Template literals are preferred over string concatenation.

Unsafe fix: Use a template literal.

(lint/style/useTemplate)


[error] 150-150: This type annotation is trivially inferred from its initialization.

Safe fix: Remove the type annotation.

(lint/style/noInferrableTypes)


[error] 162-162: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 177-177: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 179-179: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)

🔇 Additional comments (1)
src/lib/Context.ts (1)

58-63: Good call setting a concrete default storage provider

Defining the storage provider up-front (irys) keeps behaviour predictable across installs. 👍

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (5)
src/lib/uploader/initStorageProvider.ts (1)

8-11: Redundant switch – collapse to single return

Since both case 'irys' and default paths execute identical logic, the switch adds noise.
Previous reviews have already pointed this out. A straight return keeps the intent crystal-clear.

-  switch (storageConfig?.name) {
-    case 'irys':
-    default:
-      return initIrysUploader(storageConfig?.options)
-  }
+  // Irys is currently the sole provider – always initialise it
+  return initIrysUploader(storageConfig?.options)
src/lib/Context.ts (4)

102-106: Parameter should not accept undefined

createSignerFromPath throws if path is falsy, so accepting undefined in the type signature misleads callers and forces a runtime check.
This was raised previously.


115-116: Use template literals for clearer error message

String concatenation is harder to read and was already flagged.


150-152: Avoid non-null assertions

config.rpcUrl! and config.commitment! repeat the non-null assertion anti-pattern highlighted earlier.


138-147: 🧹 Nitpick (assertive)

Condense signer selection logic

The branching can be simplified to a single expression, reducing duplication:

-  let signer: Signer
-  if (isTransactionContext) {
-    signer = await createSignerFromPath(config.keypair)
-  } else {
-    signer = config.keypair ? await createSignerFromPath(config.keypair) : createNoopSigner()
-  }
+  const signer = (isTransactionContext || config.keypair)
+    ? await createSignerFromPath(config.keypair)
+    : createNoopSigner()

This keeps the happy-path compact while preserving current behaviour.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Lite

📥 Commits

Reviewing files that changed from the base of the PR and between 8084bcf and 2199ad7.

📒 Files selected for processing (3)
  • src/TransactionCommand.ts (2 hunks)
  • src/lib/Context.ts (7 hunks)
  • src/lib/uploader/initStorageProvider.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
src/lib/uploader/initStorageProvider.ts (2)
Learnt from: tonyboylehub
PR: metaplex-foundation/cli#14
File: src/lib/uploader/initStorageProvider.ts:8-13
Timestamp: 2025-05-08T20:00:59.971Z
Learning: The Metaplex CLI currently only supports 'irys' as a storage provider, and the code is designed to default to Irys even when another provider name is specified.
Learnt from: tonyboylehub
PR: metaplex-foundation/cli#14
File: src/lib/uploader/initStorageProvider.ts:5-7
Timestamp: 2025-05-08T20:02:52.120Z
Learning: The `initStorageProvider` function in the Metaplex CLI is designed to always initialize a default Irys uploader, even when no storage configuration is provided. This is intentional behavior to ensure upload functionality is always available as a fallback.
🧬 Code Graph Analysis (3)
src/TransactionCommand.ts (1)
src/lib/Context.ts (2)
  • getDefaultConfigPath (75-81)
  • createContext (138-172)
src/lib/uploader/initStorageProvider.ts (1)
src/lib/Context.ts (1)
  • ConfigJson (24-43)
src/lib/Context.ts (1)
src/lib/util.ts (1)
  • DUMMY_UMI (35-35)
🔇 Additional comments (2)
src/lib/Context.ts (2)

54-62: Double-check default storage.options typing

IrysUploaderOptions may allow an empty object, yet if the type later becomes stricter an implicit {} will break compilation.
Safer to cast or explicitly mark as Partial<IrysUploaderOptions>:

-  storage: {
-    name: 'irys' as const,
-    options: {},
-  },
+  storage: {
+    name: 'irys' as const,
+    options: {} as Partial<IrysUploaderOptions>,
+  },

75-81: 👍 Robust cross-platform config location

The helper now defers to HOME/USERPROFILE and path.join, which fixes Windows path separators – nice improvement!

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@tonyboylehub tonyboylehub requested a review from nhanphan May 9, 2025 12:48
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🔭 Outside diff range comments (1)
src/commands/toolbox/rent.ts (1)

22-24: ⚠️ Potential issue

Remove duplicate args property.

There's a duplicate definition of the args property. This one should be removed as it's identical to the one defined on lines 11-13.

    static override flags = {
        // Ignore the 128 byte header for the rent cost
        noHeader: Flags.boolean({ description: 'Ignore the 128 byte header for the rent cost', default: false }),
        // Flag to display the rent cost in Lamports
        lamports: Flags.boolean({ description: 'Display the rent cost in Lamports', default: false }),
    }

-    static override args = {
-        bytes: Args.integer({ description: 'Number of bytes', required: true }),
-    }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Lite

📥 Commits

Reviewing files that changed from the base of the PR and between 28c1e3a and b857b68.

📒 Files selected for processing (1)
  • src/commands/toolbox/rent.ts (2 hunks)
🔇 Additional comments (1)
src/commands/toolbox/rent.ts (1)

6-6: Base class change from TransactionCommand to BaseCommand.

This change aligns with the PR objectives to refactor command inheritance patterns. The ToolboxRent command doesn't need transaction-specific functionality, so using BaseCommand is appropriate.

Fix conflict merge error.
@tonyboylehub tonyboylehub merged commit a3db795 into main May 12, 2025
1 of 7 checks passed
@tonyboylehub tonyboylehub deleted the uploader/add-default branch May 12, 2025 20:19
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