uhash-types 0.5.0

Shared proof/challenge/difficulty types for UniversalHash stacks
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};

use crate::Difficulty;

#[derive(Clone, Debug, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Challenge {
    pub header: [u8; 32],
    pub difficulty: Difficulty,
}

impl Challenge {
    pub const fn new(header: [u8; 32], difficulty: Difficulty) -> Self {
        Self { header, difficulty }
    }
}