-
Notifications
You must be signed in to change notification settings - Fork 30
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): refactor feature contract path getters for different paths #179
chore(blockifier): refactor feature contract path getters for different paths #179
Conversation
b304c0e
to
75b59bb
Compare
Why are you adding this, if it's never used? Code quote: const ERC20_BASE_NAME: &str = "ERC20"; |
The above question Code quote: Self::ERC20(_) => ERC20_BASE_NAME, |
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 all commit messages.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @AvivYossef-starkware, @dorimedini-starkware, @meship-starkware, and @noaov1)
crates/blockifier/src/test_utils/contracts.rs
line 229 at r1 (raw file):
let contract_name = match self { // ERC20 is a special case - not in the feature_contracts directory. Self::ERC20(cairo_version) => {
This is a bit confusing - you're over
Code quote:
let cairo_version = self.cairo_version();
let contract_name = match self {
// ERC20 is a special case - not in the feature_contracts directory.
Self::ERC20(cairo_version) => {
bf5e760
to
a32af92
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 1 files reviewed, 3 unresolved discussions (waiting on @aner-starkware, @AvivYossef-starkware, @meship-starkware, and @noaov1)
crates/blockifier/src/test_utils/contracts.rs
line 66 at r1 (raw file):
Previously, aner-starkware wrote…
Why are you adding this, if it's never used?
Done.
crates/blockifier/src/test_utils/contracts.rs
line 202 at r1 (raw file):
Previously, aner-starkware wrote…
The above question
Done.
crates/blockifier/src/test_utils/contracts.rs
line 229 at r1 (raw file):
Previously, aner-starkware wrote…
This is a bit confusing - you're over
what am I over?
Previously, dorimedini-starkware wrote…
Sorry, I forgot to complete the sentence 😅 |
a32af92
to
62d0c0e
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 1 files reviewed, 3 unresolved discussions (waiting on @aner-starkware, @AvivYossef-starkware, @meship-starkware, and @noaov1)
crates/blockifier/src/test_utils/contracts.rs
line 229 at r1 (raw file):
Previously, aner-starkware wrote…
Sorry, I forgot to complete the sentence 😅
You're overridingcairo_version
before ever using it. Maybe consider postponing the firstlet
statement, or using a different variable name (e.g., if you want toassert_eq
)?
Right! Done.
62d0c0e
to
dca7a29
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 1 files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware, @dorimedini-starkware, @meship-starkware, and @noaov1)
crates/blockifier/src/test_utils/contracts.rs
line 236 at r3 (raw file):
let base_name = Path::new(&source_path) .file_name() .unwrap()
Are we cool with all these unwrap
s?
Code quote:
.unwrap()
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 1 files reviewed, 1 unresolved discussion (waiting on @aner-starkware, @AvivYossef-starkware, @meship-starkware, and @noaov1)
crates/blockifier/src/test_utils/contracts.rs
line 236 at r3 (raw file):
Previously, aner-starkware wrote…
Are we cool with all these
unwrap
s?
in a test util? I'd say yes, would you prefer some be expect
s?
dca7a29
to
033708e
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 1 files reviewed, all discussions resolved (waiting on @AvivYossef-starkware, @meship-starkware, and @noaov1)
crates/blockifier/src/test_utils/contracts.rs
line 236 at r3 (raw file):
Previously, dorimedini-starkware wrote…
in a test util? I'd say yes, would you prefer some be
expect
s?
OK, just checking.
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 1 files reviewed, all discussions resolved (waiting on @AvivYossef-starkware, @meship-starkware, and @noaov1)
7d707f6
to
3da45df
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: all files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware, @dorimedini-starkware, @meship-starkware, and @noaov1)
crates/blockifier/src/test_utils/contracts.rs
line 240 at r3 (raw file):
.unwrap() .strip_suffix(".cairo") .unwrap();
Your choice, but it seems easier to define a private func for the match mapping and just call it here and in the above, than to do this processing.
Code quote:
let base_name = Path::new(&source_path)
.file_name()
.unwrap()
.to_str()
.unwrap()
.strip_suffix(".cairo")
.unwrap();
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, @noaov1, and @TzahiTaub)
crates/blockifier/src/test_utils/contracts.rs
line 240 at r3 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
Your choice, but it seems easier to define a private func for the match mapping and just call it here and in the above, than to do this processing.
wdym?
not that ERC20_CAIRO0_CONTRACT_SOURCE_PATH
and ERC20_CAIRO0_CONTRACT_PATH
are not the same
3da45df
to
e4fc399
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: all files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware, @meship-starkware, @noaov1, and @TzahiTaub)
crates/blockifier/src/test_utils/contracts.rs
line 240 at r3 (raw file):
Previously, dorimedini-starkware wrote…
wdym?
not thatERC20_CAIRO0_CONTRACT_SOURCE_PATH
andERC20_CAIRO0_CONTRACT_PATH
are not the same
*note that
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, @dorimedini-starkware, @meship-starkware, and @noaov1)
crates/blockifier/src/test_utils/contracts.rs
line 240 at r3 (raw file):
Previously, dorimedini-starkware wrote…
*note that
In "in the above" I meant here (in the else clause) and in the else of get_source_path
. I.e., something like
fn get_non_erc20_base_filename(&self)) -> String:
match self {
Self::AccountWithLongValidate(_) => ACCOUNT_LONG_VALIDATE_NAME,
Self::AccountWithoutValidations(_) => ACCOUNT_WITHOUT_VALIDATIONS_NAME,
Self::Empty(_) => EMPTY_CONTRACT_NAME,
Self::FaultyAccount(_) => FAULTY_ACCOUNT_NAME,
Self::LegacyTestContract => LEGACY_CONTRACT_NAME,
Self::SecurityTests => SECURITY_TEST_CONTRACT_NAME,
Self::TestContract(_) => TEST_CONTRACT_NAME,
Self::ERC20(_) => unreachable!(),
}
pub fn get_source_path(&self) -> String {
...
else {
let base_name = self.get_non_erc20_base_filename()
...
pub fn get_compiled_path(&self) -> String {
...
else {
let base_name = self.get_non_erc20_base_filename()
e4fc399
to
d9c41fa
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 r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @AvivYossef-starkware, @meship-starkware, and @noaov1)
Merge activity
|
This change is