-
Notifications
You must be signed in to change notification settings - Fork 26
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_integration_tests): add sierra contract class to dummy state #2467
refactor(starknet_integration_tests): add sierra contract class to dummy state #2467
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
833b635
to
13e4acf
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2467 +/- ##
==========================================
+ Coverage 40.10% 48.94% +8.84%
==========================================
Files 26 290 +264
Lines 1895 33112 +31217
Branches 1895 33112 +31217
==========================================
+ Hits 760 16208 +15448
- Misses 1100 15803 +14703
- Partials 35 1101 +1066 ☔ View full report in Codecov by Sentry. |
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 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @AvivYossef-starkware and @Yoni-Starkware)
a discussion (no related file):
please add reviewer(s) from mempool team
crates/starknet_integration_tests/src/state_reader.rs
line 171 at r1 (raw file):
} } sierra_contract_classes
use filter_map
Suggestion:
contract_classes_to_retrieve
.iter()
.filter_map(|contract| {
if contract.cairo_version() == CairoVersion::Cairo1 {
Some((contract.class_hash(), contract.sierra()))
} else {
None
}
})
.collect()
7045fbb
to
cff63ab
Compare
566536c
to
110372e
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: 1 of 2 files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware and @Yoni-Starkware)
a discussion (no related file):
Previously, dorimedini-starkware wrote…
please add reviewer(s) from mempool team
I spoke with Dan before opening the PR, and he said it wasn’t necessary.
crates/starknet_integration_tests/src/state_reader.rs
line 171 at r1 (raw file):
Previously, dorimedini-starkware wrote…
use filter_map
Done.
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 r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware and @Yoni-Starkware)
crates/starknet_integration_tests/src/state_reader.rs
line 171 at r2 (raw file):
} else { None }
sorry, missed this earlier.
please use match
, we currently have another version variant
Suggestion:
match contract.cairo_version() {
CairoVersion::Cairo0 => None,
CairoVersion::Cairo1 => Some((contract.class_hash(), contract.sierra())),
#[cfg(feature = "cairo_native")]
CairoVersion::Native => Some((contract.class_hash(), contract.sierra())),
}
cff63ab
to
3efd03b
Compare
110372e
to
f9b3362
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 r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)
3efd03b
to
e4ce2e7
Compare
f9b3362
to
b383741
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: 1 of 3 files reviewed, all discussions resolved (waiting on @dorimedini-starkware and @Yoni-Starkware)
crates/starknet_integration_tests/src/state_reader.rs
line 171 at r2 (raw file):
Previously, dorimedini-starkware wrote…
sorry, missed this earlier.
please usematch
, we currently have another version variant
Done.
e4ce2e7
to
e85b600
Compare
b383741
to
f5062e4
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 2 of 2 files at r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @AvivYossef-starkware and @Yoni-Starkware)
crates/blockifier/src/test_utils.rs
line 103 at r5 (raw file):
pub fn is_cairo0(&self) -> bool { matches!(self, Self::Cairo0) }
here, you do have the feature, so use full match
Suggestion:
pub fn is_cairo0(&self) -> bool {
match self {
Self::Cairo0 => true,
Self::Cairo1 => false,
#[cfg(feature = "cairo_native")]
Self::Native => false,
}
}
crates/starknet_integration_tests/src/state_reader.rs
line 169 at r5 (raw file):
contract_classes_to_retrieve .filter(|contract| !contract.cairo_version().is_cairo0()) .map(|contract| (contract.class_hash(), contract.sierra()))
non-blocking, but filter+map should probably just be filter_map
Suggestion:
.filter_map(|contract| if !contract.cairo_version().is_cairo0() {
Some((contract.class_hash(), contract.sierra()))
} else { None })
e85b600
to
cb2c53d
Compare
f5062e4
to
d25e648
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: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware and @Yoni-Starkware)
crates/blockifier/src/test_utils.rs
line 103 at r5 (raw file):
Previously, dorimedini-starkware wrote…
here, you do have the feature, so use full
match
Done.
crates/starknet_integration_tests/src/state_reader.rs
line 169 at r5 (raw file):
Previously, dorimedini-starkware wrote…
non-blocking, but filter+map should probably just be filter_map
Don’t you think this makes things clearer? I believe that using filter_map
is a good option when the closure in the map returns an Option
, as it clearly indicates what is being filtered. However, that isn’t the case for us. The logic behind the filter and the logic of the map are unrelated.
cb2c53d
to
128efaa
Compare
d25e648
to
24c6353
Compare
24c6353
to
511eafb
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 2 of 2 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)
Merge activity
|
No description provided.