mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
fsm: add reservation fsm compiling
This commit is contained in:
parent
f00329d7c7
commit
9b178dd979
4 changed files with 29 additions and 1 deletions
|
|
@ -206,6 +206,8 @@ func (s *StateMachine) SendEvent(event EventType, eventCtx EventContext) error {
|
|||
// current state.
|
||||
state, err := s.getNextState(event)
|
||||
if err != nil {
|
||||
log.Errorf("unable to get next state: %v from event: "+
|
||||
"%v, current state: %v", err, event, s.current)
|
||||
return ErrEventRejected
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import (
|
|||
"sort"
|
||||
|
||||
"github.com/lightninglabs/loop/fsm"
|
||||
"github.com/lightninglabs/loop/instantout/reservation"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
@ -41,6 +42,13 @@ func run() error {
|
|||
return err
|
||||
}
|
||||
|
||||
case "reservation":
|
||||
reservationFSM := &reservation.FSM{}
|
||||
err = writeMermaidFile(fp, reservationFSM.GetReservationStates())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
default:
|
||||
fmt.Println("Missing or wrong argument: fsm must be one of:")
|
||||
fmt.Println("\treservations")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue