Skip to content

Commit

Permalink
fix BlockchainInfo opt height and snake_case on size_on_disk
Browse files Browse the repository at this point in the history
  • Loading branch information
canonbrother committed May 3, 2024
1 parent 0494b50 commit d06b296
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion json/src/blockchain.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
use std::collections::HashMap;

use bitcoin::{BlockHash, Txid};
use serde_with::skip_serializing_none;

#[skip_serializing_none]
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SoftforkInfo {
r#type: String,
active: bool,
pub height: u32,
pub height: Option<u32>,
}

#[derive(Debug, Serialize, Deserialize)]
Expand All @@ -22,6 +24,7 @@ pub struct BlockchainInfo {
verificationprogress: u64,
initialblockdownload: bool,
chainwork: String,
#[serde(rename = "size_on_disk")]
size_on_disk: u64,
pruned: bool,
pub softforks: HashMap<String, SoftforkInfo>,
Expand Down

0 comments on commit d06b296

Please sign in to comment.