Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix(katana-node-bindings): use new Felt #2146

Merged
merged 1 commit into from
Jul 6, 2024

Conversation

glihm
Copy link
Collaborator

@glihm glihm commented Jul 6, 2024

Description

Related issue

Tests

  • Yes
  • No, because they aren't needed
  • No, because I need help

Added to documentation?

  • README.md
  • Dojo Book
  • No documentation needed

Checklist

  • I've formatted my code (scripts/prettier.sh, scripts/rust_fmt.sh, scripts/cairo_fmt.sh)
  • I've linted my code (scripts/clippy.sh, scripts/docs.sh)
  • I've commented my code
  • I've requested a review after addressing the comments

Summary by CodeRabbit

  • Refactor
    • Updated data types from FieldElement to Felt across various structs and methods to reflect improved data representation. This change impacts how addresses, chain IDs, and private keys are handled within the application.

Copy link

coderabbitai bot commented Jul 6, 2024

Walkthrough

The changes primarily consist of updating the data type from FieldElement to Felt in the katana project. This revision affects the struct fields, methods, and function signatures within the starknet::core::types module. Additionally, the license declaration in katana/node-bindings/Cargo.toml has been removed.

Changes

Files Change Summaries
crates/.../node-bindings/Cargo.toml Removed license.workspace = true.
crates/.../node-bindings/src/lib.rs, crates/.../runner/src/lib.rs Updated types from FieldElement to Felt in various struct fields, methods, and function signatures within starknet::core::types. Adjusted related assignments and function calls accordingly.

Poem

🐇 In Katana's code, a change is sung,
FieldElement to Felt, the switch is strung.
Address and keys in a new attire,
Starknet’s core, now feeling the fire.
🚀 Development hops ahead, swift and clear,
With bunnies coding, there's nothing to fear! 🌟


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

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as PR comments)

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

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

@glihm glihm changed the title fix: use new Felt katana(node-binding): use new Felt Jul 6, 2024
@glihm glihm changed the title katana(node-binding): use new Felt fix(katana-node-binding): use new Felt Jul 6, 2024
@glihm glihm changed the title fix(katana-node-binding): use new Felt fix(katana-node-bindings): use new Felt Jul 6, 2024
Copy link
Member

@kariy kariy left a comment

Choose a reason for hiding this comment

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

LOOKS GOOD TO MEEE

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4d33374 and 77ed793.

Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
Files selected for processing (3)
  • crates/katana/node-bindings/Cargo.toml (1 hunks)
  • crates/katana/node-bindings/src/lib.rs (9 hunks)
  • crates/katana/runner/src/lib.rs (3 hunks)
Files skipped from review due to trivial changes (1)
  • crates/katana/node-bindings/Cargo.toml
Additional comments not posted (11)
crates/katana/runner/src/lib.rs (3)

26-26: Change Approved: Updated contract field to use Felt.

The contract field in the KatanaRunner struct has been updated to use Felt. This change is consistent with the objective to use the new Felt type.


153-153: Change Approved: Updated set_contract method to use Felt.

The set_contract method's parameter type has been updated to Felt. This change is consistent with the objective to use the new Felt type.


158-158: Change Approved: Updated contract method to use Felt.

The contract method's return type has been updated to Felt. This change is consistent with the objective to use the new Felt type.

crates/katana/node-bindings/src/lib.rs (8)

16-16: Change Approved: Updated import statement to use Felt.

The import statement has been updated to import Felt instead of FieldElement. This change is consistent with the objective to use the new Felt type.


32-32: Change Approved: Updated address field in Account struct to use Felt.

The address field in the Account struct has been updated to use Felt. This change is consistent with the objective to use the new Felt type.


45-45: Change Approved: Updated chain_id field in KatanaInstance struct to use Felt.

The chain_id field in the KatanaInstance struct has been updated to use Felt. This change is consistent with the objective to use the new Felt type.


65-65: Change Approved: Updated chain_id method in KatanaInstance struct to return Felt.

The chain_id method in the KatanaInstance struct has been updated to return Felt. This change is consistent with the objective to use the new Felt type.


338-338: Change Approved: Updated chain_id method in Katana builder to accept Felt.

The chain_id method in the Katana builder has been updated to accept Felt. This change is consistent with the objective to use the new Felt type.


511-511: Change Approved: Updated address assignment in spawn method to use Felt.

The address assignment in the spawn method has been updated to use Felt. This change is consistent with the objective to use the new Felt type.


512-512: Change Approved: Updated private_key assignment in spawn method to use Felt.

The private_key assignment in the spawn method has been updated to use Felt. This change is consistent with the objective to use the new Felt type.


569-569: Change Approved: Updated private_key assignment in spawn method to use Felt.

The private_key assignment in the spawn method has been updated to use Felt. This change is consistent with the objective to use the new Felt type.

Copy link

codecov bot commented Jul 6, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 67.82%. Comparing base (8ff31b0) to head (77ed793).
Report is 1 commits behind head on main.

Files Patch % Lines
crates/katana/runner/src/lib.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2146      +/-   ##
==========================================
- Coverage   68.13%   67.82%   -0.32%     
==========================================
  Files         334      334              
  Lines       41894    42048     +154     
==========================================
- Hits        28546    28519      -27     
- Misses      13348    13529     +181     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@glihm glihm merged commit 0ff19cc into dojoengine:main Jul 6, 2024
14 of 15 checks passed
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