Skip to content

Commit

Permalink
Merge pull request #350 from chainbound/lore/fix/find-delegatees
Browse files Browse the repository at this point in the history
fix(sidecar): find delegatees logic
  • Loading branch information
thedevbirb authored Oct 31, 2024
2 parents 6eebb46 + 6f91e3d commit 7925e90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bolt-sidecar/src/client/constraints_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ impl ConstraintsClient {
self.delegations.extend(delegations);
}

/// Finds all delegations for the given public key.
pub fn find_delegatees(&self, pubkey: &BlsPublicKey) -> HashSet<BlsPublicKey> {
/// Finds all delegations for the given validator public key.
pub fn find_delegatees(&self, validator_pubkey: &BlsPublicKey) -> HashSet<BlsPublicKey> {
self.delegations
.iter()
.filter(|d| d.message.delegatee_pubkey == *pubkey)
.filter(|d| d.message.validator_pubkey == *validator_pubkey)
.map(|d| d.message.delegatee_pubkey.clone())
.collect::<HashSet<_>>()
}
Expand Down

0 comments on commit 7925e90

Please sign in to comment.