From: merge-script Date: Tue, 29 Jul 2025 23:51:06 +0000 (-0400) Subject: Merge bitcoindevkit/bdk#1986: ci: replace grcov by cargo-llvm-cov X-Git-Tag: bitcoind_rpc-0.21.0~3 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/struct.CommandStringError.html?a=commitdiff_plain;h=1074a86587725ee5fdbc325f8e6ff762bd3b69ba;p=bdk Merge bitcoindevkit/bdk#1986: ci: replace grcov by cargo-llvm-cov 066c4cd160f6d4c70409b299a173f31f93728fae ci: replace grcov by cargo-llvm-cov (nymius) Pull request description: ### Description As explained in #1984 , I discovered some misreportings in the coverage information given by grcov. Fixes #1984 ### Notes to the reviewers The discussion about the tool to use is open, but I'm adding this PR to showcase how a change from `grcov` to `cargo-llvm-cov` would look like and the improvements in reporting this change will bring. [Look the report in `coveralls`](https://coveralls.io/github/nymius/bdk?branch=ci/replace-grcov-by-cargo-llvm-cov) to get a better perspective of them. ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo +nightly fmt` and `cargo clippy` before committing ACKs for top commit: ValuedMammal: ACK 066c4cd160f6d4c70409b299a173f31f93728fae oleonardolima: ACK 066c4cd160f6d4c70409b299a173f31f93728fae Tree-SHA512: d237fcc36efb6a4d3ccfaa371c2c70fc18ee40b48ca48f1230c5df6dca093f57bc1096927ddb15f9cae59a4640d9e34bf3ef1a309037e21fe0e8348e132bf38d --- 1074a86587725ee5fdbc325f8e6ff762bd3b69ba diff --cc crates/bitcoind_rpc/src/lib.rs index f516be6c,8ab3a448..eb58018e --- a/crates/bitcoind_rpc/src/lib.rs +++ b/crates/bitcoind_rpc/src/lib.rs @@@ -7,14 -7,9 +7,15 @@@ //! To only get block updates (exclude mempool transactions), the caller can use //! [`Emitter::next_block`] until it returns `Ok(None)` (which means the chain tip is reached). A //! separate method, [`Emitter::mempool`] can be used to emit the whole mempool. + #![cfg_attr(coverage_nightly, feature(coverage_attribute))] #![warn(missing_docs)] +#[allow(unused_imports)] +#[macro_use] +extern crate alloc; + +use alloc::sync::Arc; +use bdk_core::collections::{HashMap, HashSet}; use bdk_core::{BlockId, CheckPoint}; use bitcoin::{Block, BlockHash, Transaction, Txid}; use bitcoincore_rpc::{bitcoincore_rpc_json, RpcApi}; @@@ -399,8 -445,9 +400,9 @@@ impl BitcoindRpcErrorExt for bitcoincor } #[cfg(test)] + #[cfg_attr(coverage_nightly, coverage(off))] mod test { - use crate::{bitcoincore_rpc::RpcApi, Emitter, NO_EXPECTED_MEMPOOL_TXIDS}; + use crate::{bitcoincore_rpc::RpcApi, Emitter, NO_EXPECTED_MEMPOOL_TXS}; use bdk_chain::local_chain::LocalChain; use bdk_testenv::{anyhow, TestEnv}; use bitcoin::{hashes::Hash, Address, Amount, ScriptBuf, Txid, WScriptHash}; diff --cc crates/electrum/src/bdk_electrum_client.rs index d277c6f7,8358cae8..6c87e3f1 --- a/crates/electrum/src/bdk_electrum_client.rs +++ b/crates/electrum/src/bdk_electrum_client.rs @@@ -688,13 -685,12 +688,14 @@@ fn chain_update } #[cfg(test)] + #[cfg_attr(coverage_nightly, coverage(off))] mod test { use crate::{bdk_electrum_client::TxUpdate, BdkElectrumClient}; - use bdk_chain::bitcoin::{OutPoint, Transaction, TxIn}; - use bdk_core::collections::BTreeMap; - use bdk_testenv::{utils::new_tx, TestEnv}; + use bdk_chain::bitcoin::{constants, Network, OutPoint, ScriptBuf, Transaction, TxIn}; + use bdk_chain::{BlockId, CheckPoint}; + use bdk_core::{collections::BTreeMap, spk_client::SyncRequest}; + use bdk_testenv::{anyhow, utils::new_tx, TestEnv}; + use electrum_client::Error as ElectrumError; use std::sync::Arc; #[cfg(feature = "default")]