diff --git a/crates/engine/tree/src/tree/root.rs b/crates/engine/tree/src/tree/root.rs index 93cac7b435ed..717c75b04ac5 100644 --- a/crates/engine/tree/src/tree/root.rs +++ b/crates/engine/tree/src/tree/root.rs @@ -202,8 +202,8 @@ impl ProofSequencer { } /// A wrapper for the sender that signals completion when dropped -#[derive(Deref)] -pub(crate) struct StateHookSender(Sender>); +#[derive(Deref, Debug)] +pub struct StateHookSender(Sender>); impl StateHookSender { pub(crate) const fn new(inner: Sender>) -> Self { @@ -325,9 +325,14 @@ where StateRootHandle::new(rx) } + /// Returns a [`StateHookSender`] that can be used to send state updates to this task. + pub fn state_hook_sender(&self) -> StateHookSender { + StateHookSender::new(self.tx.clone()) + } + /// Returns a state hook to be used to send state updates to this task. pub fn state_hook(&self) -> impl OnStateHook { - let state_hook = StateHookSender::new(self.tx.clone()); + let state_hook = self.state_hook_sender(); move |state: &EvmState| { if let Err(error) = state_hook.send(StateRootMessage::StateUpdate(state.clone())) {