Skip to content

fix: dojo.c argument order #418

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 1 commit into from
Mar 14, 2025
Merged

fix: dojo.c argument order #418

merged 1 commit into from
Mar 14, 2025

Conversation

MartianGreed
Copy link
Collaborator

@MartianGreed MartianGreed commented Mar 14, 2025

Closes #

Introduced changes

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added relevant tests
  • Add a dedicated CI job for new examples
  • Performed self-review of the code

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the order of arguments in a key API method to ensure proper behavior.
  • Documentation
    • Revised method documentation to match the updated parameter sequence for clearer guidance.
  • Style
    • Adjusted type definitions for improved consistency and clarity.

Copy link

coderabbitai bot commented Mar 14, 2025

Walkthrough

This pull request corrects the argument order for functions in the @dojoengine/sdk package. It patches the dojo.c function to ensure that arguments are passed correctly. In addition, the parameter order for the getTokenBalances method in both its implementation and JSDoc has been updated, and several TypeScript generic type definitions have been adjusted with trailing commas. No public API declarations have been altered beyond these signature and documentation modifications.

Changes

Affected Files Change Summary
.changeset/strong-roses-march.md Corrects the argument order for the dojo.c function in the SDK package patch.
packages/sdk/src/index.ts,
packages/sdk/src/types.ts
Reorders parameters in the getTokenBalances method and related interface signatures; adds trailing commas to generic type declarations in multiple type definitions.

Possibly related PRs

  • dojoengine/dojo.js#337: Updates parameter order for getTokenBalances in the SDK interface, aligning with this modification.
  • dojoengine/dojo.js#304: Adjusts the method signature for getTokenBalances, ensuring a consistent parameter ordering across the project.
  • dojoengine/dojo.js#352: Modifies method signatures and generic type handling, complementing the reordering and syntax corrections introduced here.

Poem

I'm the rabbit, hopping through the code,
Rearranging parameters on my joyful road.
Trailing commas now neatly in place,
Bringing structure and grace to our SDK space.
With a twitch of my nose and a gleam in my eye,
I celebrate these changes as I happily hop by! 🐇✨

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 09c2599 and aa70cc7.

📒 Files selected for processing (3)
  • .changeset/strong-roses-march.md (1 hunks)
  • packages/sdk/src/index.ts (1 hunks)
  • packages/sdk/src/types.ts (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: check
  • GitHub Check: build
🔇 Additional comments (8)
.changeset/strong-roses-march.md (1)

1-5: LGTM! Clear changeset message.

The changeset correctly documents the purpose of this PR, describing it as a patch to fix the argument order passed to dojo.c.

packages/sdk/src/index.ts (2)

271-274: Parameter order in JSDoc is now consistent with implementation.

The JSDoc parameter order has been updated to match the actual implementation order, improving documentation accuracy.


277-286:

✅ Verification successful

Function parameter order corrected.

The parameter order in both the function signature and client call has been properly aligned, ensuring that contract_addresses comes before account_addresses.


🏁 Script executed:

#!/bin/bash
# Check for any other usages of getTokenBalances to ensure consistency
rg "getTokenBalances" -A 3 -B 3

Length of output: 1180


Parameter order verified and consistent across the codebase.
We confirmed that both the function signature and the client call in packages/sdk/src/index.ts (lines 277-286) use the correct order: contract_addresses, account_addresses, and token_ids. The corresponding type declaration in packages/sdk/src/types.ts also reflects this order. No further action is required.

packages/sdk/src/types.ts (5)

249-252: Added trailing comma for consistency in generic type parameters.

The addition of a trailing comma after the Historical extends boolean type parameter improves maintainability and follows TypeScript best practices.


256-259: Added trailing comma for consistency in generic type parameters.

Similar to the previous change, this adds a trailing comma for better code consistency.


341-345: Interface parameter order aligned with implementation.

The parameter order in the interface definition now matches the implementation in index.ts, ensuring that contract_addresses comes before account_addresses.


485-488: Added trailing comma for consistency in generic type parameters.

This maintains the same pattern of trailing commas in generic type definitions.


500-503: Added trailing comma for consistency in generic type parameters.

The trailing comma addition here completes the consistent formatting across all similar generic type definitions.

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

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

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for 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.

@MartianGreed MartianGreed merged commit c5f0d51 into main Mar 14, 2025
6 checks passed
@MartianGreed MartianGreed deleted the fix/dojoc-argument-order branch March 14, 2025 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant