Skip to content

Commit

Permalink
fix(blockifier_reexecution): bug in get storage at
Browse files Browse the repository at this point in the history
  • Loading branch information
AvivYossef-starkware committed Oct 31, 2024
1 parent 63e0d12 commit 067762c
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ impl StateReader for TestStateReader {
contract_address: ContractAddress,
key: StorageKey,
) -> StateResult<Felt> {
self.0.get_storage_at(contract_address, key)
match self.0.get_storage_at(contract_address, key) {
Ok(value) => Ok(value),
// If the contract address is not found, The blockifier expect to get the default value
// of felt.
Err(e) if e.to_string().contains("Contract address not found for request") => {
Ok(Felt::default())
}
Err(e) => panic!("Unexpected error in get_storage_at: {:?}", e),
}
}

fn get_class_hash_at(&self, contract_address: ContractAddress) -> StateResult<ClassHash> {
Expand Down

0 comments on commit 067762c

Please sign in to comment.