From 34b32efbf9699d4df0070f5405d703d7028703f2 Mon Sep 17 00:00:00 2001 From: Thomas Dinsdale-Young Date: Fri, 10 Jan 2025 11:09:20 +0100 Subject: [PATCH] Rust support for new chain parameters version. --- rust-src/concordium_base/src/base.rs | 9 +++++++++ rust-src/concordium_base/src/updates.rs | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/rust-src/concordium_base/src/base.rs b/rust-src/concordium_base/src/base.rs index 6e1ea2a4c..72ccf98d9 100644 --- a/rust-src/concordium_base/src/base.rs +++ b/rust-src/concordium_base/src/base.rs @@ -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)] @@ -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 = ::Output; @@ -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 = ::Output; diff --git a/rust-src/concordium_base/src/updates.rs b/rust-src/concordium_base/src/updates.rs index dc067bf33..aa4872e60 100644 --- a/rust-src/concordium_base/src/updates.rs +++ b/rust-src/concordium_base/src/updates.rs @@ -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 = ::Output; @@ -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 {