Skip to content

Commit 1ff1ea5

Browse files
committed
apollo_state_reader: document class reader not set scenario
1 parent dfb19de commit 1ff1ea5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/apollo_state_reader/src/apollo_state.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ impl ApolloReader {
142142
class_hash: ClassHash,
143143
) -> StateResult<(CasmContractClass, SierraContractClass)> {
144144
let Some(class_reader) = &self.class_reader else {
145+
// Class reader is not set. Try to read directly from storage.
145146
let (option_casm, option_sierra) = self
146147
.reader()?
147148
.get_casm_and_sierra(&class_hash)
@@ -161,6 +162,7 @@ impl ApolloReader {
161162

162163
fn read_deprecated_casm(&self, class_hash: ClassHash) -> StateResult<Option<DeprecatedClass>> {
163164
let Some(class_reader) = &self.class_reader else {
165+
// Class reader is not set. Try to read directly from storage.
164166
let state_number = StateNumber(self.latest_block);
165167
let option_casm = self
166168
.reader()?
@@ -182,7 +184,7 @@ impl ApolloReader {
182184
class_hash: ClassHash,
183185
) -> StateResult<Option<CompiledClassHash>> {
184186
let Some(class_reader) = &self.class_reader else {
185-
// Try to read directly from storage.
187+
// Class reader is not set. Try to read directly from storage.
186188
let compiled_class_hash_v2 =
187189
self.reader()?
188190
.get_executable_class_hash_v2(&class_hash)

0 commit comments

Comments
 (0)