-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: replace
ProverInput
generic for an enum (#57)
* replaced ProverInput generic for an enum * fix serialization * cargo-fmt
- Loading branch information
Showing
12 changed files
with
41 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
pub mod cairo0_prover_input; | ||
pub mod cairo_prover_input; | ||
pub mod models; | ||
pub mod prover_input; | ||
pub mod requests; | ||
pub trait ProverInput { | ||
fn serialize(self) -> serde_json::Value; | ||
} |
8 changes: 1 addition & 7 deletions
8
common/src/cairo_prover_input.rs → common/src/prover_input/cairo.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
common/src/cairo0_prover_input.rs → common/src/prover_input/cairo0.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
mod cairo; | ||
mod cairo0; | ||
|
||
pub use cairo::{CairoCompiledProgram, CairoProverInput}; | ||
pub use cairo0::{Cairo0CompiledProgram, Cairo0ProverInput}; | ||
|
||
#[derive(Debug)] | ||
pub enum ProverInput { | ||
Cairo0(Cairo0ProverInput), | ||
Cairo(CairoProverInput), | ||
} | ||
|
||
impl ProverInput { | ||
pub fn to_json_value(&self) -> serde_json::Value { | ||
match self { | ||
ProverInput::Cairo0(input) => serde_json::to_value(input).unwrap(), | ||
ProverInput::Cairo(input) => serde_json::to_value(input).unwrap(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters