dojo icon indicating copy to clipboard operation
dojo copied to clipboard

Modify DevApi trait with new endpoints

Open fabrobles92 opened this issue 1 year ago • 1 comments

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

fabrobles92 avatar Oct 01 '24 04:10 fabrobles92

Codecov Report

Attention: Patch coverage is 24.21875% with 97 lines in your changes missing coverage. Please review.

Project coverage is 55.69%. Comparing base (38f68db) to head (5c6981b). Report is 276 commits behind head on main.

Files with missing lines Patch % Lines
crates/katana/rpc/rpc/src/proxy_get_request.rs 41.09% 43 Missing :warning:
crates/katana/rpc/rpc/src/transport/http.rs 0.00% 25 Missing :warning:
crates/katana/rpc/rpc/src/dev.rs 0.00% 17 Missing :warning:
crates/katana/primitives/src/fee.rs 0.00% 6 Missing :warning:
crates/katana/primitives/src/genesis/constant.rs 0.00% 6 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2490      +/-   ##
==========================================
- Coverage   55.82%   55.69%   -0.13%     
==========================================
  Files         446      448       +2     
  Lines       57728    57921     +193     
==========================================
+ Hits        32225    32260      +35     
- Misses      25503    25661     +158     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Oct 01 '24 04:10 codecov[bot]

Thank you @fabrobles92 for the rebase. You could check the scripts to make the sure linters are not complaining in the CI. 👍

glihm avatar Jan 03 '25 21:01 glihm

Walkthrough

The pull request introduces enhancements to the Katana devnet RPC functionality, focusing on adding new HTTP endpoints for account-related operations. The changes span multiple files across the primitives and RPC modules, implementing string parsing for price units, adding methods for account balance retrieval, and creating a proxy layer to handle HTTP GET requests for RPC methods.

Changes

File Change Summary
primitives/src/fee.rs Added FromStr trait implementation for PriceUnit enum
primitives/src/genesis/constant.rs Added get_erc20_address function to retrieve contract addresses
rpc/rpc-api/src/dev.rs Added account_balance and mint methods to DevApi trait
rpc/rpc/Cargo.toml Added multiple dependencies for RPC and async processing
rpc/rpc/src/dev.rs Implemented account_balance and mint methods for DevApi
rpc/rpc/src/lib.rs Added new proxy_get_request module and DevnetProxyLayer
rpc/rpc/src/proxy_get_request.rs Created middleware for proxying HTTP GET requests to RPC methods
rpc/rpc/src/transport/http.rs Added response handling module for HTTP responses
rpc/rpc/src/transport/mod.rs Added new http module

Assessment against linked issues

Objective Addressed Explanation
/account_balance (GET)
/mint (POST) Placeholder method added, but full implementation seems pending
/predeployed_accounts (GET) Not implemented in this PR
/fee_token (GET) Not implemented in this PR

Ohayo, sensei! The PR looks like it's making solid progress towards exposing those devnet endpoints. While not all requested features are fully implemented, it's laying down a robust foundation for future expansions. Keep coding! 🚀

Finishing Touches

  • [ ] 📝 Generate Docstrings

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

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

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

CodeRabbit Commands (Invoked using PR comments)

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

coderabbitai[bot] avatar Jan 04 '25 05:01 coderabbitai[bot]

Hey @fabrobles92, very sorry for the delay there. Also we're revamping the stack repositories and now Katana is here https://github.com/dojoengine/katana.

If you're still interested to work on that, please don't hesitate to re-open the PR on the Katana repo. Will compensate the time you've spent already on this one, thank you very much!

(Linked to the new repo here: https://github.com/dojoengine/katana/issues/36)

glihm avatar Apr 23 '25 16:04 glihm