rosetta_types/
block_event.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/// BlockEvent : BlockEvent represents the addition or removal of a BlockIdentifier from storage. Streaming BlockEvents allows lightweight clients to update their own state without needing to implement their own syncing logic.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct BlockEvent {
15    /// sequence is the unique identifier of a BlockEvent within the context of a NetworkIdentifier.
16    #[serde(rename = "sequence")]
17    pub sequence: i64,
18    #[serde(rename = "block_identifier")]
19    pub block_identifier: crate::BlockIdentifier,
20    #[serde(rename = "type")]
21    pub r#type: crate::BlockEventType,
22}
23
24impl BlockEvent {
25    /// BlockEvent represents the addition or removal of a BlockIdentifier from storage. Streaming BlockEvents allows lightweight clients to update their own state without needing to implement their own syncing logic.
26    pub fn new(
27        sequence: i64,
28        block_identifier: crate::BlockIdentifier,
29        r#type: crate::BlockEventType,
30    ) -> BlockEvent {
31        BlockEvent {
32            sequence,
33            block_identifier,
34            r#type,
35        }
36    }
37}