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

tari-project / tari / 20719927393

05 Jan 2026 03:18PM UTC coverage: 60.742% (+1.0%) from 59.702%
20719927393

push

github

web-flow
chore(deps): bump actions/download-artifact from 6 to 7 (#7640)

Bumps
[actions/download-artifact](https://github.com/actions/download-artifact)
from 6 to 7.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/download-artifact/releases">actions/download-artifact's
releases</a>.</em></p>
<blockquote>
<h2>v7.0.0</h2>
<h2>v7 - What's new</h2>
<blockquote>
<p>[!IMPORTANT]
actions/download-artifact@v7 now runs on Node.js 24 (<code>runs.using:
node24</code>) and requires a minimum Actions Runner version of 2.327.1.
If you are using self-hosted runners, ensure they are updated before
upgrading.</p>
</blockquote>
<h3>Node.js 24</h3>
<p>This release updates the runtime to Node.js 24. v6 had preliminary
support for Node 24, however this action was by default still running on
Node.js 20. Now this action by default will run on Node.js 24.</p>
<h2>What's Changed</h2>
<ul>
<li>Update GHES guidance to include reference to Node 20 version by <a
href="https://github.com/patrikpolyak"><code>@​patrikpolyak</code></a>
in <a
href="https://redirect.github.com/actions/download-artifact/pull/440">actions/download-artifact#440</a></li>
<li>Download Artifact Node24 support by <a
href="https://github.com/salmanmkc"><code>@​salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/download-artifact/pull/415">actions/download-artifact#415</a></li>
<li>fix: update <code>@​actions/artifact</code> to fix Node.js 24
punycode deprecation by <a
href="https://github.com/salmanmkc"><code>@​salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/download-artifact/pull/451">actions/download-artifact#451</a></li>
<li>prepare release v7.0.0 for Node.js 24 support by <a
href="https://github.com/salmanmkc"><code>@​salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/download-artifact/pull/452">actions/download-artifact#452</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/patrikp... (continued)

70489 of 116047 relevant lines covered (60.74%)

226223.46 hits per line

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

75.34
/base_layer/node_components/src/blocks/chain_block.rs
1
//  Copyright 2025, The Tari Project
2
//
3
//  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
4
//  following conditions are met:
5
//
6
//  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
7
//  disclaimer.
8
//
9
//  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
10
//  following disclaimer in the documentation and/or other materials provided with the distribution.
11
//
12
//  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
13
//  products derived from this software without specific prior written permission.
14
//
15
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
16
//  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
//  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18
//  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
//  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
20
//  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21
//  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22

23
use std::{fmt, fmt::Display, sync::Arc};
24

25
use tari_common_types::types::HashOutput;
26
use tari_transaction_components::aggregated_body::AggregateBody;
27

28
use crate::blocks::{Block, BlockHeader, BlockHeaderAccumulatedData};
29

30
/// A block linked to a chain.
31
/// A ChainBlock MUST have the same or stronger guarantees than `ChainHeader`
32
#[derive(Debug, Clone, PartialEq)]
33
pub struct ChainBlock {
34
    accumulated_data: BlockHeaderAccumulatedData,
35
    block: Arc<Block>,
36
}
37

38
impl Display for ChainBlock {
39
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
×
40
        writeln!(f, "{}", self.accumulated_data)?;
×
41
        writeln!(f, "{}", self.block)?;
×
42
        Ok(())
×
43
    }
×
44
}
45

46
impl ChainBlock {
47
    /// Attempts to construct a `ChainBlock` from a `Block` and associate `BlockHeaderAccumulatedData`. Returns None if
48
    /// the Block and the BlockHeaderAccumulatedData do not correspond (i.e have different hashes)
49
    pub fn try_construct(block: Arc<Block>, accumulated_data: BlockHeaderAccumulatedData) -> Option<Self> {
1,648✔
50
        if accumulated_data.hash != block.hash() {
1,648✔
51
            return None;
×
52
        }
1,648✔
53

54
        Some(Self {
1,648✔
55
            accumulated_data,
1,648✔
56
            block,
1,648✔
57
        })
1,648✔
58
    }
1,648✔
59

60
    pub fn height(&self) -> u64 {
880✔
61
        self.block.header.height
880✔
62
    }
880✔
63

64
    pub fn hash(&self) -> &HashOutput {
1,322✔
65
        &self.accumulated_data.hash
1,322✔
66
    }
1,322✔
67

68
    /// Returns a reference to the inner block
69
    pub fn block(&self) -> &Block {
1,800✔
70
        &self.block
1,800✔
71
    }
1,800✔
72

73
    /// Returns a reference to the inner block's header
74
    pub fn header(&self) -> &BlockHeader {
4,310✔
75
        &self.block.header
4,310✔
76
    }
4,310✔
77

78
    /// Returns the inner block wrapped in an atomically reference counted (ARC) pointer. This call is cheap and does
79
    /// not copy the block in memory.
80
    pub fn to_arc_block(&self) -> Arc<Block> {
534✔
81
        self.block.clone()
534✔
82
    }
534✔
83

84
    pub fn accumulated_data(&self) -> &BlockHeaderAccumulatedData {
2,323✔
85
        &self.accumulated_data
2,323✔
86
    }
2,323✔
87

88
    pub fn to_chain_header(&self) -> ChainHeader {
1,068✔
89
        // NOTE: Panic is impossible, a ChainBlock cannot be constructed if inconsistencies between the header and
90
        // accum data exist
91
        ChainHeader::try_construct(self.block.header.clone(), self.accumulated_data.clone()).unwrap()
1,068✔
92
    }
1,068✔
93
}
94

95
/// A block linked to a chain.
96
/// A ChainHeader guarantees (i.e cannot be constructed) that the block and accumulated data correspond by hash.
97
#[derive(Debug, Clone, PartialEq)]
98
pub struct ChainHeader {
99
    header: BlockHeader,
100
    accumulated_data: BlockHeaderAccumulatedData,
101
}
102

103
impl Display for ChainHeader {
104
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
×
105
        writeln!(f, "{}", self.header)?;
×
106
        writeln!(f, "{}", self.accumulated_data)?;
×
107
        Ok(())
×
108
    }
×
109
}
110

111
impl ChainHeader {
112
    /// Attempts to construct a `ChainHeader` from a `BlockHeader` and associate `BlockHeaderAccumulatedData`. Returns
113
    /// None if the Block and the BlockHeaderAccumulatedData do not correspond (i.e have different hashes)
114
    pub fn try_construct(header: BlockHeader, accumulated_data: BlockHeaderAccumulatedData) -> Option<Self> {
7,763✔
115
        if accumulated_data.hash != header.hash() {
7,763✔
116
            return None;
×
117
        }
7,763✔
118

119
        Some(Self {
7,763✔
120
            header,
7,763✔
121
            accumulated_data,
7,763✔
122
        })
7,763✔
123
    }
7,763✔
124

125
    pub fn height(&self) -> u64 {
3,398✔
126
        self.header.height
3,398✔
127
    }
3,398✔
128

129
    pub fn timestamp(&self) -> u64 {
1,538✔
130
        self.header.timestamp.as_u64()
1,538✔
131
    }
1,538✔
132

133
    pub fn hash(&self) -> &HashOutput {
2,404✔
134
        &self.accumulated_data.hash
2,404✔
135
    }
2,404✔
136

137
    pub fn header(&self) -> &BlockHeader {
7,816✔
138
        &self.header
7,816✔
139
    }
7,816✔
140

141
    pub fn accumulated_data(&self) -> &BlockHeaderAccumulatedData {
3,214✔
142
        &self.accumulated_data
3,214✔
143
    }
3,214✔
144

145
    pub fn into_parts(self) -> (BlockHeader, BlockHeaderAccumulatedData) {
231✔
146
        (self.header, self.accumulated_data)
231✔
147
    }
231✔
148

149
    pub fn into_header(self) -> BlockHeader {
×
150
        self.header
×
151
    }
×
152

153
    pub fn upgrade_to_chain_block(self, body: AggregateBody) -> ChainBlock {
×
154
        // NOTE: Panic cannot occur because a ChainBlock has the same guarantees as ChainHeader
155
        ChainBlock::try_construct(Arc::new(Block::new(self.header, body)), self.accumulated_data).unwrap()
×
156
    }
×
157
}
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

© 2026 Coveralls, Inc