Skip to content

Commit

Permalink
fix: indexing status can return null values (#1013)
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenzing authored Aug 14, 2024
1 parent 50ecdb9 commit fc1706d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion libs/blockscout-client/crate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blockscout-client"
version = "0.1.0"
version = "0.1.1"
authors = ["[email protected]"]
description = "API for BlockScout web app"
license = "Apache 2.0"
Expand Down
22 changes: 3 additions & 19 deletions libs/blockscout-client/crate/src/models/indexing_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,14 @@
use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[derive(derive_new::new, Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IndexingStatus {
#[serde(rename = "finished_indexing")]
pub finished_indexing: bool,
#[serde(rename = "finished_indexing_blocks")]
pub finished_indexing_blocks: bool,
#[serde(rename = "indexed_blocks_ratio")]
pub indexed_blocks_ratio: String,
pub indexed_blocks_ratio: Option<String>, // changed
#[serde(rename = "indexed_internal_transactions_ratio")]
pub indexed_internal_transactions_ratio: String,
}

impl IndexingStatus {
pub fn new(
finished_indexing: bool,
finished_indexing_blocks: bool,
indexed_blocks_ratio: String,
indexed_internal_transactions_ratio: String,
) -> IndexingStatus {
IndexingStatus {
finished_indexing,
finished_indexing_blocks,
indexed_blocks_ratio,
indexed_internal_transactions_ratio,
}
}
pub indexed_internal_transactions_ratio: Option<String>, // changed
}

0 comments on commit fc1706d

Please sign in to comment.