Documentation
¶
Index ¶
- func ErrFailedToMarshalNextProposalID(err error) sdk.Error
- func ErrFailedToMarshalProposal(err error) sdk.Error
- func ErrFailedToMarshalProposalList(err error) sdk.Error
- func ErrFailedToUnmarshalNextProposalID(err error) sdk.Error
- func ErrFailedToUnmarshalProposal(err error) sdk.Error
- func ErrFailedToUnmarshalProposalList(err error) sdk.Error
- func ErrNextProposalIDNotFound() sdk.Error
- func ErrProposalListNotFound() sdk.Error
- func ErrProposalNotFound() sdk.Error
- func GetProposalKey(proposalID types.ProposalKey) []byte
- func GetProposalListKey() []byte
- type ChangeParamProposal
- type ContentCensorshipProposal
- type NextProposalID
- type Proposal
- type ProposalInfo
- type ProposalList
- type ProposalStorage
- func (ps ProposalStorage) DeleteProposal(ctx sdk.Context, proposalID types.ProposalKey) sdk.Error
- func (ps ProposalStorage) DoesProposalExist(ctx sdk.Context, proposalID types.ProposalKey) bool
- func (ps ProposalStorage) GetNextProposalID(ctx sdk.Context) (*NextProposalID, sdk.Error)
- func (ps ProposalStorage) GetProposal(ctx sdk.Context, proposalID types.ProposalKey) (Proposal, sdk.Error)
- func (ps ProposalStorage) GetProposalList(ctx sdk.Context) (*ProposalList, sdk.Error)
- func (ps ProposalStorage) InitGenesis(ctx sdk.Context) sdk.Error
- func (ps ProposalStorage) SetNextProposalID(ctx sdk.Context, nextProposalID *NextProposalID) sdk.Error
- func (ps ProposalStorage) SetProposal(ctx sdk.Context, proposalID types.ProposalKey, proposal Proposal) sdk.Error
- func (ps ProposalStorage) SetProposalList(ctx sdk.Context, lst *ProposalList) sdk.Error
- type ProtocolUpgradeProposal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrFailedToMarshalProposal ¶
marshal error
func ErrFailedToUnmarshalProposal ¶
unmarshal error
func ErrProposalListNotFound ¶
func GetProposalKey ¶
func GetProposalKey(proposalID types.ProposalKey) []byte
func GetProposalListKey ¶
func GetProposalListKey() []byte
Types ¶
type ChangeParamProposal ¶
type ChangeParamProposal struct {
ProposalInfo
Param param.Parameter `json:"param"`
Reason string `json:"reason"`
}
func (*ChangeParamProposal) GetProposalInfo ¶
func (p *ChangeParamProposal) GetProposalInfo() ProposalInfo
func (*ChangeParamProposal) SetProposalInfo ¶
func (p *ChangeParamProposal) SetProposalInfo(info ProposalInfo)
type ContentCensorshipProposal ¶
type ContentCensorshipProposal struct {
ProposalInfo
Permlink types.Permlink `json:"permlink"`
Reason string `json:"reason"`
}
func (*ContentCensorshipProposal) GetProposalInfo ¶
func (p *ContentCensorshipProposal) GetProposalInfo() ProposalInfo
func (*ContentCensorshipProposal) SetProposalInfo ¶
func (p *ContentCensorshipProposal) SetProposalInfo(info ProposalInfo)
type NextProposalID ¶
type NextProposalID struct {
NextProposalID int64 `json:"next_proposal_id"`
}
type Proposal ¶
type Proposal interface {
GetProposalInfo() ProposalInfo
SetProposalInfo(ProposalInfo)
}
type ProposalInfo ¶
type ProposalInfo struct {
Creator types.AccountKey `json:"creator"`
ProposalID types.ProposalKey `json:"proposal_id"`
AgreeVotes types.Coin `json:"agree_vote"`
DisagreeVotes types.Coin `json:"disagree_vote"`
Result types.ProposalResult `json:"result"`
CreatedAt int64 `json:"created_at"`
ExpiredAt int64 `json:"expired_at"`
Reason string `json:"reason"`
}
type ProposalList ¶
type ProposalList struct {
OngoingProposal []types.ProposalKey `json:"ongoing_proposal"`
PastProposal []types.ProposalKey `json:"past_proposal"`
}
type ProposalStorage ¶
type ProposalStorage struct {
// contains filtered or unexported fields
}
func NewProposalStorage ¶
func NewProposalStorage(key sdk.StoreKey) ProposalStorage
func (ProposalStorage) DeleteProposal ¶
func (ps ProposalStorage) DeleteProposal(ctx sdk.Context, proposalID types.ProposalKey) sdk.Error
func (ProposalStorage) DoesProposalExist ¶
func (ps ProposalStorage) DoesProposalExist(ctx sdk.Context, proposalID types.ProposalKey) bool
func (ProposalStorage) GetNextProposalID ¶
func (ps ProposalStorage) GetNextProposalID(ctx sdk.Context) (*NextProposalID, sdk.Error)
func (ProposalStorage) GetProposal ¶
func (ps ProposalStorage) GetProposal(ctx sdk.Context, proposalID types.ProposalKey) (Proposal, sdk.Error)
only support change parameter proposal now
func (ProposalStorage) GetProposalList ¶
func (ps ProposalStorage) GetProposalList(ctx sdk.Context) (*ProposalList, sdk.Error)
func (ProposalStorage) InitGenesis ¶
func (ps ProposalStorage) InitGenesis(ctx sdk.Context) sdk.Error
func (ProposalStorage) SetNextProposalID ¶
func (ps ProposalStorage) SetNextProposalID(ctx sdk.Context, nextProposalID *NextProposalID) sdk.Error
func (ProposalStorage) SetProposal ¶
func (ps ProposalStorage) SetProposal(ctx sdk.Context, proposalID types.ProposalKey, proposal Proposal) sdk.Error
only support change parameter proposal now
func (ProposalStorage) SetProposalList ¶
func (ps ProposalStorage) SetProposalList(ctx sdk.Context, lst *ProposalList) sdk.Error
type ProtocolUpgradeProposal ¶
type ProtocolUpgradeProposal struct {
ProposalInfo
Link string `json:"link"`
Reason string `json:"reason"`
}
func (*ProtocolUpgradeProposal) GetProposalInfo ¶
func (p *ProtocolUpgradeProposal) GetProposalInfo() ProposalInfo
func (*ProtocolUpgradeProposal) SetProposalInfo ¶
func (p *ProtocolUpgradeProposal) SetProposalInfo(info ProposalInfo)
Click to show internal directories.
Click to hide internal directories.