Documentation ¶
Overview ¶
*
- @file
- @copyright defined in aergo/LICENSE.txt
*
- @file
- @copyright defined in aergo/LICENSE.txt
Index ¶
- Constants
- func BuildOrderedCandidates(vote map[string]*big.Int) []string
- func ExecuteSystemTx(scs *state.ContractState, txBody *types.TxBody, sender, receiver *state.V, ...) ([]*types.Event, error)
- func GetMinimumStaking(scs *state.ContractState) *big.Int
- func GetNamePrice(scs *state.ContractState) *big.Int
- func GetRankers(ar AccountStateReader) ([]string, error)
- func GetStaking(scs *state.ContractState, address []byte) (*types.Staking, error)
- func GetStakingTotal(scs *state.ContractState) (*big.Int, error)
- func GetTotal(ar AccountStateReader) (*big.Int, error)
- func GetVote(scs *state.ContractState, voter []byte, title []byte) (*types.Vote, error)
- func GetVoteResult(ar AccountStateReader, id []byte, n int) (*types.VoteList, error)
- func GetVoteResultEx(ar AccountStateReader, key []byte, n int) (*types.VoteList, error)
- func InitDefaultBpCount(bpCount int)
- func InitVoteResult(scs *state.ContractState, voteResult map[string]*big.Int) error
- type AccountStateReader
- type SystemContext
- type VoteResult
Constants ¶
View Source
const PeerIDLength = 39
View Source
const StakingDelay = 60 * 60 * 24 //block interval
View Source
const VotingDelay = 60 * 60 * 24 //block interval
Variables ¶
This section is empty.
Functions ¶
func BuildOrderedCandidates ¶ added in v0.8.3
BuildOrderedCandidates returns a candidate list ordered by votes.xs
func ExecuteSystemTx ¶
func GetMinimumStaking ¶ added in v1.0.0
func GetMinimumStaking(scs *state.ContractState) *big.Int
func GetNamePrice ¶ added in v1.0.0
func GetNamePrice(scs *state.ContractState) *big.Int
func GetRankers ¶ added in v0.11.0
func GetRankers(ar AccountStateReader) ([]string, error)
GetRankers returns the IDs of the top n rankers.
func GetStaking ¶ added in v0.8.1
func GetStakingTotal ¶ added in v1.0.0
func GetStakingTotal(scs *state.ContractState) (*big.Int, error)
func GetVoteResult ¶
GetVoteResult returns the top n voting result from the system account state.
func GetVoteResultEx ¶ added in v1.0.0
func InitDefaultBpCount ¶ added in v1.0.0
func InitDefaultBpCount(bpCount int)
InitDefaultBpCount sets defaultBpCount to bpCount.
Caution: This function must be called only once before all the aergosvr services start.
func InitVoteResult ¶
Types ¶
type AccountStateReader ¶ added in v0.9.4
type AccountStateReader interface {
GetSystemAccountState() (*state.ContractState, error)
}
AccountStateReader is an interface for getting a system account state.
type SystemContext ¶ added in v1.0.0
type SystemContext struct { BlockNo uint64 Call *types.CallInfo Args []string Staked *types.Staking Vote *types.Vote Sender *state.V Receiver *state.V }
func ValidateSystemTx ¶
func ValidateSystemTx(account []byte, txBody *types.TxBody, sender *state.V, scs *state.ContractState, blockNo uint64) (*SystemContext, error)
type VoteResult ¶ added in v1.0.0
type VoteResult struct {
// contains filtered or unexported fields
}
func (*VoteResult) AddVote ¶ added in v1.0.0
func (voteResult *VoteResult) AddVote(vote *types.Vote) error
func (*VoteResult) SubVote ¶ added in v1.0.0
func (voteResult *VoteResult) SubVote(vote *types.Vote) error
func (*VoteResult) Sync ¶ added in v1.0.0
func (vr *VoteResult) Sync(scs *state.ContractState) error
Click to show internal directories.
Click to hide internal directories.