diff --git a/Cargo.lock b/Cargo.lock index 8c3133c2..e828c302 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -45,9 +45,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bitcoinsv" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b24ef5ce841998ba1416a91bc87d82e7683578bf30cfe86a84b9530ea2e287a2" +checksum = "1885e366e5aea4713630e533d14ee871951307abed5d4eb771d900cb67e95403" dependencies = [ "async-trait", "futures", diff --git a/client/Cargo.toml b/client/Cargo.toml index 75c43d90..c1d871a9 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -23,7 +23,7 @@ jsonrpc = { version = "0.16.0", features = ["minreq_http"]} serde = "1" serde_json = "1" hex = "0.4.3" -bitcoinsv = "0.2.1" +bitcoinsv = "0.2.2" async-trait = "0.1.75" [dev-dependencies] diff --git a/client/src/client.rs b/client/src/client.rs index d31b74ed..470bcf1c 100644 --- a/client/src/client.rs +++ b/client/src/client.rs @@ -259,7 +259,7 @@ pub trait RpcApi: Sized { /// Returns the block header as a BlockHeader struct. fn get_block_header(&self, hash: &BlockHash) -> Result { - let hex: String = self.call("getblockheader", &[into_json(hash)?, false.into()])?; + let hex: String = self.call("getblockheader", &[into_json(hash)?, 0.into()])?; Ok(BlockHeader::from_hex(hex)?) } @@ -268,7 +268,7 @@ pub trait RpcApi: Sized { &self, hash: &BlockHash, ) -> Result { - self.call("getblockheader", &[into_json(hash)?, true.into()]) + self.call("getblockheader", &[into_json(hash)?, 2.into()]) } /// Compute per block statistics for a given window. diff --git a/json/Cargo.toml b/json/Cargo.toml index 9f7db9e4..4b70f25d 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -20,7 +20,7 @@ path = "src/lib.rs" hex = "0.4.3" serde = { version = "1", features = [ "derive" ] } serde_json = "1" -bitcoinsv = "0.2.1" +bitcoinsv = "0.2.2" [dev-dependencies] approx = "0.5" diff --git a/json/src/lib.rs b/json/src/lib.rs index fd736559..270ff80f 100644 --- a/json/src/lib.rs +++ b/json/src/lib.rs @@ -13,7 +13,7 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; use std::fmt; pub use bitcoinsv::Error; -pub use bitcoinsv::bitcoin::{BlockchainId, BlockHash, Encodable, MerkleRoot, Tx, TxHash}; +pub use bitcoinsv::bitcoin::{BlockchainId, BlockHash, Encodable, Hash, MerkleRoot, Tx, TxHash}; pub use bitcoinsv::util::Amount; /// A module used for serde serialization of bytes in hexadecimal format. @@ -338,6 +338,10 @@ pub struct GetBlockHeaderResult { #[serde(rename = "nextblockhash")] pub next_block_hash: Option, pub status: GetBlockResultStatus, + #[serde(rename = "tx")] + pub coinbase_tx: GetRawTransactionResult, + #[serde(rename = "merkleproof")] + pub coinbase_merkle_proof: Vec, } #[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]