Back to

Package eligibility

Latest Go to latest

The highest tagged major version is .

Published: Apr 17, 2020 | License: MIT | Module:


Package eligibility defines fixed size oracle used for node testing


type FixedRolacle

type FixedRolacle struct {
	// contains filtered or unexported fields

FixedRolacle is an eligibility simulator with pre-determined honest and faulty participants.

func New

func New() *FixedRolacle

New initializes the oracle with no participants.

func (*FixedRolacle) Eligible

func (fo *FixedRolacle) Eligible(layer types.LayerID, round int32, committeeSize int, id types.NodeID, sig []byte) (bool, error)

Eligible returns whether the specific NodeID is eligible for layer in roudn and committee size.

func (*FixedRolacle) Export

func (fo *FixedRolacle) Export(id uint32, committeeSize int) map[string]struct{}

Export creates a map with the eligible participants for id and committee size.

func (*FixedRolacle) IsIdentityActiveOnConsensusView

func (fo *FixedRolacle) IsIdentityActiveOnConsensusView(edID string, layer types.LayerID) (bool, error)

IsIdentityActiveOnConsensusView is use to satisfy the API, currently always returns true.

func (*FixedRolacle) Proof

func (fo *FixedRolacle) Proof(layer types.LayerID, round int32) ([]byte, error)

Proof generates a proof for the round. used to satisfy interface.

func (*FixedRolacle) Register

func (fo *FixedRolacle) Register(isHonest bool, client string)

Register adds a participant to the eligibility map. can be honest or faulty.

func (*FixedRolacle) Unregister

func (fo *FixedRolacle) Unregister(isHonest bool, client string)

Unregister removes a participant from the eligibility map. can be honest or faulty. TODO: just remove from both instead of specifying.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier