Improve documentation test in merkle_tree
Removes unnecessary usage of vector and adds a missing assert.
This commit is contained in:
parent
7360c3ce9a
commit
9fc2c2a5b1
|
@ -7,11 +7,11 @@
|
||||||
//! ```
|
//! ```
|
||||||
//! # use bitcoin::Txid;
|
//! # use bitcoin::Txid;
|
||||||
//! # use bitcoin::merkle_tree::{MerkleNode as _, TxMerkleNode};
|
//! # use bitcoin::merkle_tree::{MerkleNode as _, TxMerkleNode};
|
||||||
//! # use bitcoin::hashes::Hash;
|
|
||||||
//! # let tx1 = Txid::from_byte_array([0xAA; 32]); // Arbitrary dummy hash values.
|
//! # let tx1 = Txid::from_byte_array([0xAA; 32]); // Arbitrary dummy hash values.
|
||||||
//! # let tx2 = Txid::from_byte_array([0xFF; 32]);
|
//! # let tx2 = Txid::from_byte_array([0xFF; 32]);
|
||||||
//! let tx_hashes = vec![tx1, tx2]; // All the hashes we wish to merkelize.
|
//! let tx_hashes = [tx1, tx2]; // All the hashes we wish to merkelize.
|
||||||
//! let root = TxMerkleNode::calculate_root(tx_hashes.into_iter());
|
//! let root = TxMerkleNode::calculate_root(tx_hashes.into_iter());
|
||||||
|
//! assert!(root.is_some());
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
mod block;
|
mod block;
|
||||||
|
|
Loading…
Reference in New Issue