-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
277 additions
and
318 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,29 +1,2 @@ | ||
use cairo_vm::{ | ||
hint_processor::builtin_hint_processor::builtin_hint_processor_definition::HintProcessorData, | ||
types::exec_scope::ExecutionScopes, | ||
vm::{errors::hint_errors::HintError, vm_core::VirtualMachine}, | ||
Felt252, | ||
}; | ||
use std::collections::HashMap; | ||
|
||
mod bit_length; | ||
mod left_child; | ||
|
||
pub fn run_hint( | ||
vm: &mut VirtualMachine, | ||
exec_scope: &mut ExecutionScopes, | ||
hint_data: &HintProcessorData, | ||
constants: &HashMap<String, Felt252>, | ||
) -> Result<(), HintError> { | ||
match hint_data.code.as_str() { | ||
bit_length::MMR_BIT_LENGTH => { | ||
bit_length::mmr_bit_length(vm, exec_scope, hint_data, constants) | ||
} | ||
left_child::MMR_LEFT_CHILD => { | ||
left_child::mmr_left_child(vm, exec_scope, hint_data, constants) | ||
} | ||
_ => Err(HintError::UnknownHint( | ||
hint_data.code.to_string().into_boxed_str(), | ||
)), | ||
} | ||
} |
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,40 +1,6 @@ | ||
use cairo_vm::{ | ||
hint_processor::builtin_hint_processor::builtin_hint_processor_definition::HintProcessorData, | ||
types::exec_scope::ExecutionScopes, | ||
vm::{errors::hint_errors::HintError, vm_core::VirtualMachine}, | ||
Felt252, | ||
}; | ||
use std::collections::HashMap; | ||
|
||
mod bit_length; | ||
mod block_header; | ||
mod mmr; | ||
mod mpt; | ||
mod rlp_little; | ||
mod utils; | ||
|
||
pub fn run_hint( | ||
vm: &mut VirtualMachine, | ||
exec_scope: &mut ExecutionScopes, | ||
hint_data: &HintProcessorData, | ||
constants: &HashMap<String, Felt252>, | ||
) -> Result<(), HintError> { | ||
let hints = [ | ||
bit_length::run_hint, | ||
block_header::run_hint, | ||
mmr::run_hint, | ||
mpt::run_hint, | ||
rlp_little::run_hint, | ||
utils::run_hint, | ||
]; | ||
|
||
for hint in hints.iter() { | ||
let res = hint(vm, exec_scope, hint_data, constants); | ||
if !matches!(res, Err(HintError::UnknownHint(_))) { | ||
return res; | ||
} | ||
} | ||
Err(HintError::UnknownHint( | ||
hint_data.code.to_string().into_boxed_str(), | ||
)) | ||
} |
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
Oops, something went wrong.