diff --git a/.changelog/unreleased/improvements/3702-main.md b/.changelog/unreleased/improvements/3702-main.md new file mode 100644 index 00000000000..9996b8aa1ef --- /dev/null +++ b/.changelog/unreleased/improvements/3702-main.md @@ -0,0 +1,2 @@ +- Implement serde::Serialize for GovernanceParameters, PosParams, OwnedPosParams + ([\#3702](https://github.com/anoma/namada/pull/3702)) \ No newline at end of file diff --git a/crates/governance/src/parameters.rs b/crates/governance/src/parameters.rs index 0002715ba8e..4464582c8d8 100644 --- a/crates/governance/src/parameters.rs +++ b/crates/governance/src/parameters.rs @@ -4,6 +4,7 @@ use namada_macros::BorshDeserializer; #[cfg(feature = "migrations")] use namada_migrations::*; use namada_state::{Result, StorageRead, StorageWrite}; +use serde::Serialize; use super::storage::keys as goverance_storage; @@ -18,6 +19,7 @@ use super::storage::keys as goverance_storage; BorshSerialize, BorshDeserialize, BorshDeserializer, + Serialize, )] /// Governance parameter structure pub struct GovernanceParameters { diff --git a/crates/proof_of_stake/src/parameters.rs b/crates/proof_of_stake/src/parameters.rs index 6ed155a3ca7..1e1032dbe56 100644 --- a/crates/proof_of_stake/src/parameters.rs +++ b/crates/proof_of_stake/src/parameters.rs @@ -13,11 +13,14 @@ use namada_governance::parameters::GovernanceParameters; use namada_macros::BorshDeserializer; #[cfg(feature = "migrations")] use namada_migrations::*; +use serde::Serialize; use thiserror::Error; /// Proof-of-Stake system parameters. This includes parameters that are used in /// PoS but are read from other accounts storage (governance). -#[derive(Debug, Clone, BorshDeserialize, BorshDeserializer, BorshSerialize)] +#[derive( + Debug, Clone, BorshDeserialize, BorshDeserializer, BorshSerialize, Serialize, +)] pub struct PosParams { /// PoS-owned params pub owned: OwnedPosParams, @@ -28,7 +31,9 @@ pub struct PosParams { /// Proof-of-Stake system parameters owned by the PoS address, set at genesis /// and can only be changed via governance -#[derive(Debug, Clone, BorshDeserialize, BorshDeserializer, BorshSerialize)] +#[derive( + Debug, Clone, BorshDeserialize, BorshDeserializer, BorshSerialize, Serialize, +)] pub struct OwnedPosParams { /// A maximum number of consensus validators pub max_validator_slots: u64,