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

test(blockifier): add case for cairo steps contract #1270

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

yoavGrs
Copy link
Contributor

@yoavGrs yoavGrs commented Oct 9, 2024

test(blockifier): add case for cairo steps contract


This change is Reviewable

Copy link

codecov bot commented Oct 9, 2024

Codecov Report

Attention: Patch coverage is 5.88235% with 16 lines in your changes missing coverage. Please review.

Project coverage is 72.51%. Comparing base (b0cfe82) to head (0ca3dbd).
Report is 297 commits behind head on main.

Files with missing lines Patch % Lines
crates/blockifier/src/test_utils/contracts.rs 5.88% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1270      +/-   ##
==========================================
- Coverage   74.18%   72.51%   -1.68%     
==========================================
  Files         359       93     -266     
  Lines       36240    12483   -23757     
  Branches    36240    12483   -23757     
==========================================
- Hits        26886     9052   -17834     
+ Misses       7220     3046    -4174     
+ Partials     2134      385    -1749     
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@dorimedini-starkware dorimedini-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 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @TzahiTaub and @yoavGrs)


crates/blockifier/src/test_utils/contracts.rs line 56 at r1 (raw file):

const TEST_CONTRACT_BASE: u32 = 7 * CLASS_HASH_BASE;
const ERC20_CONTRACT_BASE: u32 = 8 * CLASS_HASH_BASE;
const CAIRO_STEPS_TEST_CONTRACT_BASE: u32 = 8 * CLASS_HASH_BASE;

these should be unique

Suggestion:

9 * CLASS_HASH_BASE;

crates/blockifier/src/test_utils/contracts.rs line 76 at r1 (raw file):

const ERC20_CAIRO1_CONTRACT_PATH: &str = "./ERC20/ERC20_Cairo1/erc20.casm.json";

// The following contracts atr compiled with a fixed version of the compiler. This compiler version

typo

Code quote:

atr

crates/blockifier/src/test_utils/contracts.rs line 232 at r1 (raw file):

            Self::TestContract(_) => TEST_CONTRACT_NAME,
            Self::ERC20(_) => unreachable!(),
            Self::CairoStepsTestContract => CAIRO_STEPS_TEST_CONTRACT_NAME,

keep the unreachable at the end

Suggestion:

            Self::CairoStepsTestContract => CAIRO_STEPS_TEST_CONTRACT_NAME,
            Self::ERC20(_) => unreachable!(),

crates/blockifier/src/test_utils/contracts.rs line 282 at r1 (raw file):

            }
            CairoVersion::Cairo1 => {
                let (tag_override, cargo_nightly_arg) = if self.is_legacy() {

is this method still used anywhere?
if not please delete it

Code quote:

self.is_legacy()

test(blockifier): add case for cairo steps contract
@yoavGrs yoavGrs force-pushed the yoav/blockifier/test_track_resources/2 branch from d6a7859 to 0ca3dbd Compare October 9, 2024 12:55
Copy link
Contributor Author

@yoavGrs yoavGrs 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: 3 of 4 files reviewed, 3 unresolved discussions (waiting on @dorimedini-starkware and @TzahiTaub)


crates/blockifier/src/test_utils/contracts.rs line 56 at r1 (raw file):

Previously, dorimedini-starkware wrote…

these should be unique

Oops


crates/blockifier/src/test_utils/contracts.rs line 232 at r1 (raw file):

Previously, dorimedini-starkware wrote…

keep the unreachable at the end

Done.


crates/blockifier/src/test_utils/contracts.rs line 282 at r1 (raw file):

Previously, dorimedini-starkware wrote…

is this method still used anywhere?
if not please delete it

I already deleted it before

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @TzahiTaub)


crates/blockifier/src/test_utils/contracts.rs line 282 at r1 (raw file):

Previously, yoavGrs wrote…

I already deleted it before

ah, right, my bad

@yoavGrs yoavGrs merged commit ee4531b into main Oct 9, 2024
12 checks passed
@yoavGrs yoavGrs deleted the yoav/blockifier/test_track_resources/2 branch October 9, 2024 13:18
@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants