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

Fix returned error array. #6442

Merged
merged 1 commit into from
Oct 1, 2024
Merged

Fix returned error array. #6442

merged 1 commit into from
Oct 1, 2024

Conversation

ilyalesokhin-starkware
Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware commented Oct 1, 2024

This change is Reviewable

Copy link
Collaborator

@orizi orizi 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: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-runner/src/casm_run/mod.rs line 322 at r1 (raw file):

            Felt252::from_bytes_be_slice($reason2),
        ]))
    };

maybe this would be a bit clearer?
(and allows for easier future mixing of all the other macro-rule options)

Suggestion:

    ($reason:expr) => {
        return Ok(SyscallResult::Failure(vec![Felt252::from_bytes_be_slice($reason)]))
    };
    ($existing:ident, $reason:expr) => {
        $existing.push(Felt252::from_bytes_be_slice($reason));
        return Ok(SyscallResult::Failure($existing))
    };
    ([$reason1:expr, $reason2:expr]) => {
        return Ok(SyscallResult::Failure(vec![
            Felt252::from_bytes_be_slice($reason1),
            Felt252::from_bytes_be_slice($reason2),
        ]))
    };

Copy link
Contributor Author

@ilyalesokhin-starkware ilyalesokhin-starkware 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: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @orizi)


crates/cairo-lang-runner/src/casm_run/mod.rs line 322 at r1 (raw file):

Previously, orizi wrote…

maybe this would be a bit clearer?
(and allows for easier future mixing of all the other macro-rule options)

Done.

Copy link
Collaborator

@orizi orizi 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 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware)

@ilyalesokhin-starkware ilyalesokhin-starkware added this pull request to the merge queue Oct 1, 2024
Merged via the queue into main with commit 227cea9 Oct 1, 2024
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants