From 194d691759b7eb2644b438bb8bde051f260a4994 Mon Sep 17 00:00:00 2001 From: Harsh Bajpai Date: Tue, 26 Sep 2023 17:51:55 +0700 Subject: [PATCH] dev: rename `get_contract_class` to `contract_class` --- crates/sequencer/src/serde/contract.rs | 4 ++-- crates/sequencer/src/serde/utils.rs | 2 +- crates/sequencer/src/state.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/sequencer/src/serde/contract.rs b/crates/sequencer/src/serde/contract.rs index cd602d54..f2232909 100644 --- a/crates/sequencer/src/serde/contract.rs +++ b/crates/sequencer/src/serde/contract.rs @@ -194,11 +194,11 @@ mod tests { use starknet::core::types::contract::SierraClass; use super::*; - use crate::serde::utils::{get_contract_class, rpc_to_inner_class}; + use crate::serde::utils::{contract_class, rpc_to_inner_class}; #[test] fn serialize_and_deserialize_legacy_contract() { - let original_contract = get_contract_class(include_str!( + let original_contract = contract_class(include_str!( "../test_data/contracts/compiled/universal_deployer.json" )); diff --git a/crates/sequencer/src/serde/utils.rs b/crates/sequencer/src/serde/utils.rs index 2b71e872..f9b32d14 100644 --- a/crates/sequencer/src/serde/utils.rs +++ b/crates/sequencer/src/serde/utils.rs @@ -33,7 +33,7 @@ pub fn rpc_to_cairo_contract_class( }) } -pub fn get_contract_class(contract_class_str: &str) -> ContractClass { +pub fn contract_class(contract_class_str: &str) -> ContractClass { let legacy_contract_class: ContractClassV0 = serde_json::from_str(contract_class_str).unwrap(); ContractClass::V0(legacy_contract_class) } diff --git a/crates/sequencer/src/state.rs b/crates/sequencer/src/state.rs index b3af4f15..2f402634 100644 --- a/crates/sequencer/src/state.rs +++ b/crates/sequencer/src/state.rs @@ -213,7 +213,7 @@ mod tests { use std::path::PathBuf; - use crate::{serde::utils::get_contract_class, state::State}; + use crate::{serde::utils::contract_class, state::State}; use blockifier::state::cached_state::ContractStorageKey; use starknet_api::{ core::{ClassHash, CompiledClassHash, ContractAddress, Nonce, PatriciaKey}, @@ -329,7 +329,7 @@ mod tests { // setting up entry for state.classes let class_hash = *ONE_CLASS_HASH; - let contract_class = get_contract_class(include_str!( + let contract_class = contract_class(include_str!( "./test_data/contracts/compiled/universal_deployer.json" )); let compiled_class_hash = *ONE_COMPILED_CLASS_HASH;