-
Notifications
You must be signed in to change notification settings - Fork 129
Expand file tree
/
Copy pathblock.rs
More file actions
33 lines (31 loc) · 826 Bytes
/
Copy pathblock.rs
File metadata and controls
33 lines (31 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use bitcoin::BlockHash;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Block {
pub id: String,
pub hash: String,
pub previous_hash: String,
pub height: u32,
pub version: i32,
pub time: u32,
pub median_time: i64,
pub transaction_count: usize,
pub difficulty: u32,
pub masternode: String,
pub minter: String,
pub minter_block_count: u64,
pub stake_modifier: String,
pub merkleroot: String,
pub size: usize,
pub size_stripped: usize,
pub weight: i64,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct BlockContext {
pub hash: BlockHash,
pub height: u32,
pub time: u64,
pub median_time: u64,
}