#![crate_name = "bitcoincore_rpc"]
#![crate_type = "rlib"]
#[macro_use]
extern crate log;
#[allow(unused)]
#[macro_use] extern crate serde;
pub extern crate jsonrpc;
pub extern crate bitcoincore_rpc_json;
pub use crate::json::bitcoin;
pub use bitcoincore_rpc_json as json;
use json::bitcoin::consensus::{Decodable, ReadExt};
use json::bitcoin::hashes::hex::HexIterator;
mod client;
mod error;
mod queryable;
pub use crate::client::*;
pub use crate::error::Error;
pub use crate::queryable::*;
fn deserialize_hex<T: Decodable>(hex: &str) -> Result<T> {
let mut reader = HexIterator::new(&hex)?;
let object = Decodable::consensus_decode(&mut reader)?;
if reader.read_u8().is_ok() {
Err(Error::BitcoinSerialization(bitcoin::consensus::encode::Error::ParseFailed(
"data not consumed entirely when explicitly deserializing",
)))
} else {
Ok(object)
}
}