Skip to content

Commit

Permalink
Merge pull request AleoNet#335 from AleoHQ/retrieve_participant_address
Browse files Browse the repository at this point in the history
Add method to easily retrieve a participant's address
  • Loading branch information
apruden2008 authored Aug 11, 2021
2 parents a55e799 + 6f0b49a commit fa82b01
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions phase1-coordinator/src/objects/participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ impl Participant {
pub fn is_verifier(&self) -> bool {
!self.is_contributor()
}

/// Retrieve the address of the participant.
pub fn address(&self) -> String {
match self {
Participant::Contributor(a) => a.to_string(),
Participant::Verifier(a) => a.to_string(),
}
}
}

impl fmt::Display for Participant {
Expand Down

0 comments on commit fa82b01

Please sign in to comment.