model

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrFailedToMarshalNextProposalID

func ErrFailedToMarshalNextProposalID(err error) sdk.Error

func ErrFailedToMarshalProposal

func ErrFailedToMarshalProposal(err error) sdk.Error

marshal error

func ErrFailedToMarshalProposalList

func ErrFailedToMarshalProposalList(err error) sdk.Error

func ErrFailedToUnmarshalNextProposalID

func ErrFailedToUnmarshalNextProposalID(err error) sdk.Error

func ErrFailedToUnmarshalProposal

func ErrFailedToUnmarshalProposal(err error) sdk.Error

unmarshal error

func ErrFailedToUnmarshalProposalList

func ErrFailedToUnmarshalProposalList(err error) sdk.Error

func ErrNextProposalIDNotFound

func ErrNextProposalIDNotFound() sdk.Error

func ErrProposalListNotFound

func ErrProposalListNotFound() sdk.Error

func ErrProposalNotFound

func ErrProposalNotFound() sdk.Error

not found err

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL