Documentation ¶
Index ¶
- Constants
- func ErrInvalidBallot(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidBond(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidDeposit(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidPhase(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidVote(codespace sdk.CodespaceType, msg string) sdk.Error
- func GetAccountDecoder(cdc *wire.Codec) auth.AccountDecoder
- func RegisterAmino(cdc *amino.Codec)
- type Ballot
- type ChallengeMsg
- type CommitMsg
- type DeclareCandidacyMsg
- type GenesisAccount
- type GenesisState
- type Item
- type Listing
- type PriorityQueue
- func (pq PriorityQueue) Len() int
- func (pq PriorityQueue) Less(i, j int) bool
- func (pq *PriorityQueue) Peek() Item
- func (pq *PriorityQueue) Pop() interface{}
- func (pq *PriorityQueue) Push(x interface{})
- func (pq *PriorityQueue) Remove(Value string) sdk.Error
- func (pq PriorityQueue) Swap(i, j int)
- func (pq *PriorityQueue) Update(Value string, Priority int) sdk.Error
- type RevealMsg
- type Vote
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = 2 CodeInvalidDeposit sdk.CodeType = 101 CodeInvalidBond sdk.CodeType = 102 CodeInvalidBallot sdk.CodeType = 103 CodeInvalidPhase sdk.CodeType = 104 CodeInvalidVote sdk.CodeType = 105 )
Reserve errors 100 ~ 199
const (
TokenName = "RegistryCoin"
)
Variables ¶
This section is empty.
Functions ¶
func ErrInvalidBallot ¶
func ErrInvalidBallot(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidBond ¶
func ErrInvalidBond(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidDeposit ¶
func ErrInvalidDeposit(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidPhase ¶
func ErrInvalidPhase(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidVote ¶
func ErrInvalidVote(codespace sdk.CodespaceType, msg string) sdk.Error
func GetAccountDecoder ¶
func GetAccountDecoder(cdc *wire.Codec) auth.AccountDecoder
func RegisterAmino ¶
Types ¶
type Ballot ¶
type ChallengeMsg ¶
ChallengeMsg is used to challenge a pending or finalized listing
func NewChallengeMsg ¶
func (ChallengeMsg) GetSignBytes ¶
func (msg ChallengeMsg) GetSignBytes() []byte
func (ChallengeMsg) GetSigners ¶
func (msg ChallengeMsg) GetSigners() []sdk.Address
func (ChallengeMsg) Type ¶
func (msg ChallengeMsg) Type() string
func (ChallengeMsg) ValidateBasic ¶
func (msg ChallengeMsg) ValidateBasic() sdk.Error
type CommitMsg ¶
CommitMsg is used to make a commitment during commit phase on an active challenge to a specific listing identified by Identifier.
func NewCommitMsg ¶
func (CommitMsg) GetSignBytes ¶
func (CommitMsg) GetSigners ¶
func (CommitMsg) ValidateBasic ¶
type DeclareCandidacyMsg ¶
type DeclareCandidacyMsg struct { Owner sdk.Address Identifier string Details string Deposit sdk.Coin }
DeclareCandidacyMsg is used to propose a new listing to be added to registry. Identifier is a unique identifier of the listing Deposit is taken and held for entire duration of listing. Awarded to challengers upon successful challenge. Users can add details about candidate to convince voters to approve listing
func GenerateCandidacyMsg ¶
func GenerateCandidacyMsg() DeclareCandidacyMsg
func NewDeclareCandidacyMsg ¶
func (DeclareCandidacyMsg) GetSignBytes ¶
func (msg DeclareCandidacyMsg) GetSignBytes() []byte
func (DeclareCandidacyMsg) GetSigners ¶
func (msg DeclareCandidacyMsg) GetSigners() []sdk.Address
func (DeclareCandidacyMsg) Type ¶
func (msg DeclareCandidacyMsg) Type() string
func (DeclareCandidacyMsg) ValidateBasic ¶
func (msg DeclareCandidacyMsg) ValidateBasic() sdk.Error
type GenesisAccount ¶
GenesisAccount doesn't need pubkey or sequence
func NewGenesisAccount ¶
func NewGenesisAccount(aa *auth.BaseAccount) *GenesisAccount
func (*GenesisAccount) ToAccount ¶
func (ga *GenesisAccount) ToAccount() (acc *auth.BaseAccount, err error)
convert GenesisAccount to AppAccount
type GenesisState ¶
type GenesisState struct {
Accounts []*GenesisAccount `json:"accounts"`
}
type Item ¶
type Item struct { Value string // The Value of the item; arbitrary. Priority int // The Priority of the item in the queue. // contains filtered or unexported fields }
Value should be identifier of listing
type Listing ¶
func NewListing ¶
type PriorityQueue ¶
type PriorityQueue []*Item
A PriorityQueue implements heap.Interface and holds Items.
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Peek ¶
func (pq *PriorityQueue) Peek() Item
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
type RevealMsg ¶
RevealMsg is to reveal vote during reveal phase on active challenge to listing identified by Identifier.