authority

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: LGPL-3.0 Imports: 4 Imported by: 0

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 thor.Address, state *state.State) *Authority

New create a new instance.

func (*Authority) Add

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

Add add a new candidate.

func (*Authority) AllCandidates added in v1.1.5

func (a *Authority) AllCandidates() ([]*Candidate, error)

AllCandidates lists all registered candidates.

func (*Authority) Candidates

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

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

func (*Authority) First

func (a *Authority) First() (*thor.Address, error)

First returns node master address of first entry.

func (*Authority) Get

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

Get get candidate by node master address.

func (*Authority) Next

func (a *Authority) Next(nodeMaster thor.Address) (*thor.Address, error)

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

func (*Authority) Revoke

func (a *Authority) Revoke(nodeMaster thor.Address) (bool, error)

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 thor.Address, active bool) (bool, error)

Update update candidate's status.

type Candidate

type Candidate struct {
	NodeMaster thor.Address
	Endorsor   thor.Address
	Identity   thor.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