tests

package
v0.2202.5 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package tests is a collection of staking backend implementation tests.

Index

Constants

View Source
const NumAccounts = 7

NumAccounts corresponds to the number of staking accounts used in the staking genesis state as returned by GenesisState.

Variables

View Source
var Accounts = newAccountList()

Accounts stores an AccountList with staking accounts used in the staking genesis state as returned by GenesisState.

Functions

func AddressFromString added in v0.2100.0

func AddressFromString(s string) api.Address

AddressFromString returns a staking account address from its string representation or panics.

func GenesisState added in v0.2100.0

func GenesisState() api.Genesis

GenesisState returns a staking genesis state that can be used in tests.

func StakingClientImplementationTests

func StakingClientImplementationTests(t *testing.T, backend api.Backend, consensus consensusAPI.Backend)

StakingClientImplementationTests exercises the basic functionality of a staking client backend.

func StakingImplementationTests

func StakingImplementationTests(
	t *testing.T,
	backend api.Backend,
	consensus consensusAPI.Backend,
	identity *identity.Identity,
	entity *entity.Entity,
	entitySigner signature.Signer,
	runtimeID common.Namespace,
)

StakingImplementationTests exercises the basic functionality of a staking backend.

Types

type AccountList added in v0.2100.0

type AccountList []account

AccountList holds information about a list of staking accounts.

func (AccountList) GetAddress added in v0.2100.0

func (a AccountList) GetAddress(index int) api.Address

GetAddress returns the address of the i-th account in the list or panics.

NOTE: Indexing is 1-based, NOT 0-based.

func (AccountList) GetSigner added in v0.2100.0

func (a AccountList) GetSigner(index int) signature.Signer

GetSigner returns the signer of the i-th account in the list or panics.

NOTE: Indexing is 1-based, NOT 0-based.

Jump to

Keyboard shortcuts

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