diff --git a/contracts/src/test_utils.rs b/contracts/src/test_utils.rs index b37d405e..24ea6d39 100644 --- a/contracts/src/test_utils.rs +++ b/contracts/src/test_utils.rs @@ -14,7 +14,7 @@ pub(crate) static STORAGE_MUTEX: Mutex<()> = Mutex::new(()); /// Acquires access to storage. pub(crate) fn acquire_storage() -> MutexGuard<'static, ()> { - STORAGE_MUTEX.lock().unwrap() + STORAGE_MUTEX.lock().unwrap_or_else(|e| e.into_inner()) } /// Decorates a closure by running it with exclusive access to storage.