Documentation ¶
Index ¶
- type Authority
- func (a *Authority) Add(nodeMaster luckyshare.Address, endorsor luckyshare.Address, ...) (bool, error)
- func (a *Authority) AllCandidates() ([]*Candidate, error)
- func (a *Authority) Candidates(endorsement *big.Int, limit uint64) ([]*Candidate, error)
- func (a *Authority) First() (*luckyshare.Address, error)
- func (a *Authority) Get(nodeMaster luckyshare.Address) (listed bool, endorsor luckyshare.Address, identity luckyshare.Bytes32, ...)
- func (a *Authority) Next(nodeMaster luckyshare.Address) (*luckyshare.Address, error)
- func (a *Authority) Revoke(nodeMaster luckyshare.Address) (bool, error)
- func (a *Authority) Update(nodeMaster luckyshare.Address, active bool) (bool, error)
- type Candidate
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 luckyshare.Address, state *state.State) *Authority
New create a new instance.
func (*Authority) Add ¶
func (a *Authority) Add(nodeMaster luckyshare.Address, endorsor luckyshare.Address, identity luckyshare.Bytes32) (bool, error)
Add add a new candidate.
func (*Authority) AllCandidates ¶
AllCandidates lists all registered candidates.
func (*Authority) Candidates ¶
Candidates picks a batch of candidates up to limit, that satisfy given endorsement.
func (*Authority) First ¶
func (a *Authority) First() (*luckyshare.Address, error)
First returns node master address of first entry.
func (*Authority) Get ¶
func (a *Authority) Get(nodeMaster luckyshare.Address) (listed bool, endorsor luckyshare.Address, identity luckyshare.Bytes32, active bool, err error)
Get get candidate by node master address.
func (*Authority) Next ¶
func (a *Authority) Next(nodeMaster luckyshare.Address) (*luckyshare.Address, error)
Next returns address of next node master address after given node master address.
type Candidate ¶
type Candidate struct { NodeMaster luckyshare.Address Endorsor luckyshare.Address Identity luckyshare.Bytes32 Active bool }
Candidate candidate of block proposer.
Click to show internal directories.
Click to hide internal directories.