agglayer-primitives 0.18.0

agglayer-primitives contains various structs and traits that are the ground of agglayer protocol.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{digest::Digest, U256};

/// Allows for the conversion of a boolean to a type
/// This trait is used in tree to properly bound the type of the digest.
pub trait FromBool {
    fn from_bool(b: bool) -> Self;
}

pub trait FromU256 {
    fn from_u256(u: U256) -> Self;
}

/// Trait for objects that can be hashed.
pub trait Hashable {
    /// Hashes the object to a [`Digest`].
    fn hash(&self) -> Digest;
}