2019-10-10 08:53:30 -07:00
|
|
|
package types
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strings"
|
|
|
|
|
2020-07-28 05:53:35 -07:00
|
|
|
yaml "gopkg.in/yaml.v2"
|
2019-10-10 08:53:30 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
// Periods stores all vesting periods passed as part of a PeriodicVestingAccount
|
|
|
|
type Periods []Period
|
|
|
|
|
|
|
|
// String Period implements stringer interface
|
|
|
|
func (p Period) String() string {
|
2020-02-18 04:50:13 -08:00
|
|
|
out, _ := yaml.Marshal(p)
|
|
|
|
return string(out)
|
2019-10-10 08:53:30 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// String Periods implements stringer interface
|
|
|
|
func (vp Periods) String() string {
|
|
|
|
periodsListString := make([]string, len(vp))
|
|
|
|
for _, period := range vp {
|
|
|
|
periodsListString = append(periodsListString, period.String())
|
|
|
|
}
|
2020-02-18 04:50:13 -08:00
|
|
|
|
2019-10-10 08:53:30 -07:00
|
|
|
return strings.TrimSpace(fmt.Sprintf(`Vesting Periods:
|
|
|
|
%s`, strings.Join(periodsListString, ", ")))
|
|
|
|
}
|