Documentation ¶
Index ¶
- func ErrFailedToMarshalNextProposalID(err error) sdk.Error
- func ErrFailedToMarshalProposal(err error) sdk.Error
- func ErrFailedToUnmarshalNextProposalID(err error) sdk.Error
- func ErrFailedToUnmarshalProposal(err error) sdk.Error
- func ErrNextProposalIDNotFound() sdk.Error
- func ErrProposalNotFound() sdk.Error
- func GetExpiredProposalKey(proposalID types.ProposalKey) []byte
- func GetOngoingProposalKey(proposalID types.ProposalKey) []byte
- type ChangeParamProposal
- type ContentCensorshipProposal
- type NextProposalID
- type Proposal
- type ProposalInfo
- type ProposalStorage
- func (ps ProposalStorage) DeleteExpiredProposal(ctx sdk.Context, proposalID types.ProposalKey) sdk.Error
- func (ps ProposalStorage) DeleteOngoingProposal(ctx sdk.Context, proposalID types.ProposalKey) sdk.Error
- func (ps ProposalStorage) DoesProposalExist(ctx sdk.Context, proposalID types.ProposalKey) bool
- func (ps ProposalStorage) GetExpiredProposal(ctx sdk.Context, proposalID types.ProposalKey) (Proposal, sdk.Error)
- func (ps ProposalStorage) GetExpiredProposalList(ctx sdk.Context) ([]Proposal, sdk.Error)
- func (ps ProposalStorage) GetNextProposalID(ctx sdk.Context) (*NextProposalID, sdk.Error)
- func (ps ProposalStorage) GetOngoingProposal(ctx sdk.Context, proposalID types.ProposalKey) (Proposal, sdk.Error)
- func (ps ProposalStorage) GetOngoingProposalList(ctx sdk.Context) ([]Proposal, sdk.Error)
- func (ps ProposalStorage) InitGenesis(ctx sdk.Context) sdk.Error
- func (ps ProposalStorage) SetExpiredProposal(ctx sdk.Context, proposalID types.ProposalKey, proposal Proposal) sdk.Error
- func (ps ProposalStorage) SetNextProposalID(ctx sdk.Context, nextProposalID *NextProposalID) sdk.Error
- func (ps ProposalStorage) SetOngoingProposal(ctx sdk.Context, proposalID types.ProposalKey, proposal Proposal) sdk.Error
- type ProtocolUpgradeProposal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrFailedToMarshalNextProposalID ¶
ErrFailedToMarshalNextProposalID - error if marshal next proposal id failed
func ErrFailedToMarshalProposal ¶
ErrFailedToMarshalProposal - error if marshal proposal failed
func ErrFailedToUnmarshalNextProposalID ¶
ErrFailedToUnmarshalProposal - error if unmarshal next proposal id failed
func ErrFailedToUnmarshalProposal ¶
ErrFailedToUnmarshalProposal - error if unmarshal proposal failed
func ErrNextProposalIDNotFound ¶
ErrNextProposalIDNotFound - error if next proposal ID is not found in KVStore
func ErrProposalNotFound ¶
ErrProposalNotFound - error if proposal is not found in KVStore
func GetExpiredProposalKey ¶ added in v0.1.1
func GetExpiredProposalKey(proposalID types.ProposalKey) []byte
GetExpiredProposalKey - "expired proposal subStore" + "proposal ID"
func GetOngoingProposalKey ¶ added in v0.1.1
func GetOngoingProposalKey(proposalID types.ProposalKey) []byte
GetOngoingProposalKey - "ongoing proposal substore" + "proposal ID"
Types ¶
type ChangeParamProposal ¶
type ChangeParamProposal struct { ProposalInfo Param param.Parameter `json:"param"` Reason string `json:"reason"` }
ChangeParamProposal - change parameter proposal
func (*ChangeParamProposal) GetProposalInfo ¶
func (p *ChangeParamProposal) GetProposalInfo() ProposalInfo
GetProposalInfo - implements Proposal
func (*ChangeParamProposal) SetProposalInfo ¶
func (p *ChangeParamProposal) SetProposalInfo(info ProposalInfo)
SetProposalInfo - implements Proposal
type ContentCensorshipProposal ¶
type ContentCensorshipProposal struct { ProposalInfo Permlink types.Permlink `json:"permlink"` Reason string `json:"reason"` }
ContentCensorshipProposal - content censorship proposal
func (*ContentCensorshipProposal) GetProposalInfo ¶
func (p *ContentCensorshipProposal) GetProposalInfo() ProposalInfo
GetProposalInfo - implements Proposal
func (*ContentCensorshipProposal) SetProposalInfo ¶
func (p *ContentCensorshipProposal) SetProposalInfo(info ProposalInfo)
SetProposalInfo - implements Proposal
type NextProposalID ¶
type NextProposalID struct {
NextProposalID int64 `json:"next_proposal_id"`
}
NextProposalID - store next proposal ID to KVStore
type Proposal ¶
type Proposal interface { GetProposalInfo() ProposalInfo SetProposalInfo(ProposalInfo) }
Proposal - there are three proposal types 1) change parameter proposal 2) content censorship proposal 3) protocol upgrade proposal
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"` }
ProposalInfo - basic proposal info
type ProposalStorage ¶
type ProposalStorage struct {
// contains filtered or unexported fields
}
ProposalStorage - proposal storage
func NewProposalStorage ¶
func NewProposalStorage(key sdk.StoreKey) ProposalStorage
func (ProposalStorage) DeleteExpiredProposal ¶ added in v0.1.1
func (ps ProposalStorage) DeleteExpiredProposal(ctx sdk.Context, proposalID types.ProposalKey) sdk.Error
DeleteExpiredProposal - delete proposal from expired proposal KVStore
func (ProposalStorage) DeleteOngoingProposal ¶ added in v0.1.1
func (ps ProposalStorage) DeleteOngoingProposal(ctx sdk.Context, proposalID types.ProposalKey) sdk.Error
SetOngoingProposal - delete proposal from ongoing proposal KVStore
func (ProposalStorage) DoesProposalExist ¶
func (ps ProposalStorage) DoesProposalExist(ctx sdk.Context, proposalID types.ProposalKey) bool
DoesProposalExist - check if proposal exists in KVStore or not
func (ProposalStorage) GetExpiredProposal ¶ added in v0.1.1
func (ps ProposalStorage) GetExpiredProposal(ctx sdk.Context, proposalID types.ProposalKey) (Proposal, sdk.Error)
GetExpiredProposal - get proposal from expired proposal KVStore
func (ProposalStorage) GetExpiredProposalList ¶ added in v0.1.1
GetExpiredProposalList - get expired proposal list from expired proposal KVStore
func (ProposalStorage) GetNextProposalID ¶
func (ps ProposalStorage) GetNextProposalID(ctx sdk.Context) (*NextProposalID, sdk.Error)
GetNextProposalID - get next proposal ID from KVStore
func (ProposalStorage) GetOngoingProposal ¶ added in v0.1.1
func (ps ProposalStorage) GetOngoingProposal(ctx sdk.Context, proposalID types.ProposalKey) (Proposal, sdk.Error)
GetOngoingProposal - get proposal from ongoing proposal KVStore
func (ProposalStorage) GetOngoingProposalList ¶ added in v0.1.1
GetOngoingProposalList - get ongoing proposal list from ongoing proposal KVStore
func (ProposalStorage) InitGenesis ¶
func (ps ProposalStorage) InitGenesis(ctx sdk.Context) sdk.Error
InitGenesis - initialize proposal storage
func (ProposalStorage) SetExpiredProposal ¶ added in v0.1.1
func (ps ProposalStorage) SetExpiredProposal(ctx sdk.Context, proposalID types.ProposalKey, proposal Proposal) sdk.Error
SetExpiredProposal - set proposal to expired proposal KVStore
func (ProposalStorage) SetNextProposalID ¶
func (ps ProposalStorage) SetNextProposalID(ctx sdk.Context, nextProposalID *NextProposalID) sdk.Error
SetNextProposalID - set next proposal ID to KVStore
func (ProposalStorage) SetOngoingProposal ¶ added in v0.1.1
func (ps ProposalStorage) SetOngoingProposal(ctx sdk.Context, proposalID types.ProposalKey, proposal Proposal) sdk.Error
SetOngoingProposal - set proposal to ongoing proposal KVStore
type ProtocolUpgradeProposal ¶
type ProtocolUpgradeProposal struct { ProposalInfo Link string `json:"link"` Reason string `json:"reason"` }
ProtocolUpgradeProposal - protocol upgrade proposal
func (*ProtocolUpgradeProposal) GetProposalInfo ¶
func (p *ProtocolUpgradeProposal) GetProposalInfo() ProposalInfo
GetProposalInfo - implements Proposal
func (*ProtocolUpgradeProposal) SetProposalInfo ¶
func (p *ProtocolUpgradeProposal) SetProposalInfo(info ProposalInfo)
SetProposalInfo - implements Proposal