dg_xch_core 2.1.1

Core library containing type/error definitions, CLVM tools, Consensus and Pool definitions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub mod wallets;

use serde::{Deserialize, Serialize};
use std::fmt;
use std::io::Error;

pub trait SizedBytes<'a, const SIZE: usize>: Serialize + Deserialize<'a> + fmt::Display {
    const SIZE: usize = SIZE;
    fn new(bytes: [u8; SIZE]) -> Self;
    fn parse(bytes: &[u8]) -> Result<Self, Error>;
    fn bytes(&self) -> [u8; SIZE];
    fn is_null(&self) -> bool {
        self.bytes() == [0u8; SIZE]
    }
}