-
Notifications
You must be signed in to change notification settings - Fork 50
/
certifier.go
50 lines (43 loc) · 1.05 KB
/
certifier.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package types
import (
"fmt"
"strings"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// Certifier is a type for certifier.
type Certifier struct {
Address sdk.AccAddress `json:"certifier"`
Alias string `json:"alias"`
Proposer sdk.AccAddress `json:"proposer"`
Description string `json:"description"`
}
// NewCertifier returns a new certifier.
func NewCertifier(
address sdk.AccAddress,
alias string,
proposer sdk.AccAddress,
description string,
) Certifier {
return Certifier{
Address: address,
Alias: alias,
Proposer: proposer,
Description: description,
}
}
// String returns a human readable string representation of a validator.
func (c Certifier) String() string {
return fmt.Sprintf(`Certifier
Address: %s
Proposer: %s
Description: %s`,
c.Address, c.Proposer, c.Description)
}
// Certifiers is a collection of certifier objects.
type Certifiers []Certifier
func (c Certifiers) String() (out string) {
for _, val := range c {
out += val.String() + "\n"
}
return strings.TrimSpace(out)
}