Search Apps Documentation Source Content File Folder Download Copy Actions Download

proposal_type.gno

1.12 Kb ยท 38 lines
 1package governance
 2
 3// ProposalType defines the different types of proposals supported by the governance system.
 4// Each type has different execution behavior and validation requirements.
 5type ProposalType string
 6
 7const (
 8	Text               ProposalType = "TEXT"                 // Informational proposals for community discussion
 9	CommunityPoolSpend ProposalType = "COMMUNITY_POOL_SPEND" // Proposals to spend community pool funds
10	ParameterChange    ProposalType = "PARAMETER_CHANGE"     // Proposals to modify system parameters
11)
12
13// String returns the human-readable string representation of the proposal type.
14func (p ProposalType) String() string {
15	switch p {
16	case Text:
17		return "Text"
18	case CommunityPoolSpend:
19		return "CommunityPoolSpend"
20	case ParameterChange:
21		return "ParameterChange"
22	default:
23		return "Unknown"
24	}
25}
26
27// IsExecutable determines whether this proposal type can be executed.
28// Text proposals are informational only and cannot be executed.
29func (p ProposalType) IsExecutable() bool {
30	switch p {
31	case Text:
32		return false
33	case CommunityPoolSpend, ParameterChange:
34		return true
35	default:
36		return false
37	}
38}