diff --git a/lgn-messages/src/types/v1/query/mod.rs b/lgn-messages/src/types/v1/query/mod.rs index 40bb964..d43f8e1 100644 --- a/lgn-messages/src/types/v1/query/mod.rs +++ b/lgn-messages/src/types/v1/query/mod.rs @@ -1,10 +1,5 @@ use crate::types::v1::query::tasks::QueryInput; -use alloy_primitives::U256; -use derive_debug_plus::Dbg; use serde_derive::{Deserialize, Serialize}; -use std::collections::HashMap; -use verifiable_db::query::computational_hash_ids::PlaceholderIdentifier; -use verifiable_db::query::universal_circuit::universal_circuit_inputs::Placeholders; pub mod keys; pub mod tasks; @@ -36,41 +31,3 @@ pub enum WorkerTaskType { #[serde(rename = "1")] Query(QueryInput), } - -#[derive(Dbg, Clone, PartialEq, Deserialize, Serialize)] -pub struct PlaceHolderLgn(HashMap); - -impl From for Placeholders { - fn from(ph: PlaceHolderLgn) -> Self { - let min_block = ph.0.get("0").cloned().unwrap(); - let max_block = ph.0.get("1").cloned().unwrap(); - let mut placeholders = Placeholders::new_empty(min_block, max_block); - - for (k, v) in ph.0.into_iter() { - if k != "0" && k != "1" { - let index = k.parse::().unwrap(); - placeholders.insert(PlaceholderIdentifier::Generic(index - 1), v); - } - } - - placeholders - } -} - -impl From for PlaceHolderLgn { - fn from(ph: Placeholders) -> Self { - let min_block = ph.get(&PlaceholderIdentifier::MinQueryOnIdx1).unwrap(); - let max_block = ph.get(&PlaceholderIdentifier::MaxQueryOnIdx1).unwrap(); - let mut map = HashMap::new(); - map.insert(0.to_string(), min_block); - map.insert(1.to_string(), max_block); - - for (k, v) in ph.0.iter() { - if let PlaceholderIdentifier::Generic(i) = k { - map.insert((*i + 1).to_string(), *v); - } - } - - PlaceHolderLgn(map) - } -} diff --git a/lgn-messages/src/types/v1/query/tasks.rs b/lgn-messages/src/types/v1/query/tasks.rs index 754b2b1..846e4e3 100644 --- a/lgn-messages/src/types/v1/query/tasks.rs +++ b/lgn-messages/src/types/v1/query/tasks.rs @@ -1,11 +1,11 @@ use crate::types::v1::preprocessing::db_keys; use crate::types::v1::query::keys::ProofKey; -use crate::types::v1::query::{PlaceHolderLgn, WorkerTask, WorkerTaskType}; +use crate::types::v1::query::{WorkerTask, WorkerTaskType}; use alloy_primitives::U256; use derive_debug_plus::Dbg; use serde_derive::{Deserialize, Serialize}; use verifiable_db::query::aggregation::{ChildPosition, NodeInfo}; -use verifiable_db::query::universal_circuit::universal_circuit_inputs::RowCells; +use verifiable_db::query::universal_circuit::universal_circuit_inputs::{Placeholders, RowCells}; #[derive(Dbg, Clone, PartialEq, Deserialize, Serialize)] pub struct QueryInput { @@ -98,7 +98,7 @@ pub enum EmbeddedProofInputType { pub struct RowsEmbeddedProofInput { pub column_cells: RowCells, - pub placeholders: PlaceHolderLgn, + pub placeholders: Placeholders, pub is_leaf: bool, } @@ -147,7 +147,7 @@ pub struct SinglePathLeafInput { #[derive(Clone, PartialEq, Dbg, Deserialize, Serialize)] pub struct RevelationInput { - pub placeholders: PlaceHolderLgn, + pub placeholders: Placeholders, pub indexing_proof_location: db_keys::ProofKey, @@ -164,7 +164,7 @@ pub struct RevelationInput { pub struct NonExistenceInput { pub column_ids: Vec, - pub placeholders: PlaceHolderLgn, + pub placeholders: Placeholders, pub is_rows_tree_node: bool,