add get_epoch_vote_accounts rpc (#4317)

* add get_epoch_vote_accounts rpc

* fixups

* documentation and type updates
This commit is contained in:
Rob Walker
2019-05-20 22:21:13 -07:00
committed by GitHub
parent 1acfcf3acf
commit ead15d294e
6 changed files with 123 additions and 100 deletions

View File

@ -91,6 +91,11 @@ impl VoteState {
serialized_size(&vote_state).unwrap() as usize
}
// utility function, used by Stakes, tests
pub fn from(account: &Account) -> Option<VoteState> {
account.state().ok()
}
pub fn deserialize(input: &[u8]) -> Result<Self, InstructionError> {
deserialize(input).map_err(|_| InstructionError::InvalidAccountData)
}