rosetta_types/events_blocks_response.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/// EventsBlocksResponse : EventsBlocksResponse contains an ordered collection of BlockEvents and the max retrievable sequence.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct EventsBlocksResponse {
15 /// max_sequence is the maximum available sequence number to fetch.
16 #[serde(rename = "max_sequence")]
17 pub max_sequence: i64,
18 /// events is an array of BlockEvents indicating the order to add and remove blocks to maintain a canonical view of blockchain state. Lightweight clients can use this event stream to update state without implementing their own block syncing logic.
19 #[serde(rename = "events")]
20 pub events: Vec<crate::BlockEvent>,
21}
22
23impl EventsBlocksResponse {
24 /// EventsBlocksResponse contains an ordered collection of BlockEvents and the max retrievable sequence.
25 pub fn new(max_sequence: i64, events: Vec<crate::BlockEvent>) -> EventsBlocksResponse {
26 EventsBlocksResponse {
27 max_sequence,
28 events,
29 }
30 }
31}