Skip to content

Commit

Permalink
fixup: remove class hash preconditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirko-von-Leipzig committed Sep 5, 2022
1 parent 51502c1 commit 8e15e63
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions crates/pathfinder/src/state/class_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,26 +151,7 @@ fn compute_class_hash0(mut contract_definition: json::ContractDefinition<'_>) ->
) -> std::borrow::Cow<'a, str> {
use std::borrow::Cow::*;
match key {
"cairo_type" => {
if let Some(tuple_inner) = value.strip_prefix('(').and_then(|v| v.strip_suffix(')'))
{
let new_val = format!("({})", add_extra_space_before_colon(tuple_inner));
Owned(new_val)
} else {
Borrowed(value)
}
}
"value" => {
if let Some(cast_inner) = value
.strip_prefix("[cast(")
.and_then(|v| v.strip_suffix(")]"))
{
let new_val = format!("[cast({})]", add_extra_space_before_colon(cast_inner));
Owned(new_val)
} else {
Borrowed(value)
}
}
"cairo_type" | "value" => Owned(add_extra_space_before_colon(value)),
_ => Borrowed(value),
}
}
Expand Down

0 comments on commit 8e15e63

Please sign in to comment.