Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy committed Feb 9, 2024
1 parent 889831e commit 5eac6d1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ members = [
"crates/katana/rpc/rpc-api",
"crates/katana/rpc/rpc-types",
"crates/katana/rpc/rpc-types-builder",
"crates/katana/runner",
"crates/katana/runner/runner-macro",
"crates/katana/storage/codecs",
"crates/katana/storage/codecs/derive",
"crates/katana/storage/db",
"crates/katana/storage/provider",
"crates/katana/runner",
"crates/katana/runner/runner-macro",
"crates/metrics",
"crates/saya/core",
"crates/sozo/signers",
Expand Down Expand Up @@ -180,8 +180,8 @@ wasm-tonic = { version = "0.9.2", default-features = false, features = [ "codege
wasm-tonic-build = { version = "0.9.2", default-features = false, features = [ "prost" ], package = "tonic-build" }

[patch."https://github.com/starkware-libs/blockifier"]
blockifier = { git = "https://github.com/dojoengine/blockifier", rev = "3c138d606a46c88ecd656808f14dfca78de1926b" }
blockifier = { git = "https://github.com/dojoengine/blockifier", rev = "8860946" }

[patch.crates-io]
cairo-felt = { git = "https://github.com/dojoengine/cairo-rs.git", rev = "368c713f8545af435b1b0a8d3e56b616f66f955a" }
cairo-vm = { git = "https://github.com/dojoengine/cairo-rs.git", rev = "368c713f8545af435b1b0a8d3e56b616f66f955a" }
cairo-felt = { git = "https://github.com/dojoengine/cairo-rs.git", rev = "1031381" }
cairo-vm = { git = "https://github.com/dojoengine/cairo-rs.git", rev = "1031381" }
10 changes: 6 additions & 4 deletions crates/katana/primitives/src/conversion/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use anyhow::{anyhow, Result};
use blockifier::execution::contract_class::ContractClassV0;
use cairo_lang_starknet::casm_contract_class::CasmContractClass;
use cairo_vm::felt::Felt252;
use cairo_vm::serde::deserialize_program::{ApTracking, OffsetValue, ProgramJson, ValueAddress};
use cairo_vm::serde::deserialize_program::{
serialize_program_data, ApTracking, OffsetValue, ProgramJson, ValueAddress,
};
use cairo_vm::types::instruction::Register;
use cairo_vm::types::program::Program;
use serde::{Deserialize, Serialize, Serializer};
Expand Down Expand Up @@ -253,7 +255,7 @@ fn compress_legacy_program_data(legacy_program: Program) -> Result<Vec<u8>, io::
struct SerializableProgramJson {
prime: String,
builtins: Vec<BuiltinName>,
#[serde(deserialize_with = "deserialize_array_of_bigint_hex")]
#[serde(serialize_with = "serialize_program_data")]
data: Vec<MaybeRelocatable>,
identifiers: HashMap<String, Identifier>,
hints: BTreeMap<usize, Vec<HintParams>>,
Expand All @@ -270,9 +272,9 @@ fn compress_legacy_program_data(legacy_program: Program) -> Result<Vec<u8>, io::
let program: ProgramJson = ProgramJson::from(legacy_program);
let program: SerializableProgramJson = unsafe { mem::transmute(program) };

let buffer = serde_json::to_vec(&program)?;
let bytes = serde_json::to_vec(&program)?;
let mut gzip_encoder = flate2::write::GzEncoder::new(Vec::new(), flate2::Compression::fast());
Write::write_all(&mut gzip_encoder, &buffer)?;
Write::write_all(&mut gzip_encoder, &bytes)?;
gzip_encoder.finish()
}

Expand Down

0 comments on commit 5eac6d1

Please sign in to comment.