use borsh::{BorshDeserialize, BorshSerialize}; use serde::{Deserialize, Serialize}; /// Stable identifier for a participant within the MPC protocol's participant set. #[derive( Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, BorshSerialize, BorshDeserialize, derive_more::Deref, derive_more::From, derive_more::Into, derive_more::Display, )] #[cfg_attr( all(feature = "abi", not(target_arch = "wasm32")), derive(schemars::JsonSchema, borsh::BorshSchema) )] pub struct ParticipantId(pub u32); impl ParticipantId { pub fn new(id: u32) -> Self { Self(id) } pub fn get(self) -> u32 { self.0 } pub fn next(self) -> Self { Self(self.0 + 1) } }