progpow/
types.rs

1pub type H256 = [u8; 32];
2
3#[derive(Debug)]
4pub enum Hardware {
5	CPU,
6	GPU,
7}
8
9#[derive(Debug)]
10pub enum ProgPowError {
11	NO_INITIALIZED,
12	DAG,
13	CACHE,
14}
15
16pub trait PpCompute: Sized {
17	fn init(&mut self) -> Result<(), ProgPowError>;
18	fn hardware(&self) -> Hardware;
19	fn verify(
20		&self,
21		header_hash: &H256,
22		height: u64,
23		nonce: u64,
24	) -> Result<([u32; 8], [u32; 8]), ProgPowError>;
25	fn compute(&self, header: [u8; 32], height: u64, epoch: i32, target: u64);
26}