From 613320f30a68cf8c6c66af11c2356a4ebab24607 Mon Sep 17 00:00:00 2001 From: Ori Friedlender Date: Thu, 13 Jun 2024 16:51:04 +0300 Subject: [PATCH] fix(concurrency): add assert message to the declared_contracts assertion in validate_reads --- crates/blockifier/src/concurrency/versioned_state.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/blockifier/src/concurrency/versioned_state.rs b/crates/blockifier/src/concurrency/versioned_state.rs index 7b40ecca80..4b4be73ed0 100644 --- a/crates/blockifier/src/concurrency/versioned_state.rs +++ b/crates/blockifier/src/concurrency/versioned_state.rs @@ -121,7 +121,9 @@ impl VersionedState { let is_declared = self.declared_contracts.read(tx_index, class_hash).expect(READ_ERR); assert_eq!( is_declared, - self.compiled_contract_classes.read(tx_index, class_hash).is_some() + self.compiled_contract_classes.read(tx_index, class_hash).is_some(), + "The declared contracts mapping should match the compiled contract classes \ + mapping." ); if &is_declared != expected_value { @@ -156,7 +158,12 @@ impl VersionedState { } for (&key, &value) in &writes.declared_contracts { self.declared_contracts.write(tx_index, key, value); - assert_eq!(value, self.compiled_contract_classes.read(tx_index, key).is_some()); + assert_eq!( + value, + self.compiled_contract_classes.read(tx_index, key).is_some(), + "The declared contracts mapping should match the compiled contract classes \ + mapping." + ); } }