-
Notifications
You must be signed in to change notification settings - Fork 28
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
test(cairo_native): add native to transactions test #3041
base: main-v0.13.4
Are you sure you want to change the base?
test(cairo_native): add native to transactions test #3041
Conversation
9e0a752
to
52015d2
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 4 of 6 files at r1, 5 of 5 files at r2, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @avivg-starkware and @meship-starkware)
crates/blockifier/src/test_utils.rs
line 9 at r2 (raw file):
pub mod struct_impls; pub mod syscall; #[cfg(test)]
Not needed as the file is already under this feature flag. See here.
Code quote:
#[cfg(test)]
crates/blockifier/src/test_utils/test_templates.rs
line 6 at r2 (raw file):
#[template] #[rstest] fn cairo_version_no_native(
I think that you can all both functions cairo_version
and then you can apply
in one line (and use one import).
Suggestion:
fn cairo_version(
crates/blockifier/src/test_utils/test_templates.rs
line 32 at r2 (raw file):
cairo_version: CairoVersion, ) { }
Remove?
Code quote:
#[cfg(not(feature = "cairo_native"))]
#[template]
#[rstest]
fn cairo_version_no_native(
#[values(CairoVersion::Cairo0, CairoVersion::Cairo1(RunnableCairo1::Casm))]
cairo_version: CairoVersion,
) {
}
crates/blockifier/src/transaction/transactions_test.rs
line 485 at r2 (raw file):
validate_gas_consumed: 4740, // The gas consumption results from parsing the input // arguments. execute_gas_consumed: 112080,
Why do we have additional vm resources in case of the casm?
Code quote:
resources: ExecutionResources::default(),
validate_gas_consumed: 4740, // The gas consumption results from parsing the input
// arguments.
execute_gas_consumed: 112080,
crates/blockifier/src/transaction/transactions_test.rs
line 734 at r2 (raw file):
feature = "cairo_native", case::with_cairo1_native_account(CairoVersion::Cairo1(RunnableCairo1::Native)) )]
Why not use the apply
here?
Code quote:
#[case::with_cairo0_account(CairoVersion::Cairo0)]
#[case::with_cairo1_account(CairoVersion::Cairo1(RunnableCairo1::Casm))]
#[cfg_attr(
feature = "cairo_native",
case::with_cairo1_native_account(CairoVersion::Cairo1(RunnableCairo1::Native))
)]
crates/blockifier/src/transaction/transactions_test.rs
line 909 at r2 (raw file):
cairo_version: CairoVersion, ) { let account_cairo_version = cairo_version;
Why is this needed? Does the input must be called cairo_version
?
Code quote:
let account_cairo_version = cairo_version;
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, 6 unresolved discussions (waiting on @avivg-starkware and @noaov1)
crates/blockifier/src/test_utils/test_templates.rs
line 6 at r2 (raw file):
Previously, noaov1 (Noa Oved) wrote…
I think that you can all both functions
cairo_version
and then you canapply
in one line (and use one import).
That is a very good idea
crates/blockifier/src/transaction/transactions_test.rs
line 734 at r2 (raw file):
Previously, noaov1 (Noa Oved) wrote…
Why not use the
apply
here?
I think it more elegant to do cases when it is only three cases, but I can add the template instead
crates/blockifier/src/transaction/transactions_test.rs
line 909 at r2 (raw file):
Previously, noaov1 (Noa Oved) wrote…
Why is this needed? Does the input must be called
cairo_version
?
Yes, we might be able to resolve it with a macro but I think that is good for now
52015d2
to
c7a6cfe
Compare
c7a6cfe
to
436df65
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 7 files at r3.
Reviewable status: 2 of 8 files reviewed, 6 unresolved discussions (waiting on @avivg-starkware and @noaov1)
436df65
to
b835be9
Compare
ec3c06a
to
16068a9
Compare
b835be9
to
afb7053
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 7 files at r3, 1 of 2 files at r4.
Reviewable status: 4 of 9 files reviewed, 6 unresolved discussions (waiting on @avivg-starkware and @noaov1)
afb7053
to
948ca79
Compare
16068a9
to
ac7407d
Compare
948ca79
to
c3e48ef
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: 3 of 9 files reviewed, 6 unresolved discussions (waiting on @avivg-starkware and @noaov1)
crates/blockifier/src/test_utils/test_templates.rs
line 32 at r2 (raw file):
Previously, noaov1 (Noa Oved) wrote…
Remove?
Done.
ac7407d
to
7a44005
Compare
c3e48ef
to
2a8a873
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: 3 of 9 files reviewed, 6 unresolved discussions (waiting on @avivg-starkware and @noaov1)
crates/blockifier/src/test_utils.rs
line 9 at r2 (raw file):
Previously, noaov1 (Noa Oved) wrote…
Not needed as the file is already under this feature flag. See here.
Done.
7a44005
to
21e3422
Compare
3adccaa
to
4e66ac7
Compare
21e3422
to
7612687
Compare
4e66ac7
to
9a0c70f
Compare
7612687
to
3806aa2
Compare
4e23b6d
to
a8b9ee1
Compare
3806aa2
to
a340146
Compare
a8b9ee1
to
094a794
Compare
No description provided.