Skip to content

Commit

Permalink
dev: rename get_contract_class to contract_class
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsh Bajpai authored and Harsh Bajpai committed Sep 26, 2023
1 parent 536b155 commit 194d691
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions crates/sequencer/src/serde/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
));

Expand Down
2 changes: 1 addition & 1 deletion crates/sequencer/src/serde/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
4 changes: 2 additions & 2 deletions crates/sequencer/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},

Check failure on line 219 in crates/sequencer/src/state.rs

View workflow job for this annotation

GitHub Actions / clippy

unused imports: `ClassHash`, `CompiledClassHash`, `ContractAddress`, `PatriciaKey`, `StarkFelt`, `StarkHash`, `patricia_key`, `stark_felt`
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 194d691

Please sign in to comment.