Skip to content

Commit f5af464

Browse files
rustopianfebo
andauthored
valid bool values only
Co-authored-by: Fernando Otero <[email protected]>
1 parent f869967 commit f5af464

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sysvar/src/epoch_schedule.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,12 @@ impl PodEpochSchedule {
170170
u64::from_le_bytes(self.leader_schedule_slot_offset)
171171
}
172172

173-
pub fn warmup(&self) -> bool {
174-
self.warmup != 0
173+
pub fn warmup(&self) -> Result<bool, ProgramError> {
174+
match self.warmup {
175+
0 => Ok(false),
176+
1 => Ok(true),
177+
_ => Err(ProgramError::InvalidAccountData),
178+
}
175179
}
176180

177181
pub fn first_normal_epoch(&self) -> u64 {

0 commit comments

Comments
 (0)