Merge PR #3779: Split Proposal Interface
This commit is contained in:
@@ -84,13 +84,11 @@ This type is used in a temp map when tallying
|
||||
|
||||
## Proposals
|
||||
|
||||
`Proposals` are an item to be voted on.
|
||||
`Proposals` are an item to be voted on. It contains the `ProposalContent` which denotes what this proposal is about, and the other fields, which are the mutable state of the governance process.
|
||||
|
||||
```go
|
||||
type Proposal struct {
|
||||
Title string // Title of the proposal
|
||||
Description string // Description of the proposal
|
||||
Type ProposalType // Type of proposal. Initial set {PlainTextProposal, SoftwareUpgradeProposal}
|
||||
ProposalContent // Proposal content interface
|
||||
TotalDeposit sdk.Coins // Current deposit on this proposal. Initial value is set at InitialDeposit
|
||||
Deposits []Deposit // List of deposits on the proposal
|
||||
SubmitTime time.Time // Time of the block where TxGovSubmitProposal was included
|
||||
@@ -108,6 +106,17 @@ type Proposal struct {
|
||||
}
|
||||
```
|
||||
|
||||
`ProposalContent`s are an interface which contains the information about the `Proposal` where it is provided from an external source, including the proposer. Governance process itself does not evaluate about the internal content.
|
||||
|
||||
```go
|
||||
type ProposalContent interface {
|
||||
GetTitle() string
|
||||
GetDescription() string
|
||||
ProposalType() ProposalKind
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
We also mention a method to update the tally for a given proposal:
|
||||
|
||||
```go
|
||||
|
||||
Reference in New Issue
Block a user