From 8e15e63be2311bc59a1906792b09e3a1f00889be Mon Sep 17 00:00:00 2001 From: Mirko von Leipzig Date: Mon, 5 Sep 2022 16:50:49 +0200 Subject: [PATCH] fixup: remove class hash preconditions --- crates/pathfinder/src/state/class_hash.rs | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/crates/pathfinder/src/state/class_hash.rs b/crates/pathfinder/src/state/class_hash.rs index d24c807e42..b1a2f44b4a 100644 --- a/crates/pathfinder/src/state/class_hash.rs +++ b/crates/pathfinder/src/state/class_hash.rs @@ -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), } }