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

fix(concurrency): add assert message to the declared_contracts assertion in validate_reads #1981

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 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,9 @@ 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 +158,12 @@ 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
Loading