rosetta_types/partial_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/// PartialBlockIdentifier : When fetching data by BlockIdentifier, it may be possible to only specify the index or hash. If neither property is specified, it is assumed that the client is making a request at the current block.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct PartialBlockIdentifier {
15 #[serde(rename = "index", skip_serializing_if = "Option::is_none")]
16 pub index: Option<u64>,
17 #[serde(rename = "hash", skip_serializing_if = "Option::is_none")]
18 pub hash: Option<String>,
19}
20
21impl PartialBlockIdentifier {
22 /// When fetching data by BlockIdentifier, it may be possible to only specify the index or hash. If neither property is specified, it is assumed that the client is making a request at the current block.
23 pub fn new() -> PartialBlockIdentifier {
24 PartialBlockIdentifier {
25 index: None,
26 hash: None,
27 }
28 }
29}