private bool IsTransitionTokenValid(OpenTitan_LifeCycleState currentState, OpenTitan_LifeCycleState nextState) { if (LockedTestStates.Contains(currentState) && UnlockedTestStates.Contains(nextState)) { return(token.SequenceEqual(testUnlockToken)); } else if (UnlockedTestStates.Contains(currentState) && MissionStates.Contains(nextState)) { return(token.SequenceEqual(testExitToken)); } else if (MissionStates.Contains(currentState) && nextState == OpenTitan_LifeCycleState.Rma) { return(token.SequenceEqual(rmaToken)); } // No token required for this transition return(true); }
private bool IsTransitionAllowed(OpenTitan_LifeCycleState currentState, OpenTitan_LifeCycleState nextState) { if (nextState == OpenTitan_LifeCycleState.Scrap || currentState == OpenTitan_LifeCycleState.Raw && UnlockedTestStates.Contains(nextState)) { return(true); } else if (UnlockedTestStates.Contains(currentState)) { if (LockedTestStates.Contains(nextState) && (nextState > currentState) || nextState == OpenTitan_LifeCycleState.Rma || MissionStates.Contains(nextState)) { return(true); } } else if ((currentState == OpenTitan_LifeCycleState.Dev || currentState == OpenTitan_LifeCycleState.Prod) && nextState == OpenTitan_LifeCycleState.Rma) { return(true); } return(false); }