Skip to content

Commit

Permalink
modify finality state
Browse files Browse the repository at this point in the history
  • Loading branch information
dimazhornyk committed Dec 20, 2024
1 parent a5cf30f commit 7998a1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/node/da_clients/src/avail/sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use zksync_types::H256;
use crate::utils::to_non_retriable_da_error;

const PROTOCOL_VERSION: u8 = 4;
const FINALITY_STATE: &str = "inBlock";

/// An implementation of the `DataAvailabilityClient` trait that interacts with the Avail network.
#[derive(Debug, Clone)]
Expand Down Expand Up @@ -291,7 +292,7 @@ impl RawAvailClient {
let status = sub.next().await.transpose()?;

if status.is_some() && status.as_ref().unwrap().is_object() {
if let Some(block_hash) = status.unwrap().get("finalized") {
if let Some(block_hash) = status.unwrap().get(FINALITY_STATE) {
break block_hash
.as_str()
.ok_or_else(|| anyhow::anyhow!("Invalid block hash"))?
Expand Down

0 comments on commit 7998a1b

Please sign in to comment.