eligibility

package
v0.1.15-a Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package eligibility defines fixed size oracle used for node testing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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.

Jump to

Keyboard shortcuts

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