Documentation
¶
Index ¶
- func ErrDelegationNotFound() sdk.Error
- func ErrFailedToMarshalDelegation(err error) sdk.Error
- func ErrFailedToMarshalReferenceList(err error) sdk.Error
- func ErrFailedToMarshalVote(err error) sdk.Error
- func ErrFailedToMarshalVoter(err error) sdk.Error
- func ErrFailedToUnmarshalDelegation(err error) sdk.Error
- func ErrFailedToUnmarshalReferenceList(err error) sdk.Error
- func ErrFailedToUnmarshalVote(err error) sdk.Error
- func ErrFailedToUnmarshalVoter(err error) sdk.Error
- func ErrReferenceListNotFound() sdk.Error
- func ErrVoteNotFound() sdk.Error
- func ErrVoterNotFound() sdk.Error
- func GetDelegationKey(me types.AccountKey, myDelegator types.AccountKey) []byte
- func GetVoteKey(proposalID types.ProposalKey, voter types.AccountKey) []byte
- func GetVoterKey(me types.AccountKey) []byte
- type Delegation
- type ReferenceList
- type Vote
- type VoteStorage
- func (vs VoteStorage) DeleteDelegation(ctx sdk.Context, voter types.AccountKey, delegator types.AccountKey) sdk.Error
- func (vs VoteStorage) DeleteVote(ctx sdk.Context, proposalID types.ProposalKey, voter types.AccountKey) sdk.Error
- func (vs VoteStorage) DeleteVoter(ctx sdk.Context, username types.AccountKey) sdk.Error
- func (vs VoteStorage) DoesDelegationExist(ctx sdk.Context, voter types.AccountKey, delegator types.AccountKey) bool
- func (vs VoteStorage) DoesVoteExist(ctx sdk.Context, proposalID types.ProposalKey, voter types.AccountKey) bool
- func (vs VoteStorage) DoesVoterExist(ctx sdk.Context, accKey types.AccountKey) bool
- func (vs VoteStorage) GetAllDelegators(ctx sdk.Context, voterName types.AccountKey) ([]types.AccountKey, sdk.Error)
- func (vs VoteStorage) GetAllVotes(ctx sdk.Context, proposalID types.ProposalKey) ([]Vote, sdk.Error)
- func (vs VoteStorage) GetDelegation(ctx sdk.Context, voter types.AccountKey, delegator types.AccountKey) (*Delegation, sdk.Error)
- func (vs VoteStorage) GetReferenceList(ctx sdk.Context) (*ReferenceList, sdk.Error)
- func (vs VoteStorage) GetVote(ctx sdk.Context, proposalID types.ProposalKey, voter types.AccountKey) (*Vote, sdk.Error)
- func (vs VoteStorage) GetVoter(ctx sdk.Context, accKey types.AccountKey) (*Voter, sdk.Error)
- func (vs VoteStorage) InitGenesis(ctx sdk.Context) sdk.Error
- func (vs VoteStorage) SetDelegation(ctx sdk.Context, voter types.AccountKey, delegator types.AccountKey, ...) sdk.Error
- func (vs VoteStorage) SetReferenceList(ctx sdk.Context, lst *ReferenceList) sdk.Error
- func (vs VoteStorage) SetVote(ctx sdk.Context, proposalID types.ProposalKey, voter types.AccountKey, ...) sdk.Error
- func (vs VoteStorage) SetVoter(ctx sdk.Context, accKey types.AccountKey, voter *Voter) sdk.Error
- type Voter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrDelegationNotFound ¶
func ErrFailedToMarshalVote ¶
func ErrFailedToUnmarshalVoter ¶
unmarshal error
func ErrVoteNotFound ¶
func GetDelegationKey ¶
func GetDelegationKey(me types.AccountKey, myDelegator types.AccountKey) []byte
"delegation substore" + "me(voter)" + "my delegator"
func GetVoteKey ¶
func GetVoteKey(proposalID types.ProposalKey, voter types.AccountKey) []byte
"vote substore" + "proposalID" + "voter"
func GetVoterKey ¶
func GetVoterKey(me types.AccountKey) []byte
Types ¶
type Delegation ¶
type Delegation struct {
Delegator types.AccountKey `json:"delegator"`
Amount types.Coin `json:"amount"`
}
type ReferenceList ¶
type ReferenceList struct {
AllValidators []types.AccountKey `json:"all_validators"`
}
type Vote ¶
type Vote struct {
Voter types.AccountKey `json:"voter"`
VotingPower types.Coin `json:"voting_power"`
Result bool `json:"result"`
}
type VoteStorage ¶
type VoteStorage struct {
// contains filtered or unexported fields
}
func NewVoteStorage ¶
func NewVoteStorage(key sdk.StoreKey) VoteStorage
func (VoteStorage) DeleteDelegation ¶
func (vs VoteStorage) DeleteDelegation(ctx sdk.Context, voter types.AccountKey, delegator types.AccountKey) sdk.Error
func (VoteStorage) DeleteVote ¶
func (vs VoteStorage) DeleteVote(ctx sdk.Context, proposalID types.ProposalKey, voter types.AccountKey) sdk.Error
func (VoteStorage) DeleteVoter ¶
func (vs VoteStorage) DeleteVoter(ctx sdk.Context, username types.AccountKey) sdk.Error
func (VoteStorage) DoesDelegationExist ¶
func (vs VoteStorage) DoesDelegationExist(ctx sdk.Context, voter types.AccountKey, delegator types.AccountKey) bool
func (VoteStorage) DoesVoteExist ¶
func (vs VoteStorage) DoesVoteExist(ctx sdk.Context, proposalID types.ProposalKey, voter types.AccountKey) bool
func (VoteStorage) DoesVoterExist ¶
func (vs VoteStorage) DoesVoterExist(ctx sdk.Context, accKey types.AccountKey) bool
func (VoteStorage) GetAllDelegators ¶
func (vs VoteStorage) GetAllDelegators(ctx sdk.Context, voterName types.AccountKey) ([]types.AccountKey, sdk.Error)
func (VoteStorage) GetAllVotes ¶
func (vs VoteStorage) GetAllVotes(ctx sdk.Context, proposalID types.ProposalKey) ([]Vote, sdk.Error)
func (VoteStorage) GetDelegation ¶
func (vs VoteStorage) GetDelegation(ctx sdk.Context, voter types.AccountKey, delegator types.AccountKey) (*Delegation, sdk.Error)
func (VoteStorage) GetReferenceList ¶
func (vs VoteStorage) GetReferenceList(ctx sdk.Context) (*ReferenceList, sdk.Error)
func (VoteStorage) GetVote ¶
func (vs VoteStorage) GetVote(ctx sdk.Context, proposalID types.ProposalKey, voter types.AccountKey) (*Vote, sdk.Error)
func (VoteStorage) GetVoter ¶
func (vs VoteStorage) GetVoter(ctx sdk.Context, accKey types.AccountKey) (*Voter, sdk.Error)
func (VoteStorage) InitGenesis ¶
func (vs VoteStorage) InitGenesis(ctx sdk.Context) sdk.Error
func (VoteStorage) SetDelegation ¶
func (vs VoteStorage) SetDelegation(ctx sdk.Context, voter types.AccountKey, delegator types.AccountKey, delegation *Delegation) sdk.Error
func (VoteStorage) SetReferenceList ¶
func (vs VoteStorage) SetReferenceList(ctx sdk.Context, lst *ReferenceList) sdk.Error
func (VoteStorage) SetVote ¶
func (vs VoteStorage) SetVote(ctx sdk.Context, proposalID types.ProposalKey, voter types.AccountKey, vote *Vote) sdk.Error
func (VoteStorage) SetVoter ¶
func (vs VoteStorage) SetVoter(ctx sdk.Context, accKey types.AccountKey, voter *Voter) sdk.Error
Click to show internal directories.
Click to hide internal directories.