From e5692b5b0c425d72ffbab966811f74da9d38c4ab Mon Sep 17 00:00:00 2001 From: Herr Seppia Date: Thu, 5 Sep 2024 17:59:28 +0200 Subject: [PATCH] rusk: add `move_to_commit` Resolves #2277 --- rusk/src/lib/node/vm.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rusk/src/lib/node/vm.rs b/rusk/src/lib/node/vm.rs index ad85255941..f18e0ba807 100644 --- a/rusk/src/lib/node/vm.rs +++ b/rusk/src/lib/node/vm.rs @@ -97,6 +97,13 @@ impl VMExecution for Rusk { Ok((txs, verification_output)) } + fn move_to_commit(&self, commit: [u8; 32]) -> anyhow::Result<()> { + self.session(0, Some(commit)) + .map_err(|e| anyhow::anyhow!("Cannot open session {e}"))?; + self.set_current_commit(commit); + Ok(()) + } + fn finalize_state( &self, commit: [u8; 32],