+ // Must have at least one transaction, because the merkle root is not defined for an empty block
+ // and we would fail when we later checked, as of bitcoin crate 0.28.0.
+ // Note that elsewhere in tests we assume that the merkle root of an empty block is all zeros,
+ // but that's OK because those tests don't trigger the check.
+ let coinbase = Transaction {
+ version: 0,
+ lock_time: PackedLockTime::ZERO,
+ input: vec![],
+ output: vec![]
+ };
+ let merkle_root = bitcoin_merkle_root(vec![coinbase.txid().as_hash()].into_iter()).unwrap();