From 8fbb18643f542f7a1709eb559bb55c751f664221 Mon Sep 17 00:00:00 2001 From: Harsh Bajpai Date: Wed, 1 Nov 2023 16:46:37 +0530 Subject: [PATCH] dev: refactor trait bounds of seqeuncer --- crates/sequencer/src/sequencer.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/sequencer/src/sequencer.rs b/crates/sequencer/src/sequencer.rs index 63ec6a15..8fea9b37 100644 --- a/crates/sequencer/src/sequencer.rs +++ b/crates/sequencer/src/sequencer.rs @@ -29,7 +29,6 @@ use starknet_api::core::ContractAddress; pub struct Sequencer where for<'any> &'any mut S: State + StateReader, - S: DumpLoad + Clone, { pub block_context: BlockContext, pub state: S, @@ -38,7 +37,6 @@ where impl Sequencer where for<'any> &'any mut S: State + StateReader, - S: DumpLoad + Clone, { /// Creates a new Sequencer instance. #[inline] @@ -49,7 +47,13 @@ where state, } } +} +impl Sequencer +where + S: DumpLoad + Clone, + for<'any> &'any mut S: State + StateReader, +{ pub fn dump_state_to_file(&self, file_path: &Path) -> Result<(), SerializationError> { self.state.clone().dump_state_to_file(file_path) } @@ -66,7 +70,6 @@ where impl Execution for Sequencer where for<'any> &'any mut S: State + StateReader + Committer, - S: DumpLoad + Clone, { /// Executes the provided transaction on the current state and leads to a commitment of the /// cached state in the case of success. Reversion of the transaction leads to a discarding