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 e9b484e commit cc6159d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ 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 cc6159d

Please sign in to comment.