Benign rust 2,367 installs Download

tari_consensus_types 0.43.0

“Consensus types for Tari Ootle”

Rust test marker or harnessimports tari_template_lib::types::crypto::RistrettoPublicKeyBytes
SHA-256cc84328ec34bb90d85cb92df316569475ce81fdf36a3012cef62deee7f73db49

Evidence

imports tari_template_lib::types::crypto::RistrettoPublicKeyBytes validator_signature.rs · lines 1–31
1// Copyright 2023 The Tari Project
2// SPDX-License-Identifier: BSD-3-Clause
3
4use borsh::BorshSerialize;
5use minicbor::{CborLen, Decode, Encode};
6use serde::{Deserialize, Serialize};
7use tari_common_types::types::PrivateKey;
8use tari_crypto::{ristretto::RistrettoPublicKey, signatures::SchnorrSignature};
9use tari_hashing::ValidatorNodeHashDomain;
10use tari_template_lib::types::crypto::{RistrettoPublicKeyBytes, SchnorrSignatureBytes};
11
12pub type ValidatorSchnorrSignature = SchnorrSignature<RistrettoPublicKey, PrivateKey, ValidatorNodeHashDomain>;
⋯19 lines
English function-word token "for" timeout_vote.rs · lines 33–42
33:29… signature.clone(),
34 }
35 }
36}
37
38impl Vote for TimeoutVote {
39 type AggregationKey = ();
40
41 fn epoch(&self) -> Epoch {
42 self.epoch
English function-word token "this" proposal_vote.rs · lines 20–22
20:20… lockId,
21 /// The height of the view change - this should correspond to the height of the block. From protocol version 1
22 /// it is part of the …
English function-word token "and" proposal_vote.rs · lines 23–26
23:11… epoch, block_height)`, so one carrying a height that disagrees with the block lands in its own bucket and
24 /// can never be folded into an honest quorum.
25 #[n(2)]
26 pub block_height: NodeHeight …
Source SPDX license identifier declaration accumulated_data.rs · lines 1–40
1// Copyright 2025 The Tari Project
2// SPDX-License-Identifier: BSD-3-Clause
3
4use borsh::BorshSerialize;
5use minicbor::{CborLen, Decode, Encode};
6use serde::{Deserialize, Serialize};
7
8#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, BorshSerialize, Encode, Decode, CborLen)]
⋯4 lines
13}
14
15impl From<ShardGroupAccumulatedData> for tari_sidechain::ShardGroupAccumulatedData {
16 fn from(value: ShardGroupAccumulatedData) -> Self {
17 Self {
18 total_exhaust_burn: value.total_exhaust_burn,
19 }
20 }
21}
22
23#[cfg(test)]
24mod tests {
25 use super::*;
26
27 /// `total_exhaust_burn` crosses the `u64::MAX` boundary where minicbor switches between a
28 /// plain CBOR integer and an RFC 8949 bignum, and `CborLen` has to agree with the encoder on
29 /// both sides of it.
30 #[test]
31 fn total_exhaust_burn_roundtrips_across_the_bignum_boundary() {
32 for total_exhaust_burn in [0, 1, u128::from(u64::MAX), u128::from(u64::MAX) + 1, u128::MAX] {
⋯8 lines

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.