Skip to main content

hotmint_types/
validator_update.rs

1use serde::{Deserialize, Serialize};
2
3use crate::crypto::PublicKey;
4use crate::validator::ValidatorId;
5
6/// A validator update returned by the application layer.
7/// Power of 0 means remove the validator.
8#[derive(Debug, Clone, Serialize, Deserialize)]
9pub struct ValidatorUpdate {
10    pub id: ValidatorId,
11    pub public_key: PublicKey,
12    pub power: u64,
13}
14
15/// Response from `Application::end_block()`.
16/// If `validator_updates` is non-empty, an epoch transition is scheduled.
17#[derive(Debug, Clone, Default)]
18pub struct EndBlockResponse {
19    pub validator_updates: Vec<ValidatorUpdate>,
20}