• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bitcoindevkit / bdk / 11582766320

29 Oct 2024 09:28PM UTC coverage: 82.61%. Remained the same
11582766320

push

github

notmandatory
Merge bitcoindevkit/bdk#1657: chore(deps): bump tibdex/github-app-token from 1 to 2

96c65761e ci: fix dependabot clippy_check error (Steve Myers)
80b4ecac4 chore(deps): bump tibdex/github-app-token from 1 to 2 (dependabot[bot])

Pull request description:

  Bumps [tibdex/github-app-token](https://github.com/tibdex/github-app-token) from 1 to 2.
  <details>
  <summary>Release notes</summary>
  <p><em>Sourced from <a href="https://github.com/tibdex/github-app-token/releases">tibdex/github-app-token's releases</a>.</em></p>
  <blockquote>
  <h2>v2.0.0</h2>
  <ul>
  <li><strong>BREAKING</strong>: replaces the <code>installation_id</code> and <code>repository</code> inputs with <code>installation_retrieval_mode</code> and <code>installation_retrieval_payload</code> to also support organization and user installation.</li>
  <li>switches to <code>node20</code>.</li>
  <li>adds a <code>repositories</code> input to scope the created token to a subset of repositories.</li>
  <li>revokes the created token at the end of the job with a <a href="https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runspost"><code>post</code> script</a>.</li>
  </ul>
  <h2>v1.9.0</h2>
  <p>No release notes provided.</p>
  <h2>v1.8.2</h2>
  <p>No release notes provided.</p>
  <h2>v1.8.1</h2>
  <p>No release notes provided.</p>
  <h2>v1.8.0</h2>
  <p>No release notes provided.</p>
  <h2>v1.7.0</h2>
  <p>No release notes provided.</p>
  <h2>v1.6.0</h2>
  <p>No release notes provided.</p>
  <h2>v1.5.2</h2>
  <p>No release notes provided.</p>
  <h2>v1.5.1</h2>
  <p>No release notes provided.</p>
  <h2>v1.5.0</h2>
  <p>No release notes provided.</p>
  <h2>v1.4.0</h2>
  <p>No release notes provided.</p>
  <h2>v1.3.0</h2>
  <p>No release notes provided.</p>
  <h2>v1.2.0</h2>
  <p>No release notes provided.</p>
  <h2>v1.1.1</h2>
  <p>No release notes provided.</p>
  <h2>v1.1.0</h2>
  <p>No releas... (continued)

11301 of 13680 relevant lines covered (82.61%)

14271.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

53.85
/crates/core/src/tx_update.rs
1
use crate::collections::{BTreeMap, BTreeSet, HashMap};
2
use alloc::{sync::Arc, vec::Vec};
3
use bitcoin::{OutPoint, Transaction, TxOut, Txid};
4

5
/// Data object used to communicate updates about relevant transactions from some chain data source
6
/// to the core model (usually a `bdk_chain::TxGraph`).
7
#[derive(Debug, Clone)]
8
pub struct TxUpdate<A = ()> {
9
    /// Full transactions. These are transactions that were determined to be relevant to the wallet
10
    /// given the request.
11
    pub txs: Vec<Arc<Transaction>>,
12
    /// Floating txouts. These are `TxOut`s that exist but the whole transaction wasn't included in
13
    /// `txs` since only knowing about the output is important. These are often used to help determine
14
    /// the fee of a wallet transaction.
15
    pub txouts: BTreeMap<OutPoint, TxOut>,
16
    /// Transaction anchors. Anchors tells us a position in the chain where a transaction was
17
    /// confirmed.
18
    pub anchors: BTreeSet<(A, Txid)>,
19
    /// Seen at times for transactions. This records when a transaction was most recently seen in
20
    /// the user's mempool for the sake of tie-breaking other conflicting transactions.
21
    pub seen_ats: HashMap<Txid, u64>,
22
}
23

24
impl<A> Default for TxUpdate<A> {
25
    fn default() -> Self {
678✔
26
        Self {
678✔
27
            txs: Default::default(),
678✔
28
            txouts: Default::default(),
678✔
29
            anchors: Default::default(),
678✔
30
            seen_ats: Default::default(),
678✔
31
        }
678✔
32
    }
678✔
33
}
34

35
impl<A: Ord> TxUpdate<A> {
36
    /// Transforms the [`TxUpdate`] to have `anchors` (`A`) of another type (`A2`).
37
    ///
38
    /// This takes in a closure with signature `FnMut(A) -> A2` which is called for each anchor to
39
    /// transform it.
40
    pub fn map_anchors<A2: Ord, F: FnMut(A) -> A2>(self, mut map: F) -> TxUpdate<A2> {
×
41
        TxUpdate {
×
42
            txs: self.txs,
×
43
            txouts: self.txouts,
×
44
            anchors: self
×
45
                .anchors
×
46
                .into_iter()
×
47
                .map(|(a, txid)| (map(a), txid))
×
48
                .collect(),
×
49
            seen_ats: self.seen_ats,
×
50
        }
×
51
    }
×
52

53
    /// Extend this update with `other`.
54
    pub fn extend(&mut self, other: TxUpdate<A>) {
18✔
55
        self.txs.extend(other.txs);
18✔
56
        self.txouts.extend(other.txouts);
18✔
57
        self.anchors.extend(other.anchors);
18✔
58
        self.seen_ats.extend(other.seen_ats);
18✔
59
    }
18✔
60
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc