auworkshareity

package
v0.0.0-...-e4e12f0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 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 Auworkshareity

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

Auworkshareity implements native methods of `Auworkshareity` contract.

func New

func New(addr workshare.Address, state *state.State) *Auworkshareity

New create a new instance.

func (*Auworkshareity) Add

func (a *Auworkshareity) Add(nodeMaster workshare.Address, endorsor workshare.Address, identity workshare.Bytes32) (bool, error)

Add add a new candidate.

func (*Auworkshareity) AllCandidates

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

AllCandidates lists all registered candidates.

func (*Auworkshareity) Candidates

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

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

func (*Auworkshareity) First

func (a *Auworkshareity) First() (*workshare.Address, error)

First returns node master address of first entry.

func (*Auworkshareity) Get

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

Get get candidate by node master address.

func (*Auworkshareity) Next

func (a *Auworkshareity) Next(nodeMaster workshare.Address) (*workshare.Address, error)

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

func (*Auworkshareity) Revoke

func (a *Auworkshareity) Revoke(nodeMaster workshare.Address) (bool, error)

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

func (*Auworkshareity) Update

func (a *Auworkshareity) Update(nodeMaster workshare.Address, active bool) (bool, error)

Update update candidate's status.

type Candidate

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