Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
fix(concurrency): add assert message to the declared_contracts assert…
Browse files Browse the repository at this point in the history
…ion in validate_reads
  • Loading branch information
OriStarkware committed Jun 16, 2024
1 parent 6e06e79 commit bf08db9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/blockifier/src/concurrency/versioned_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ impl<S: StateReader> VersionedState<S> {
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 {
Expand Down Expand Up @@ -156,7 +157,11 @@ impl<S: StateReader> VersionedState<S> {
}
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."
);
}
}

Expand Down

0 comments on commit bf08db9

Please sign in to comment.