pub extern crate lmdb_zero as lmdb;
pub use std::collections::HashMap;
use std::time::Duration;
#[repr(C)]
#[derive(Debug, Hash, Default, PartialEq, Eq, PartialOrd, Copy, Ord, Clone)]
pub struct TransactionHeader {
tx_hash: &'static str,
}
#[repr(C)]
#[derive(Debug, Hash, Default, PartialEq, Eq, PartialOrd, Copy, Ord, Clone)]
pub struct Transaction {
pub header: TransactionHeader,
timestamp: Duration,
sender: &'static str,
receiver: &'static str,
data: &'static str,
}
#[repr(C)]
#[derive(Debug, Default, Hash, PartialEq, Ord, Eq, PartialOrd, Clone, Copy)]
pub struct BlockHeader {
pub index: u64,
proof: &'static str,
block_hash: &'static str,
time_mined: Duration,
}
#[repr(C)]
#[derive(Debug, Default, Hash, Ord, PartialEq, Eq, Copy, PartialOrd, Clone)]
pub struct Block<'a> {
pub header: BlockHeader,
tx_list: &'a [Transaction],
}
#[derive(Debug, Clone, Default)]
pub struct Blockchain<'a> {
pub tip: Block<'a>,
pub map: HashMap<BlockHeader, Block<'a>>,
}