Skip to content

Commit

Permalink
Rust support for new chain parameters version.
Browse files Browse the repository at this point in the history
  • Loading branch information
td202 committed Jan 10, 2025
1 parent 92150ab commit 34b32ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rust-src/concordium_base/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ impl Deserial for ProtocolVersion {
pub struct ChainParameterVersion0;
pub struct ChainParameterVersion1;
pub struct ChainParameterVersion2;
pub struct ChainParameterVersion3;

/// Height of a block since chain genesis.
#[repr(transparent)]
Expand Down Expand Up @@ -1204,6 +1205,10 @@ impl MintDistributionFamily for ChainParameterVersion2 {
type Output = MintDistributionV1;
}

impl MintDistributionFamily for ChainParameterVersion3 {
type Output = MintDistributionV1;
}

/// Type family mapping a `ChainParameterVersion` to its corresponding type for
/// the `MintDistribution`.
pub type MintDistribution<CPV> = <CPV as MintDistributionFamily>::Output;
Expand All @@ -1225,6 +1230,10 @@ impl GASRewardsFamily for ChainParameterVersion2 {
type Output = GASRewardsV1;
}

impl GASRewardsFamily for ChainParameterVersion3 {
type Output = GASRewardsV1;
}

/// Type family mapping a `ChainParameterVersion` to its corresponding type for
/// the `GasRewards`.
pub type GASRewardsFor<CPV> = <CPV as GASRewardsFamily>::Output;
Expand Down
5 changes: 5 additions & 0 deletions rust-src/concordium_base/src/updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@ impl AuthorizationsFamily for ChainParameterVersion2 {
type Output = AuthorizationsV1;
}

impl AuthorizationsFamily for ChainParameterVersion3 {
type Output = AuthorizationsV1;
}

/// A mapping of chain parameter versions to authorization versions.
pub type Authorizations<CPV> = <CPV as AuthorizationsFamily>::Output;

Expand Down Expand Up @@ -628,6 +632,7 @@ pub struct FinalizationCommitteeParameters {
}

#[derive(Debug, common::Serialize, Clone, Copy, SerdeSerialize, SerdeDeserialize)]
#[serde(rename_all = "camelCase")]
/// Validator score parameters. These parameters control the threshold of
/// maximal missed rounds before a validator gets suspended.
pub struct ValidatorScoreParameters {
Expand Down

0 comments on commit 34b32ef

Please sign in to comment.