rosetta_types/block_identifier.rs
1/*
2 * Rosetta
3 *
4 * Build Once. Integrate Your Blockchain Everywhere.
5 *
6 * The version of the OpenAPI document: 1.4.13
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// BlockIdentifier : The block_identifier uniquely identifies a block in a particular network.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct BlockIdentifier {
15 /// This is also known as the block height.
16 #[serde(rename = "index")]
17 pub index: u64,
18 /// This should be normalized according to the case specified in the block_hash_case network options.
19 #[serde(rename = "hash")]
20 pub hash: String,
21}
22
23impl BlockIdentifier {
24 /// The block_identifier uniquely identifies a block in a particular network.
25 pub fn new(index: u64, hash: String) -> BlockIdentifier {
26 BlockIdentifier { index, hash }
27 }
28}