const GET_TX_OUT_SET_INFO_COMMAND: &str = "gettxoutsetinfo";
const DEFAULT_HASH_TYPE_ARG: &str = "hash_serialized_2";
use crate::client::Client;
use crate::command::request::request;
use crate::command::CallableCommand;
use serde::Deserialize;
use serde::Serialize;
use serde_json::value::{to_raw_value, RawValue};
pub struct GetTxOutSetInfoCommand {}
impl GetTxOutSetInfoCommand {
pub fn new() -> Self {
GetTxOutSetInfoCommand {}
}
}
#[derive(Serialize, Deserialize, Debug)]
pub struct GetTxOutSetInfoCommandResponse {
pub height: u64, pub bestblock: String, pub transactions: u64, pub txouts: u64, pub bogosize: u64, pub hash_serialized_2: String, pub disk_size: u64, pub total_amount: f64, }
impl CallableCommand for GetTxOutSetInfoCommand {
type Response = GetTxOutSetInfoCommandResponse;
fn call(&self, client: &Client) -> Result<Self::Response, jsonrpc::Error> {
let command = GET_TX_OUT_SET_INFO_COMMAND;
let params: Vec<Box<RawValue>> = vec![];
let r = request(client, command, params);
let response: GetTxOutSetInfoCommandResponse = r.result()?;
Ok(response)
}
}