mirror of
https://github.com/lightninglabs/pool.git
synced 2026-08-15 12:50:29 +02:00
client+order: define archived state
This commit is contained in:
parent
15e7a28ccb
commit
31adef0e2c
1 changed files with 14 additions and 2 deletions
|
|
@ -91,7 +91,7 @@ func (s State) String() string {
|
|||
return "cleared"
|
||||
|
||||
case StatePartiallyFilled:
|
||||
return "partial fill"
|
||||
return "partially_filled"
|
||||
|
||||
case StateExecuted:
|
||||
return "executed"
|
||||
|
|
@ -106,7 +106,19 @@ func (s State) String() string {
|
|||
return "failed"
|
||||
|
||||
default:
|
||||
return "unknown"
|
||||
return fmt.Sprintf("unknown<%d>", s)
|
||||
}
|
||||
}
|
||||
|
||||
// Archived returns true if the order is in a state that is considered to be
|
||||
// fully executed and no more modifications will be done to it.
|
||||
func (s State) Archived() bool {
|
||||
switch s {
|
||||
case StateExecuted, StateCanceled, StateFailed:
|
||||
return true
|
||||
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue