system

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: MIT Imports: 10 Imported by: 13

Documentation

Overview

*

  • @file
  • @copyright defined in aergo/LICENSE.txt

*

  • @file
  • @copyright defined in aergo/LICENSE.txt

Index

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

func BuildOrderedCandidates(vote map[string]*big.Int) []string

BuildOrderedCandidates returns a candidate list ordered by votes.xs

func ExecuteSystemTx

func ExecuteSystemTx(scs *state.ContractState, txBody *types.TxBody,
	sender, receiver *state.V, blockNo types.BlockNo) ([]*types.Event, error)

func GetMinimumStaking added in v0.9.0

func GetMinimumStaking(scs *state.ContractState) *big.Int

func GetNamePrice added in v0.9.0

func GetNamePrice(scs *state.ContractState) *big.Int

func GetRankers added in v0.9.0

func GetRankers(ar AccountStateReader) ([]string, error)

GetRankers returns the IDs of the top n rankers.

func GetStaking added in v0.8.1

func GetStaking(scs *state.ContractState, address []byte) (*types.Staking, error)

func GetStakingTotal added in v0.9.0

func GetStakingTotal(scs *state.ContractState) (*big.Int, error)

func GetTotal added in v0.9.0

func GetTotal(ar AccountStateReader) (*big.Int, error)

func GetVote

func GetVote(scs *state.ContractState, voter []byte, title []byte) (*types.Vote, error)

GetVote return amount, to, err

func GetVoteResult

func GetVoteResult(ar AccountStateReader, id []byte, n int) (*types.VoteList, error)

GetVoteResult returns the top n voting result from the system account state.

func GetVoteResultEx added in v0.9.0

func GetVoteResultEx(ar AccountStateReader, key []byte, n int) (*types.VoteList, error)

func InitDefaultBpCount added in v0.9.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

func InitVoteResult(scs *state.ContractState, voteResult map[string]*big.Int) error

Types

type AccountStateReader added in v0.9.0

type AccountStateReader interface {
	GetSystemAccountState() (*state.ContractState, error)
}

AccountStateReader is an interface for getting a system account state.

type SystemContext added in v0.9.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 v0.9.0

type VoteResult struct {
	// contains filtered or unexported fields
}

func (*VoteResult) AddVote added in v0.9.0

func (voteResult *VoteResult) AddVote(vote *types.Vote) error

func (*VoteResult) SubVote added in v0.9.0

func (voteResult *VoteResult) SubVote(vote *types.Vote) error

func (*VoteResult) Sync added in v0.9.0

func (vr *VoteResult) Sync(scs *state.ContractState) error

Jump to

Keyboard shortcuts

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