diff --git a/rusk/benches/block_ingestion.rs b/rusk/benches/block_ingestion.rs index 72f83db131..e6c2e86b60 100644 --- a/rusk/benches/block_ingestion.rs +++ b/rusk/benches/block_ingestion.rs @@ -99,7 +99,9 @@ pub fn accept_benchmark(c: &mut Criterion) { ) .expect("Accepting transactions should succeed"); - rusk.revert().expect("Reverting should succeed"); + let base_root = rusk.base_root(); + rusk.revert(base_root) + .expect("Reverting should succeed"); }) }, ); diff --git a/rusk/src/lib/lib.rs b/rusk/src/lib/lib.rs index e0a573f2f8..65341eac30 100644 --- a/rusk/src/lib/lib.rs +++ b/rusk/src/lib/lib.rs @@ -337,7 +337,7 @@ impl Rusk { pub fn revert(&self, state_hash: [u8; 32]) -> Result<[u8; 32]> { let mut inner = self.inner.lock(); - let mut commits = &inner.vm.commits(); + let commits = &inner.vm.commits(); if !commits.contains(&state_hash) { return Err(Error::CommitNotFound(state_hash)); } diff --git a/rusk/tests/services/transfer.rs b/rusk/tests/services/transfer.rs index e0ef752cb4..6636206181 100644 --- a/rusk/tests/services/transfer.rs +++ b/rusk/tests/services/transfer.rs @@ -185,7 +185,8 @@ pub async fn wallet() -> Result<()> { assert_ne!(original_root, new_root, "Root should have changed"); // Revert the state - rusk.revert().expect("Reverting should succeed"); + let base_root = rusk.base_root(); + rusk.revert(base_root).expect("Reverting should succeed"); cache.write().unwrap().clear(); // Check the state's root is back to the original one