From 4480534e4dd70fcff3f162aba91cf5d8fdd0e430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Fri, 31 Oct 2025 11:39:58 +0000 Subject: [PATCH] derived Default impl for EpochState --- .../coconut-dkg/src/types.rs | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/common/cosmwasm-smart-contracts/coconut-dkg/src/types.rs b/common/cosmwasm-smart-contracts/coconut-dkg/src/types.rs index d06df5ca3b..5cf5fd780e 100644 --- a/common/cosmwasm-smart-contracts/coconut-dkg/src/types.rs +++ b/common/cosmwasm-smart-contracts/coconut-dkg/src/types.rs @@ -241,23 +241,28 @@ impl Epoch { // // Note: It's important that the variant ordering is not changed otherwise it would mess up the derived `PartialOrd` #[cw_serde] -#[derive(Copy)] +#[derive(Copy, Default)] pub enum EpochState { + #[default] WaitingInitialisation, - PublicKeySubmission { resharing: bool }, - DealingExchange { resharing: bool }, - VerificationKeySubmission { resharing: bool }, - VerificationKeyValidation { resharing: bool }, - VerificationKeyFinalization { resharing: bool }, + PublicKeySubmission { + resharing: bool, + }, + DealingExchange { + resharing: bool, + }, + VerificationKeySubmission { + resharing: bool, + }, + VerificationKeyValidation { + resharing: bool, + }, + VerificationKeyFinalization { + resharing: bool, + }, InProgress, } -impl Default for EpochState { - fn default() -> Self { - Self::WaitingInitialisation - } -} - impl Display for EpochState { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self {