testing

package
v0.0.0-...-15eb78e Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateNewRoundAccountTotals

func CalculateNewRoundAccountTotals(t *gotesting.T, newRoundDeltas ledgercore.AccountDeltas, newRoundRewardLevel uint64, newRoundConsensusParams config.ConsensusParams, prevRoundBalances map[basics.Address]basics.AccountData, prevRoundTotals ledgercore.AccountTotals) (newTotals ledgercore.AccountTotals)

CalculateNewRoundAccountTotals calculates the accounts totals for a given round

func GenerateInitState

func GenerateInitState(tb testing.TB, proto protocol.ConsensusVersion, baseAlgoPerAccount int) (genesisInitState ledgercore.InitState, initKeys map[basics.Address]*crypto.SignatureSecrets)

GenerateInitState generates testing init state

func Genesis

func Genesis(naccts int) (ledgercore.InitState, []basics.Address, []*crypto.SignatureSecrets)

Genesis creates a genesis state for naccts accounts using the ConsensusCurrentVersion

func GenesisWithProto

func GenesisWithProto(naccts int, proto protocol.ConsensusVersion) (ledgercore.InitState, []basics.Address, []*crypto.SignatureSecrets)

GenesisWithProto creates a genesis state for naccts accounts using the proto consensus protocol

func NewTestGenesis

NewTestGenesis creates a bunch of accounts, splits up 10B algos between them and the rewardspool and feesink, and gives out the addresses and secrets it creates to enable tests. For special scenarios, manipulate these return values before using newTestLedger.

func RandomAccountData

func RandomAccountData(rewardsLevel uint64) basics.AccountData

RandomAccountData generates a random AccountData

func RandomAccounts

func RandomAccounts(niter int, simpleAccounts bool) map[basics.Address]basics.AccountData

RandomAccounts generates a random set of accounts map

func RandomAddress

func RandomAddress() basics.Address

RandomAddress generates a random address

func RandomDeltas

func RandomDeltas(niter int, base map[basics.Address]basics.AccountData, rewardsLevel uint64) (updates ledgercore.AccountDeltas, totals map[basics.Address]basics.AccountData, imbalance int64)

RandomDeltas generates a random set of accounts delta

func RandomDeltasBalanced

func RandomDeltasBalanced(niter int, base map[basics.Address]basics.AccountData, rewardsLevel uint64) (updates ledgercore.AccountDeltas, totals map[basics.Address]basics.AccountData)

RandomDeltasBalanced generates a random set of accounts delta

func RandomDeltasBalancedFull

func RandomDeltasBalancedFull(niter int, base map[basics.Address]basics.AccountData, rewardsLevel uint64, lastCreatableIDIn uint64) (updates ledgercore.AccountDeltas, totals map[basics.Address]basics.AccountData, lastCreatableID uint64)

RandomDeltasBalancedFull generates a random set of accounts delta

func RandomDeltasBalancedImpl

func RandomDeltasBalancedImpl(niter int, base map[basics.Address]basics.AccountData, rewardsLevel uint64, simple bool, lastCreatableIDIn uint64) (updates ledgercore.AccountDeltas, totals map[basics.Address]basics.AccountData, lastCreatableID uint64)

RandomDeltasBalancedImpl generates a random set of accounts delta

func RandomDeltasFull

func RandomDeltasFull(niter int, base map[basics.Address]basics.AccountData, rewardsLevel uint64, lastCreatableIDIn uint64) (updates ledgercore.AccountDeltas, totals map[basics.Address]basics.AccountData, imbalance int64, lastCreatableID uint64)

RandomDeltasFull generates a random set of accounts delta

func RandomDeltasImpl

func RandomDeltasImpl(niter int, base map[basics.Address]basics.AccountData, rewardsLevel uint64, simple bool, lastCreatableIDIn uint64) (updates ledgercore.AccountDeltas, totals map[basics.Address]basics.AccountData, imbalance int64, lastCreatableID uint64)

RandomDeltasImpl generates a random set of accounts delta

func RandomFullAccountData

func RandomFullAccountData(rewardsLevel, lastCreatableID uint64) (basics.AccountData, uint64)

RandomFullAccountData generates a random AccountData

func RandomNote

func RandomNote() []byte

RandomNote generates a random notes data

Types

This section is empty.

Jump to

Keyboard shortcuts

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