Documentation ¶
Overview ¶
Package tests is a collection of staking backend implementation tests.
Index ¶
- Constants
- Variables
- func AddressFromString(s string) api.Address
- func GenesisState() api.Genesis
- func StakingClientImplementationTests(t *testing.T, backend api.Backend, consensus consensusAPI.Backend)
- func StakingImplementationTests(t *testing.T, backend api.Backend, consensus consensusAPI.Backend, ...)
- type AccountList
Constants ¶
const NumAccounts = 7
NumAccounts corresponds to the number of staking accounts used in the staking genesis state as returned by GenesisState.
Variables ¶
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
AddressFromString returns a staking account address from its string representation or panics.
func GenesisState ¶ added in v0.2100.0
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.