pub fn toggle_period(
        ctx: Context<Status>
    ) -> ProgramResult {
        let data = &mut ctx.accounts.data;

		if data.period_status == PeriodStatus::PendingSale as u8 {
            data.period_status = PeriodStatus::PreSale as u8;
        } else if data.period_status == PeriodStatus::PreSale as u8 {
            data.period_status = PeriodStatus::PostSale as u8;
        } else if data.period_status == PeriodStatus::PostSale as u8 {
            data.period_status = PeriodStatus::PreSale as u8;
        }

        Ok(())
    }
/**
     *  Toggle pre/post sale period
     */
Toggle pre/post sale period
Toggle pre / post sale period
pub fn toggle_period(
        ctx: Context<Status>
    ) -> ProgramResult {
        let data = &mut ctx.accounts.data;
		if data.period_status == PeriodStatus::PendingSale as u8 {
            data.period_status = PeriodStatus::PreSale as u8;
        } else if data.period_status == PeriodStatus::PreSale as u8 {
            data.period_status = PeriodStatus::PostSale as u8;
        } else if data.period_status == PeriodStatus::PostSale as u8 {
            data.period_status = PeriodStatus::PreSale as u8;
        }
        Ok(())
    }
pub fn toggle_period ( ctx : Context < Status > ) -> ProgramResult { let data = & mut ctx . accounts . data ; if data . period_status == PeriodStatus :: PendingSale as u8 { data . period_status = PeriodStatus :: PreSale as u8 ; } else if data . period_status == PeriodStatus :: PreSale as u8 { data . period_status = PeriodStatus :: PostSale as u8 ; } else if data . period_status == PeriodStatus :: PostSale as u8 { data . period_status = PeriodStatus :: PreSale as u8 ; } Ok ( ( ) ) }
Toggle pre/post sale period
Toggle pre / post sale period
ctx
Context<Status>
ctx
Context<Status>