/
gov.go
57 lines (44 loc) · 1.36 KB
/
gov.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
51
52
53
54
55
56
57
package types
import (
"fmt"
"strings"
sdk "github.com/cosmos/cosmos-sdk/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
)
const (
ProposalTypeUpdateFeeToken = "UpdateFeeToken"
)
func init() {
govtypes.RegisterProposalType(ProposalTypeUpdateFeeToken)
govtypes.RegisterProposalTypeCodec(&UpdateFeeTokenProposal{}, "osmosis/UpdateFeeTokenProposal")
}
var _ govtypes.Content = &UpdateFeeTokenProposal{}
func NewUpdateFeeTokenProposal(title, description string, feeToken FeeToken) UpdateFeeTokenProposal {
return UpdateFeeTokenProposal{
Title: title,
Description: description,
Feetoken: feeToken,
}
}
func (p *UpdateFeeTokenProposal) GetTitle() string { return p.Title }
func (p *UpdateFeeTokenProposal) GetDescription() string { return p.Description }
func (p *UpdateFeeTokenProposal) ProposalRoute() string { return RouterKey }
func (p *UpdateFeeTokenProposal) ProposalType() string {
return ProposalTypeUpdateFeeToken
}
func (p *UpdateFeeTokenProposal) ValidateBasic() error {
err := govtypes.ValidateAbstract(p)
if err != nil {
return err
}
return sdk.ValidateDenom(p.Feetoken.Denom)
}
func (p UpdateFeeTokenProposal) String() string {
var b strings.Builder
b.WriteString(fmt.Sprintf(`Update Fee Token Proposal:
Title: %s
Description: %s
Records: %s
`, p.Title, p.Description, p.Feetoken.String()))
return b.String()
}