Merge PR #3779: Split Proposal Interface

This commit is contained in:
Joon
2019-03-15 17:47:47 +01:00
committed by Christopher Goes
parent 8d6d8adb5f
commit 465bb02d6a
19 changed files with 450 additions and 342 deletions
+13 -4
View File
@@ -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