scheme

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSchemeID = "pedersen-bls-chained"

DefaultSchemeID is the default scheme ID.

View Source
const UnchainedSchemeID = "pedersen-bls-unchained"

UnchainedSchemeID is the scheme id used to set unchained randomness on beacons.

Variables

This section is empty.

Functions

func ListSchemes

func ListSchemes() (schemeIDs []string)

ListSchemes will return a slice of valid scheme ids

Types

type Scheme

type Scheme struct {
	ID              string
	DecouplePrevSig bool
}

Scheme is used to group a set of configurations related to the scheme beacons will use to generate randomness

func GetSchemeByID

func GetSchemeByID(id string) (scheme Scheme, found bool)

GetSchemeByID allows the user to retrieve the scheme configuration looking by its ID. It will return a boolean which indicates if the scheme was found or not.

func GetSchemeByIDWithDefault

func GetSchemeByIDWithDefault(id string) (scheme Scheme, err error)

GetSchemeByIDWithDefault allows the user to retrieve the scheme configuration looking by its ID. It will return a boolean which indicates if the scheme was foound or not. In addition to it, if the received ID is an empty string, it will return the default defined scheme

func GetSchemeFromEnv

func GetSchemeFromEnv() Scheme

GetSchemeFromEnv allows the user to retrieve the scheme configuration looking by the ID set on an environmental variable. If the scheme is not found, function will panic.

func ReadSchemeByEnv

func ReadSchemeByEnv() (Scheme, bool)

ReadSchemeByEnv allows the user to retrieve the scheme configuration looking by the ID set on an environmental variable. It will return a boolean which indicates if the scheme was found or not. If the env var is an empty string, it will use the default scheme ID.

Jump to

Keyboard shortcuts

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