agreementtest

package
v0.0.0-...-76c1feb Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package agreementtest produces useful functions for testing code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Simulate

func Simulate(dbname string, n basics.Round, roundDeadline time.Duration, ledger agreement.Ledger, keyManager agreement.KeyManager, proposalFactory agreement.BlockFactory, proposalValidator agreement.BlockValidator, log logging.Logger) error

Simulate n rounds of agreement on the specified Ledger given the specified KeyManager, BlockFactory, and BlockValidator.

If a nonzero roundDeadline is given, this function will return an error if any round does not conclude by the deadline.

The KeyManager must have enough keys to form a cert-quorum.

Types

type CryptoRandomSource

type CryptoRandomSource struct{}

CryptoRandomSource is a random source that is based off our crypto library.

func (*CryptoRandomSource) Uint64

func (c *CryptoRandomSource) Uint64() uint64

Uint64 implements the randomness by calling hte crypto library.

type SimpleKeyManager

type SimpleKeyManager []account.Participation

SimpleKeyManager provides a simple implementation of a KeyManager.

func (SimpleKeyManager) DeleteOldKeys

func (m SimpleKeyManager) DeleteOldKeys(r basics.Round)

DeleteOldKeys implements KeyManager.DeleteOldKeys.

func (SimpleKeyManager) VotingKeys

func (m SimpleKeyManager) VotingKeys(votingRound, _ basics.Round) []account.Participation

VotingKeys implements KeyManager.VotingKeys.

Jump to

Keyboard shortcuts

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