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

Bump account_sdk to rev 512ff89 #2240

Merged
merged 1 commit into from
Jul 31, 2024
Merged

Bump account_sdk to rev 512ff89 #2240

merged 1 commit into from
Jul 31, 2024

Conversation

kariy
Copy link
Member

@kariy kariy commented Jul 31, 2024

resolves #2230

Summary by CodeRabbit

  • New Features

    • Updated dependency on the account_sdk, potentially bringing in new features and enhancements.
  • Improvements

    • Simplified the definition and usage of UDC_ADDRESS, enhancing clarity and type safety.
    • Streamlined the get_contract_storage function by removing unnecessary parameters, improving performance and reducing complexity.
  • Bug Fixes

    • Adjusted internal logic for retrieving storage, which may fix issues related to previous type-based access methods.

@kariy kariy changed the title Bump account_sdk to rev 512ff89' Bump account_sdk to rev 512ff89 Jul 31, 2024
Copy link

coderabbitai bot commented Jul 31, 2024

Walkthrough

Ohayo, sensei! This update primarily enhances the integration with the account_sdk by updating its version reference in the Cargo.toml. Additionally, the UDC_ADDRESS is now defined locally within the controller.rs, making the code more self-contained. The get_contract_storage function has also been simplified by removing the signer_type parameter, streamlining its logic and enhancing clarity across the affected modules.

Changes

Files Change Summary
Cargo.toml Updated account_sdk dependency to revision 512ff89, pointing to the latest commit in the repository.
bin/sozo/src/commands/options/account/controller.rs Replaced the import of UDC_ADDRESS from account_sdk with a local constant declaration using the felt! macro for type safety.
crates/katana/controller/src/lib.rs Removed signer_type parameter from get_contract_storage, simplifying function signature and logic to directly use guid for storage.

Possibly related issues


Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 86c554c and ba00826.

Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
Files selected for processing (3)
  • Cargo.toml (1 hunks)
  • bin/sozo/src/commands/options/account/controller.rs (3 hunks)
  • crates/katana/controller/src/lib.rs (7 hunks)
Additional comments not posted (6)
crates/katana/controller/src/lib.rs (5)

148-151: LGTM, sensei! Simplified get_contract_storage function.

The changes simplify the function and improve clarity by removing the signer_type parameter.


102-102: Ohayo, sensei! Verify function call to get_contract_storage.

Ensure that the function call to get_contract_storage matches the new signature without the signer_type parameter.

Verification successful

Ohayo, sensei! The function call to get_contract_storage matches the new signature without the signer_type parameter.

  • The function get_contract_storage is correctly defined and used with the new signature.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the function call to `get_contract_storage` matches the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type rust -A 5 $'get_contract_storage'

Length of output: 2173


50-50: Ohayo, sensei! Verify function call to get_contract_storage.

Ensure that the function call to get_contract_storage matches the new signature without the signer_type parameter.

Verification successful

Ohayo, sensei! The function call to get_contract_storage matches the new signature without the signer_type parameter.

  • Verified function definition and usage in crates/katana/controller/src/lib.rs.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the function call to `get_contract_storage` matches the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type rust -A 5 $'get_contract_storage'

Length of output: 2173


205-205: Ohayo, sensei! Verify test cases for get_contract_storage.

Ensure that the test cases for get_contract_storage match the new function signature and logic.

Verification successful

Ohayo, sensei! The test cases for get_contract_storage match the new function signature and logic.

  • The function is correctly called with credential_id and public_key.
  • The test case test_get_contract_storage verifies the expected behavior.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the test cases for `get_contract_storage` match the new function signature.

# Test: Search for the test cases. Expect: Only occurrences of the new signature.
rg --type rust -A 5 $'get_contract_storage'

Length of output: 2173


Line range hint 20-20:
Ohayo, sensei! Verify function call to add_controller_account_inner.

Ensure that the function call to add_controller_account_inner matches the new signature without the signer_type parameter.

Verification successful

Ohayo, sensei! The function call to add_controller_account_inner matches the new signature without the signer_type parameter.

  • add_controller_account_inner is called correctly without the signer_type parameter in the following instances:
    • crates/katana/controller/src/lib.rs: add_controller_account_inner(genesis, credentials.account)
    • crates/katana/controller/src/lib.rs: add_controller_account_inner(&mut genesis, account.clone()).unwrap();
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the function call to `add_controller_account_inner` matches the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type rust -A 5 $'add_controller_account_inner'

Length of output: 1169

bin/sozo/src/commands/options/account/controller.rs (1)

176-178: Ohayo, sensei! Verify the UDC_ADDRESS value.

Ensure that the new UDC_ADDRESS value 0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf is correct.

Verification successful

Ohayo, sensei! Let's dive deeper to ensure the UDC_ADDRESS value is correct. We'll check for its usage and any references in the codebase.


Ohayo, sensei! The UDC_ADDRESS value 0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf is consistently used across the codebase and appears to be correct.

  • Locations:
    • crates/katana/primitives/src/genesis/constant.rs
    • crates/katana/primitives/src/genesis/json.rs
    • crates/katana/primitives/src/genesis/test-genesis.json
    • crates/katana/primitives/src/genesis/test-genesis-with-class.json
    • bin/sozo/src/commands/options/account/controller.rs
    • bin/katana/tests/test-data/genesis.json
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the `UDC_ADDRESS` value.

# Test: Check the address value. Expect: The address value `0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf` should be correct.
echo "0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf"

Length of output: 140


Script:

#!/bin/bash
# Search for the usage of the UDC_ADDRESS value in the codebase
rg '0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf' -A 5

# Check for any documentation or references to the UDC_ADDRESS value
rg 'UDC_ADDRESS' -A 5

Length of output: 12268


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

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

Outside diff range, codebase verification and nitpick comments (1)
Cargo.toml (1)

230-230: Ohayo, sensei! The commit hash 512ff89 for account_sdk does not exist in the repository.

Please update the revision identifier to a valid commit hash.

  • File: Cargo.toml
  • Line: 230
Analysis chain

Ohayo, sensei! Verify the revision identifier for account_sdk.

Ensure that the revision identifier 512ff89 points to the correct commit in the account_sdk repository.


Ohayo, sensei! The initial verification did not yield any results for the commit hash 512ff89. Let's dig deeper to ensure we cover all bases.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the revision identifier for `account_sdk`.

# Test: Check the commit hash. Expect: The commit hash `512ff89` should exist in the repository.
git ls-remote https://github.com/cartridge-gg/controller | grep 512ff89

Length of output: 73


Script:

#!/bin/bash
# Description: List all commit hashes from the repository to verify the existence of `512ff89`.

# Fetch all commit hashes from the repository
git ls-remote https://github.com/cartridge-gg/controller | awk '{print $1}'

Length of output: 23980

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 70.20%. Comparing base (86c554c) to head (ba00826).

Files Patch % Lines
...in/sozo/src/commands/options/account/controller.rs 0.00% 3 Missing ⚠️
crates/katana/controller/src/lib.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2240   +/-   ##
=======================================
  Coverage   70.20%   70.20%           
=======================================
  Files         343      343           
  Lines       45185    45171   -14     
=======================================
- Hits        31720    31711    -9     
+ Misses      13465    13460    -5     

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

@kariy kariy merged commit 5bd7f21 into main Jul 31, 2024
14 of 15 checks passed
@kariy kariy deleted the sozo/controller-update branch July 31, 2024 23:28
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.

Update sozo with latest account_sdk
1 participant