use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BlockContent {
#[serde(rename = "time")]
pub time: i32,
#[serde(rename = "height", deserialize_with = "Option::deserialize")]
pub height: Option<i32>,
#[serde(rename = "hash")]
pub hash: String,
#[serde(rename = "slot", deserialize_with = "Option::deserialize")]
pub slot: Option<i32>,
#[serde(rename = "epoch", deserialize_with = "Option::deserialize")]
pub epoch: Option<i32>,
#[serde(rename = "epoch_slot", deserialize_with = "Option::deserialize")]
pub epoch_slot: Option<i32>,
#[serde(rename = "slot_leader")]
pub slot_leader: String,
#[serde(rename = "size")]
pub size: i32,
#[serde(rename = "tx_count")]
pub tx_count: i32,
#[serde(rename = "output", deserialize_with = "Option::deserialize")]
pub output: Option<String>,
#[serde(rename = "fees", deserialize_with = "Option::deserialize")]
pub fees: Option<String>,
#[serde(rename = "block_vrf", deserialize_with = "Option::deserialize")]
pub block_vrf: Option<String>,
#[serde(rename = "op_cert", deserialize_with = "Option::deserialize")]
pub op_cert: Option<String>,
#[serde(rename = "op_cert_counter", deserialize_with = "Option::deserialize")]
pub op_cert_counter: Option<String>,
#[serde(rename = "previous_block", deserialize_with = "Option::deserialize")]
pub previous_block: Option<String>,
#[serde(rename = "next_block", deserialize_with = "Option::deserialize")]
pub next_block: Option<String>,
#[serde(rename = "confirmations")]
pub confirmations: i32,
}
impl BlockContent {
pub fn new(time: i32, height: Option<i32>, hash: String, slot: Option<i32>, epoch: Option<i32>, epoch_slot: Option<i32>, slot_leader: String, size: i32, tx_count: i32, output: Option<String>, fees: Option<String>, block_vrf: Option<String>, op_cert: Option<String>, op_cert_counter: Option<String>, previous_block: Option<String>, next_block: Option<String>, confirmations: i32) -> BlockContent {
BlockContent {
time,
height,
hash,
slot,
epoch,
epoch_slot,
slot_leader,
size,
tx_count,
output,
fees,
block_vrf,
op_cert,
op_cert_counter,
previous_block,
next_block,
confirmations,
}
}
}