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 Nov 3, 2024
1 parent 1862aa4 commit 8b1cceb
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ impl StateReader for TestStateReader {
contract_address: ContractAddress,
key: StorageKey,
) -> StateResult<Felt> {
self.rpc_state_reader.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 8b1cceb

Please sign in to comment.