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

moved proof parser to crate, added proof as felts #65

Closed
wants to merge 3 commits into from

Conversation

chudkowsky
Copy link
Collaborator

I included proof parsing to felt from https://github.com/HerodotusDev/integrity/tree/main/runner/src
and changed there Felt252 from cairo-felt to Felt from starknet_types_core

Copy link
Collaborator

@piniom piniom left a comment

Choose a reason for hiding this comment

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

I've left some general comments, but feel free to ignore them if you think it's not that important

/// It provides convenience methods for working with a vector of `Arg` and implements
/// `Deref` to allow it to be treated like a vector of `Arg`.
#[derive(Debug, Clone)]
pub struct VecFelt(Vec<Felt>);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why Arg here, where the type is Felt?

impl<'de> Visitor<'de> for VecFelt {
type Value = VecFelt;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("a list of arguments")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe add a more elaborate expectation?

}

impl VecFelt {
fn visit_seq_helper(seq: &[Value]) -> Result<Self, VecFeltError> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems a bit complicated, I suggest creating an enum that would be easily deserializable and adding a converter function to VecFelt. The logic will remain the same but the intent would be much clearer

@chudkowsky chudkowsky closed this Sep 20, 2024
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