Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
refactor(execution): remove fee weights from config (#1487)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoni-Starkware committed Feb 12, 2024
1 parent 53cd1b4 commit fdfba79
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions crates/native_blockifier/src/py_block_executor.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::collections::HashMap;
use std::sync::Arc;

use blockifier::block::{
pre_process_block as pre_process_block_blockifier, BlockInfo, BlockNumberHashPair, GasPrices,
Expand Down Expand Up @@ -273,26 +272,17 @@ impl PyBlockExecutor {
#[derive(Default)]
pub struct PyGeneralConfig {
pub starknet_os_config: PyOsConfig,
pub cairo_resource_fee_weights: Arc<HashMap<String, f64>>,
pub invoke_tx_max_n_steps: u32,
pub validate_max_n_steps: u32,
}

impl FromPyObject<'_> for PyGeneralConfig {
fn extract(general_config: &PyAny) -> PyResult<Self> {
let starknet_os_config: PyOsConfig = py_attr(general_config, "starknet_os_config")?;
let cairo_resource_fee_weights: HashMap<String, f64> =
py_attr(general_config, "cairo_resource_fee_weights")?;
let cairo_resource_fee_weights = Arc::new(cairo_resource_fee_weights);
let invoke_tx_max_n_steps: u32 = py_attr(general_config, "invoke_tx_max_n_steps")?;
let validate_max_n_steps: u32 = py_attr(general_config, "validate_max_n_steps")?;

Ok(Self {
starknet_os_config,
cairo_resource_fee_weights,
invoke_tx_max_n_steps,
validate_max_n_steps,
})
Ok(Self { starknet_os_config, invoke_tx_max_n_steps, validate_max_n_steps })
}
}

Expand Down

0 comments on commit fdfba79

Please sign in to comment.