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

tari-project / tari / 16123384529

07 Jul 2025 05:11PM UTC coverage: 64.327% (-7.6%) from 71.89%
16123384529

push

github

web-flow
chore: new release v4.9.0-pre.0 (#7289)

Description
---
new release esmeralda

77151 of 119935 relevant lines covered (64.33%)

227108.34 hits per line

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

66.67
/base_layer/core/src/chain_storage/active_validator_node.rs
1
//  Copyright 2022, 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::cmp;
24

25
use serde::{Deserialize, Serialize};
26
use tari_common_types::{
27
    epoch::VnEpoch,
28
    types::{CompressedCommitment, CompressedPublicKey},
29
};
30

31
use crate::transactions::tari_amount::MicroMinotari;
32

33
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
×
34
pub struct ValidatorNodeEntry {
35
    pub shard_key: [u8; 32],
36
    /// The epoch in which this validator node was (or will be) activated
37
    pub activation_epoch: VnEpoch,
38
    /// The epoch in which the validator registration UTXO was submitted
39
    pub registration_epoch: VnEpoch,
40
    pub public_key: CompressedPublicKey,
41
    pub commitment: CompressedCommitment,
42
    pub sidechain_public_key: Option<CompressedPublicKey>,
43
    pub minimum_value_promise: MicroMinotari,
44
}
45

46
impl Ord for ValidatorNodeEntry {
47
    fn cmp(&self, other: &Self) -> std::cmp::Ordering {
76✔
48
        self.sidechain_public_key
76✔
49
            .cmp(&other.sidechain_public_key)
76✔
50
            .then_with(|| self.shard_key.cmp(&other.shard_key))
76✔
51
    }
76✔
52
}
53

54
impl PartialOrd for ValidatorNodeEntry {
55
    fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
×
56
        Some(self.cmp(other))
×
57
    }
×
58
}
59

60
impl PartialEq for ValidatorNodeEntry {
61
    fn eq(&self, other: &Self) -> bool {
20✔
62
        self.sidechain_public_key == other.sidechain_public_key && self.shard_key == other.shard_key
20✔
63
    }
20✔
64
}
65

66
impl Eq for ValidatorNodeEntry {}
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