Skip to content

Commit

Permalink
ValidatorIndex newtype
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacholme7 committed Dec 2, 2024
1 parent 4a4dfb5 commit fd0a225
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 0 additions & 3 deletions anchor/common/ssv_types/src/committee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ use crate::util::parse_rsa;
use crate::{Operator, OperatorId};
use derive_more::{Deref, From};
use rsa::RsaPublicKey;
use std::cmp::Eq;
use std::fmt::Debug;
use std::hash::Hash;
use types::Domain;

/// Unique identifier for a committee.
Expand Down
2 changes: 1 addition & 1 deletion anchor/common/ssv_types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pub use committee::{CommitteeId, CommitteeMember};
pub use operator::{Operator, OperatorId};
pub use share::SSVShare;
pub use share::{SSVShare, ValidatorIndex};
mod committee;
mod operator;
mod share;
Expand Down
5 changes: 4 additions & 1 deletion anchor/common/ssv_types/src/share.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
use crate::CommitteeId;
use derive_more::{Deref, From};
use std::time::SystemTime;
use types::{Address, Domain, Graffiti, PublicKey};

type ValidatorIndex = usize;
// Index of the validator in the validator registry.
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Hash, From, Deref)]
pub struct ValidatorIndex(usize);

/// Share of a key that a operator owns and its accompanying metadata.
#[derive(Debug, Clone)]
Expand Down

0 comments on commit fd0a225

Please sign in to comment.