-
Notifications
You must be signed in to change notification settings - Fork 25
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
chore(blockifier): move contract compilation logic to separate module + contracts.rs #180
Conversation
b304c0e
to
75b59bb
Compare
072267e
to
244da0c
Compare
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.
Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @AvivYossef-starkware, @dorimedini-starkware, @meship-starkware, and @TzahiTaub)
crates/blockifier/src/test_utils/cairo_compile.rs
line 5 at r1 (raw file):
/// Compiles a Cairo0 program using the deprecated compiler. pub fn cairo0_compile(path: String, extra_arg: Option<String>, debug_info: bool) -> Vec<u8> { let mut command = Command::new("starknet-compile-deprecated");
Consider defining it as a constant
Code quote:
"starknet-compile-deprecated"
crates/blockifier/src/test_utils/contracts.rs
line 273 at r1 (raw file):
FeatureContract::ERC20(_) => unreachable!(), }; cairo0_compile(self.get_source_path(), extra_arg, false)
Shouldn't that be configurable by whoever calls compile
?
Code quote:
false
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.
Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @AvivYossef-starkware, @meship-starkware, @nimrod-starkware, and @TzahiTaub)
crates/blockifier/src/test_utils/cairo_compile.rs
line 5 at r1 (raw file):
Previously, nimrod-starkware wrote…
Consider defining it as a constant
why? this is the only usage of this string
crates/blockifier/src/test_utils/contracts.rs
line 273 at r1 (raw file):
Previously, nimrod-starkware wrote…
Shouldn't that be configurable by whoever calls
compile
?
yes, but this is only a preparation; we currently have no use case for the true
case (this is not a callable script, it's just part of tests ATM)
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.
Reviewable status: 0 of 4 files reviewed, all discussions resolved (waiting on @AvivYossef-starkware, @meship-starkware, and @TzahiTaub)
75b59bb
to
31a691f
Compare
244da0c
to
fe4e14c
Compare
31a691f
to
bf5e760
Compare
fe4e14c
to
271de7a
Compare
bf5e760
to
a32af92
Compare
271de7a
to
c3e54f4
Compare
a32af92
to
62d0c0e
Compare
c3e54f4
to
0dad397
Compare
62d0c0e
to
dca7a29
Compare
0dad397
to
e7bfa0d
Compare
dca7a29
to
033708e
Compare
e7bfa0d
to
123fa4f
Compare
033708e
to
5faa4dc
Compare
123fa4f
to
eb425e0
Compare
5faa4dc
to
5c5be6b
Compare
eb425e0
to
125e131
Compare
5c5be6b
to
7d707f6
Compare
125e131
to
73757fe
Compare
7d707f6
to
3da45df
Compare
73757fe
to
bcc5aef
Compare
3da45df
to
e4fc399
Compare
bcc5aef
to
11f058a
Compare
e4fc399
to
d9c41fa
Compare
11f058a
to
0c52d60
Compare
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.
Reviewed 3 of 4 files at r1, 1 of 1 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @AvivYossef-starkware, @dorimedini-starkware, and @meship-starkware)
crates/blockifier/tests/feature_contracts_compatibility_test.rs
line 48 at r3 (raw file):
let mut command = Command::new("starknet-compile-deprecated"); command.args([&path_str, "--no_debug_info"]); if file_name.starts_with("account") {
FaultyAccount didn't fulfill this condition in the past, and now it does—is this the desired behavior? (I assume so; I'm just verifying.)
Code quote:
file_name.starts_with("account")
crates/blockifier/tests/feature_contracts_compatibility_test.rs
line 59 at r3 (raw file):
panic!( "{} does not compile to {existing_compiled_path}.\nRun `{FIX_COMMAND}` to fix the \ expected test according to locally installed `starknet-compile-deprecated`.\n",
?
Suggestion:
existing file according
crates/blockifier/tests/feature_contracts_compatibility_test.rs
line 116 at r3 (raw file):
.map(|contract| contract.get_compiled_path()) .collect(); let mut compiled_paths_on_filesystem: Vec<String> = verify_and_get_files(CairoVersion::Cairo0)
Do we really need to enforce the dir hierarchy?
Can't we be satisfied with verifying the contracts we get by all_feature_contracts
and the source/compiled_path functions exist in the dir, and that's it? (I think it'll be nice if we can remove that function).
Code quote:
verify_and_get_files
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware, @meship-starkware, and @TzahiTaub)
crates/blockifier/tests/feature_contracts_compatibility_test.rs
line 48 at r3 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
FaultyAccount didn't fulfill this condition in the past, and now it does—is this the desired behavior? (I assume so; I'm just verifying.)
it should be compiled as an account, yes
crates/blockifier/tests/feature_contracts_compatibility_test.rs
line 116 at r3 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
Do we really need to enforce the dir hierarchy?
Can't we be satisfied with verifying the contracts we get byall_feature_contracts
and the source/compiled_path functions exist in the dir, and that's it? (I think it'll be nice if we can remove that function).
I want to prevent the case where an untracked contract is manually added. it's possible to miss adding it to the enum; why not enforce it?
0c52d60
to
7d376aa
Compare
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.
Reviewed 1 of 1 files at r5, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @AvivYossef-starkware and @meship-starkware)
crates/blockifier/tests/feature_contracts_compatibility_test.rs
line 116 at r3 (raw file):
Previously, dorimedini-starkware wrote…
I want to prevent the case where an untracked contract is manually added. it's possible to miss adding it to the enum; why not enforce it?
OK, 👍
Merge activity
|
7d376aa
to
4045c19
Compare
This change is