Skip to content

Commit cf45842

Browse files
apollo_gateway: move get_latest_block_info to be async
1 parent cc3937b commit cf45842

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

crates/apollo_gateway/src/stateful_transaction_validator.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl StatefulTransactionValidatorFactoryTrait for StatefulTransactionValidatorFa
8080
e,
8181
)
8282
})?;
83-
let latest_block_info = get_latest_block_info(&state_reader, runtime)?;
83+
let latest_block_info = runtime.block_on(get_latest_block_info(&state_reader))?;
8484

8585
let state_reader_and_contract_manager = StateReaderAndContractManager {
8686
state_reader,
@@ -349,12 +349,11 @@ fn skip_stateful_validations(
349349
Ok(false)
350350
}
351351

352-
// TODO(Itamar): Remove using runtime here and make it async.
353-
pub fn get_latest_block_info(
352+
async fn get_latest_block_info(
354353
state_reader: &dyn MempoolStateReader,
355-
runtime: tokio::runtime::Handle,
356354
) -> StatefulTransactionValidatorResult<BlockInfo> {
357-
runtime
358-
.block_on(state_reader.get_block_info())
355+
state_reader
356+
.get_block_info()
357+
.await
359358
.map_err(|e| StarknetError::internal_with_logging("Failed to get latest block info", e))
360359
}

0 commit comments

Comments
 (0)