Function zcash_client_sqlite::wallet::get_block_hash[][src]

pub fn get_block_hash<P>(
    wdb: &WalletDb<P>,
    block_height: BlockHeight
) -> Result<Option<BlockHash>, Error>
Expand description

Returns the block hash for the block at the specified height, if any.

Examples

use tempfile::NamedTempFile;
use zcash_primitives::consensus::{H0, Network};
use zcash_client_sqlite::{
    WalletDb,
    wallet::get_block_hash,
};

let data_file = NamedTempFile::new().unwrap();
let db = WalletDb::for_path(data_file, Network::TestNetwork).unwrap();
let hash = get_block_hash(&db, H0);