add current to bank syscalls (#4581)

This commit is contained in:
Rob Walker
2019-06-07 11:41:34 -07:00
committed by GitHub
parent fdaa939892
commit 37c2fa1d8d
3 changed files with 23 additions and 4 deletions

View File

@@ -62,6 +62,11 @@ impl EpochSchedule {
}
}
/// get epoch for the given slot
pub fn get_epoch(&self, slot: u64) -> u64 {
self.get_epoch_and_slot_index(slot).0
}
/// get epoch and offset into the epoch for the given slot
pub fn get_epoch_and_slot_index(&self, slot: u64) -> (u64, u64) {
if slot < self.first_normal_slot {