Skip to content

Commit d074cc9

Browse files
committed
fixup! refactor: use imports instead of qualified names
1 parent 5c01bcb commit d074cc9

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

‎crates/rpc/src/types/class.rs‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ pub mod cairo {
210210
use anyhow::Context;
211211
use base64::prelude::*;
212212
use pathfinder_class_hash::{compute_class_hash, ComputedClassHash};
213+
use pathfinder_common::class_definition::SerializedOpaqueClassDefinition;
213214
use serde::{Deserialize, Serialize};
214215

215216
/// A Cairo 0.x class.
@@ -233,10 +234,7 @@ pub mod cairo {
233234
impl CairoContractClass {
234235
pub fn class_hash(&self) -> anyhow::Result<ComputedClassHash> {
235236
let serialized = self.serialize_to_json()?;
236-
let definition =
237-
pathfinder_common::class_definition::SerializedOpaqueClassDefinition::from_bytes(
238-
serialized,
239-
);
237+
let definition = SerializedOpaqueClassDefinition::from_bytes(serialized);
240238

241239
compute_class_hash(definition)
242240
.map(|(hash, _)| hash)
@@ -658,6 +656,7 @@ pub mod cairo {
658656

659657
pub mod sierra {
660658
use pathfinder_class_hash::{compute_class_hash, ComputedClassHash};
659+
use pathfinder_common::class_definition::SerializedOpaqueClassDefinition;
661660
use pathfinder_crypto::Felt;
662661
use serde::{Deserialize, Serialize};
663662

@@ -698,10 +697,7 @@ pub mod sierra {
698697
impl SierraContractClass {
699698
pub fn class_hash(&self) -> anyhow::Result<ComputedClassHash> {
700699
let definition = serde_json::to_vec(self)?;
701-
let definition =
702-
pathfinder_common::class_definition::SerializedOpaqueClassDefinition::from_bytes(
703-
definition,
704-
);
700+
let definition = SerializedOpaqueClassDefinition::from_bytes(definition);
705701
compute_class_hash(definition).map(|(hash, _)| hash)
706702
}
707703
}

0 commit comments

Comments
 (0)