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

Commit

Permalink
fix(concurrency): fix the tx_index offset in validate_reads and apply…
Browse files Browse the repository at this point in the history
…_writes
  • Loading branch information
OriStarkware committed Jun 13, 2024
1 parent 4505d16 commit d1cadaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 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,7 @@ 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 + 1, class_hash).is_some()
self.compiled_contract_classes.read(tx_index, class_hash).is_some()
);

if &is_declared != expected_value {
Expand Down Expand Up @@ -156,7 +156,7 @@ 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 + 1, key).is_some());
assert_eq!(value, self.compiled_contract_classes.read(tx_index, key).is_some());
}
}

Expand Down

0 comments on commit d1cadaf

Please sign in to comment.