authority

package
v0.0.0-...-75aef46 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authority

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

Authority implements native methods of `Authority` contract.

func New

func New(addr powerplay.Address, state *state.State) *Authority

New create a new instance.

func (*Authority) Add

func (a *Authority) Add(nodeMaster powerplay.Address, endorsor powerplay.Address, identity powerplay.Bytes32) bool

Add add a new candidate.

func (*Authority) Candidates

func (a *Authority) Candidates(endorsement *big.Int, limit uint64) []*Candidate

Candidates picks a batch of candidates up to limit, that satisfy given endorsement.

func (*Authority) First

func (a *Authority) First() *powerplay.Address

First returns node master address of first entry.

func (*Authority) Get

func (a *Authority) Get(nodeMaster powerplay.Address) (listed bool, endorsor powerplay.Address, identity powerplay.Bytes32, active bool)

Get get candidate by node master address.

func (*Authority) Next

func (a *Authority) Next(nodeMaster powerplay.Address) *powerplay.Address

Next returns address of next node master address after given node master address.

func (*Authority) Revoke

func (a *Authority) Revoke(nodeMaster powerplay.Address) bool

Revoke revoke candidate by given node master address. The entry is not removed, but set unlisted and inactive.

func (*Authority) Update

func (a *Authority) Update(nodeMaster powerplay.Address, active bool) bool

Update update candidate's status.

type Candidate

type Candidate struct {
	NodeMaster powerplay.Address
	Endorsor   powerplay.Address
	Identity   powerplay.Bytes32
	Active     bool
}

Candidate candidate of block proposer.

Jump to

Keyboard shortcuts

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