mock

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Rnd  uint64
	Rand []byte
	Sig  []byte
	PSig []byte
}

Result is a mock result that can be used for testing.

func NewMockResult

func NewMockResult(round uint64) Result

NewMockResult creates a mock result for testing.

func VerifiableResults

func VerifiableResults(count int) (*chain.Info, []Result)

VerifiableResults creates a set of results that will pass a `chain.Verify` check.

func (*Result) AssertValid

func (r *Result) AssertValid(t *testing.T)

AssertValid checks that this result is valid.

func (*Result) PreviousSignature

func (r *Result) PreviousSignature() []byte

PreviousSignature is the signature of the previous round.

func (*Result) Randomness

func (r *Result) Randomness() []byte

Randomness is a hash of the signature.

func (*Result) Round

func (r *Result) Round() uint64

Round is the round number for this random data.

func (*Result) Signature

func (r *Result) Signature() []byte

Signature is the signature of the randomness for this round.

Jump to

Keyboard shortcuts

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