From 9d12a43560dfb423384f0684ab51d0abb06d0e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Efe=20Ak=C3=A7a?= Date: Thu, 27 Feb 2025 18:17:40 +0300 Subject: [PATCH] fix: errors --- core/src/states/mod.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/src/states/mod.rs b/core/src/states/mod.rs index 8985a875..5057dca7 100644 --- a/core/src/states/mod.rs +++ b/core/src/states/mod.rs @@ -1,4 +1,4 @@ -use crate::builder::transaction::OperatorData; +use crate::builder::transaction::{OperatorData, TransactionType, TxHandler}; use crate::config::protocol::ProtocolParamset; use crate::database::Database; use crate::errors::BridgeError; @@ -193,11 +193,16 @@ pub struct StateManager { impl StateManager { pub fn new(db: Database, handler: T, paramset: &'static ProtocolParamset) -> Self { Self { - db, - owner: handler, round_machines: Vec::new(), kickoff_machines: Vec::new(), - context: StateContext::new(db, handler, Default::default(), paramset), + context: StateContext::new( + db.clone(), + Arc::new(handler.clone()), + Default::default(), + paramset, + ), + db, + owner: handler, paramset, } } @@ -270,7 +275,7 @@ impl StateManager { // Enhanced method for parallel processing pub async fn process_block_parallel(&mut self, block: &Block) -> Result<(), BridgeError> { - let cache: BlockCache = Default::default(); + let mut cache: BlockCache = Default::default(); cache.update_with_block(block); // Create a base context with updated cache