1mod client;
6mod miner;
7mod worker;
8
9pub use crate::client::Client;
10pub use crate::miner::Miner;
11
12use ckb_jsonrpc_types::BlockTemplate;
13use ckb_types::packed::Block;
14use std::convert::From;
15
16#[derive(Clone)]
18pub struct Work {
19 work_id: u64,
21 block: Block,
23}
24
25impl From<BlockTemplate> for Work {
26 fn from(block_template: BlockTemplate) -> Work {
27 let work_id = block_template.work_id;
28 let block: Block = block_template.into();
29
30 Work {
31 work_id: work_id.into(),
32 block,
33 }
34 }
35}