Add a dedicated Allocations struct for managing validator set allocations

Part of the DB abstraction necessary for this spaghetti.
This commit is contained in:
Luke Parker
2025-03-06 09:14:20 -05:00
parent d3d539553c
commit 09f0714894
5 changed files with 398 additions and 35 deletions

View File

@@ -18,6 +18,10 @@ pub enum EmbeddedEllipticCurve {
/// This type serializes to a subset of `NetworkId`.
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, Zeroize, BorshSerialize, BorshDeserialize)]
#[borsh(use_discriminant = true)]
#[cfg_attr(
feature = "non_canonical_scale_derivations",
derive(scale::Encode, scale::Decode, scale::MaxEncodedLen)
)]
#[non_exhaustive]
pub enum ExternalNetworkId {
/// The Bitcoin network.
@@ -63,6 +67,10 @@ impl ExternalNetworkId {
/// The type used to identify networks.
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, Zeroize)]
#[cfg_attr(
feature = "non_canonical_scale_derivations",
derive(scale::Encode, scale::Decode, scale::MaxEncodedLen)
)]
pub enum NetworkId {
/// The Serai network.
Serai,