-
Notifications
You must be signed in to change notification settings - Fork 176
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
Remove call to cartridge_deployController
for Controller deployment
#2509
Conversation
WalkthroughOhayo, sensei! The changes in this pull request primarily focus on the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Controller
participant Session
User->>Controller: Request to create controller
Controller->>Session: Check for existing session
alt Session exists
Controller->>User: Return existing session
else No session
Controller->>Session: Create new session
Controller->>User: Return new session
end
🪧 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: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
- bin/sozo/src/commands/options/account/controller.rs (3 hunks)
🧰 Additional context used
🔇 Additional comments (4)
bin/sozo/src/commands/options/account/controller.rs (4)
3-3
: Appropriate import ofContext
andResult
fromanyhow
Ohayo sensei! The addition of
anyhow::{Context, Result}
enhances error handling and is correctly included.
14-14
: ImportingFelt
fromstarknet::core::types
is necessaryOhayo sensei! The import of
Felt
is essential for operations involving field elements and is appropriately added.
21-21
: Addingtracing::trace
for logging purposesOhayo sensei! The inclusion of
use tracing::trace;
is appropriate for detailed logging throughout the codebase.
36-45
: Removal of deployment logic aligns with PR objectivesOhayo sensei! The removal of the deployment check within the
create_controller
function simplifies account creation, as the session creation now handles account deployment. This change aligns perfectly with the PR objectives.
@@ -37,6 +33,16 @@ use super::WorldAddressOrName; | |||
pub type ControllerSessionAccount<P> = SessionAccount<Arc<P>>; | |||
|
|||
/// Create a new Catridge Controller account based on session key. |
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.
Correct the typo in the function description
Ohayo sensei! There's a minor typo in the documentation. The word "Catridge" should be corrected to "Cartridge" to accurately reflect the system's name.
/// Controller guarantees that if the provided network is among one of the supported networks, | ||
/// then the Controller account should exist. If it doesn't yet exist, it will automatically | ||
/// be created when a session is created (ie during the session registration stage). |
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.
🛠️ Refactor suggestion
Clarify the documentation in create_controller
function
Ohayo sensei! To enhance readability, consider rephrasing the documentation for clarity.
Suggested rewording:
"The Controller guarantees that if the provided network is among the supported networks, the Controller account will exist. If it doesn't yet exist, it will be automatically created during the session registration stage."
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2509 +/- ##
==========================================
+ Coverage 67.73% 67.81% +0.08%
==========================================
Files 388 388
Lines 50421 50367 -54
==========================================
+ Hits 34153 34157 +4
+ Misses 16268 16210 -58 ☔ View full report in Codecov by Sentry. |
we no longer need to explicitly call the
cartridge_deployController
when a Controller account doesn't exist. this is already being handled when the session is being created.Summary by CodeRabbit
New Features
Documentation