Skip to content

Commit

Permalink
chore: remove insert_cairo_class_at
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-melnychuk committed Sep 28, 2023
1 parent 1d633e5 commit 6a273ae
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
9 changes: 0 additions & 9 deletions crates/storage/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,6 @@ impl<'inner> Transaction<'inner> {
class::insert_cairo_class(self, cairo_hash, definition)
}

pub fn insert_cairo_class_at(
&self,
cairo_hash: ClassHash,
definition: &[u8],
block_number: BlockNumber,
) -> anyhow::Result<()> {
class::insert_cairo_class_at(self, cairo_hash, definition, block_number)
}

pub fn insert_class_commitment_leaf(
&self,
leaf: &ClassCommitmentLeafHash,
Expand Down
24 changes: 1 addition & 23 deletions crates/storage/src/connection/class.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Context;
use pathfinder_common::{BlockNumber, CasmHash, ClassCommitmentLeafHash, ClassHash, SierraHash};
use pathfinder_common::{CasmHash, ClassCommitmentLeafHash, ClassHash, SierraHash};

use crate::{prelude::*, BlockId};

Expand Down Expand Up @@ -70,28 +70,6 @@ pub(super) fn insert_cairo_class(
Ok(())
}

pub(super) fn insert_cairo_class_at(
transaction: &Transaction<'_>,
cairo_hash: ClassHash,
definition: &[u8],
block_number: BlockNumber,
) -> anyhow::Result<()> {
let mut compressor = zstd::bulk::Compressor::new(10).context("Creating zstd compressor")?;
let definition = compressor
.compress(definition)
.context("Compressing cairo definition")?;

transaction
.inner()
.execute(
r"INSERT OR IGNORE INTO class_definitions (hash, definition, block_number) VALUES (?, ?, ?)",
params![&cairo_hash, &definition, &block_number],
)
.context("Inserting cairo definition")?;

Ok(())
}

fn intern_compiler_version(
transaction: &Transaction<'_>,
compiler_version: &str,
Expand Down

0 comments on commit 6a273ae

Please sign in to comment.