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
// Copyright 2020 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0

//! Protocol version structure

use mina_serialization_types_macros::AutoFrom;

#[derive(Clone, Debug, Eq, PartialEq, AutoFrom)]
#[auto_from(mina_serialization_types::protocol_version::ProtocolVersion)]
/// Defines a version of the Mina protocol in semver format
pub struct ProtocolVersion {
    /// Major version number
    pub major: u32,
    /// Minor version number
    pub minor: u32,
    /// Patch version number
    pub patch: u32,
}

impl Default for ProtocolVersion {
    fn default() -> Self {
        ProtocolVersion {
            major: 2,
            minor: 0,
            patch: 0,
        }
    }
}