satellite/compensation: add a code that crypthopper-go now uses
it's a bit weird that these code definitions are in storj/storj instead of storj/crypthopper-go, but as it stands, we should make sure this package knows about all the codes in use. Change-Id: I8df4666a015098e2d2e536d2f6c8ca5317a4369c
This commit is contained in:
parent
0513d4cf3a
commit
abc9e2493f
@ -30,13 +30,17 @@ const (
|
|||||||
// Offline is included if the node's last contact success is before the starting
|
// Offline is included if the node's last contact success is before the starting
|
||||||
// period.
|
// period.
|
||||||
Offline Code = "O"
|
Offline Code = "O"
|
||||||
|
|
||||||
|
// Bonus is included if the node has qualified for special bonus circumstances,
|
||||||
|
// chosen month by month by the crypthopper-go accountant prepare step.
|
||||||
|
Bonus Code = "B"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CodeFromString parses the string into a Code.
|
// CodeFromString parses the string into a Code.
|
||||||
func CodeFromString(s string) (Code, error) {
|
func CodeFromString(s string) (Code, error) {
|
||||||
code := Code(s)
|
code := Code(s)
|
||||||
switch code {
|
switch code {
|
||||||
case Disqualified, Sanctioned, No1099, InWithholding, GracefulExit, Offline:
|
case Disqualified, Sanctioned, No1099, InWithholding, GracefulExit, Offline, Bonus:
|
||||||
return code, nil
|
return code, nil
|
||||||
default:
|
default:
|
||||||
return "", Error.New("no such code %q", code)
|
return "", Error.New("no such code %q", code)
|
||||||
|
Loading…
Reference in New Issue
Block a user