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

refactor(starknet_class_manager): builder for test storage #4011

Merged
merged 1 commit into from
Feb 9, 2025

Conversation

yair-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

graphite-app bot commented Feb 6, 2025

Graphite Automations

"Yair - Auto-assign" took an action on this PR • (02/06/25)

1 assignee was added to this PR based on Yair's automation.

@yair-starkware yair-starkware force-pushed the yair/prepare_all_classes branch from 87b2ecd to e4dbae0 Compare February 9, 2025 08:56
@yair-starkware yair-starkware force-pushed the yair/class_manager_storage branch from 3a7d96a to 5ce501a Compare February 9, 2025 08:56
@yair-starkware yair-starkware force-pushed the yair/prepare_all_classes branch from e4dbae0 to 29ea78b Compare February 9, 2025 09:04
@yair-starkware yair-starkware force-pushed the yair/class_manager_storage branch from 5ce501a to 5652afb Compare February 9, 2025 09:04
@yair-starkware yair-starkware force-pushed the yair/prepare_all_classes branch from 29ea78b to 9eb9e9e Compare February 9, 2025 09:35
@yair-starkware yair-starkware force-pushed the yair/class_manager_storage branch from 5652afb to d67d15f Compare February 9, 2025 09:35
@yair-starkware yair-starkware force-pushed the yair/prepare_all_classes branch from 9eb9e9e to c499508 Compare February 9, 2025 09:59
@yair-starkware yair-starkware force-pushed the yair/class_manager_storage branch from d67d15f to 3af4df1 Compare February 9, 2025 09:59
@yair-starkware yair-starkware force-pushed the yair/prepare_all_classes branch 6 times, most recently from e474961 to dc72e95 Compare February 9, 2025 11:25
@yair-starkware yair-starkware force-pushed the yair/class_manager_storage branch from 3af4df1 to e305bd4 Compare February 9, 2025 11:56
@yair-starkware yair-starkware changed the base branch from yair/prepare_all_classes to main February 9, 2025 11:56
Copy link
Collaborator

@elintul elintul left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 5 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @yair-starkware)


crates/starknet_class_manager/src/test_utils.rs line 21 at r2 (raw file):

        let persistent_root = persistent_root_handle.path().to_path_buf();
        let config = FsClassStorageConfig {
            persistent_root,

For consistency with path_prefix.

Suggestion:

        let config = FsClassStorageConfig {
            persistent_root: persistent_root_handle.path().to_path_buf(),

crates/starknet_class_manager/src/test_utils.rs line 44 at r2 (raw file):

    }

    pub fn build(self) -> (FsClassStorage, FsClassStorageConfig, Option<FileHandles>) {

Shouldn't build method of builder return the object it builds (here, FsClassStorage)?

Code quote:

build

crates/starknet_class_manager/src/test_utils.rs line 47 at r2 (raw file):

        let Self { config, handles } = self;
        let class_hash_storage =
            ClassHashStorage::new(config.class_hash_storage_config.clone()).unwrap();

Unwrap config insead?

Code quote:

config.class_hash_storage_config.clone()

Copy link
Contributor Author

@yair-starkware yair-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @elintul)


crates/starknet_class_manager/src/test_utils.rs line 21 at r2 (raw file):

Previously, elintul (Elin) wrote…

For consistency with path_prefix.

Done


crates/starknet_class_manager/src/test_utils.rs line 44 at r2 (raw file):

Previously, elintul (Elin) wrote…

Shouldn't build method of builder return the object it builds (here, FsClassStorage)?

It returns it, along with the final config and the file handles


crates/starknet_class_manager/src/test_utils.rs line 47 at r2 (raw file):

Previously, elintul (Elin) wrote…

Unwrap config insead?

The config is not an option.
I need to clone it because the constructor moves it, and I need to return it to the user.

Copy link
Contributor Author

@yair-starkware yair-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 5 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @elintul)

@yair-starkware yair-starkware added this pull request to the merge queue Feb 9, 2025
Merged via the queue into main with commit ca53ad4 Feb 9, 2025
9 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.

3 participants