-
Notifications
You must be signed in to change notification settings - Fork 188
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: all bindgen functionns external instead of view #2725
Conversation
WalkthroughOhayo, sensei! This pull request introduces enhancements to the Changes
Possibly related PRs
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this 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
🧹 Outside diff range and nitpick comments (1)
crates/dojo/bindgen/src/plugins/typescript/generator/function.rs (1)
Line range hint
38-77
: Ohayo, sensei! Consider refactoring duplicated code ingenerate_system_function
.The match arms for
StateMutability::External
andStateMutability::View
share similar structures, especially in error handling and function templates. Refactoring the common parts could improve readability and maintainability.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
crates/dojo/bindgen/src/plugins/typescript/generator/function.rs
(5 hunks)
🔇 Additional comments (4)
crates/dojo/bindgen/src/plugins/typescript/generator/function.rs (4)
1-1
: Ohayo, sensei! Importing StateMutability
for function generation.
Including StateMutability
in the imports enables handling of External
and View
functions appropriately during code generation.
81-84
: Ohayo, sensei! Correct handling of function inputs based on mutability.
The format_function_inputs
method adjusts inputs appropriately for External
and View
functions by including or excluding snAccount
.
298-304
: Ohayo, sensei! Great addition of test for View
functions.
Adding test_format_function_inputs_view
enhances test coverage and ensures that View
functions are handled correctly.
441-449
: Ohayo, sensei! Helpful create_basic_view_function
for testing.
The create_basic_view_function
provides a clear way to test View
functions, improving test clarity and maintainability.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2725 +/- ##
=======================================
Coverage 56.23% 56.24%
=======================================
Files 415 415
Lines 53206 53241 +35
=======================================
+ Hits 29921 29943 +22
- Misses 23285 23298 +13 ☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit
New Features
External
andView
functions.View
functions that does not require input parameters.Bug Fixes
View
functions.Tests
View
functions.