keeper

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package keeper provides methods to initialize SDK keepers with local storage for test purposes

Index

Constants

This section is empty.

Variables

View Source
var (
	// ExampleTimestamp is a timestamp used as the current time for the context of the keepers returned from the package
	ExampleTimestamp = time.Date(2020, time.January, 1, 12, 0, 0, 0, time.UTC)

	// ExampleHeight is a block height used as the current block height for the context of test keeper
	ExampleHeight = int64(1111)
)

Functions

func ModuleAccountAddrs

func ModuleAccountAddrs(maccPerms map[string][]string) map[string]bool

ModuleAccountAddrs returns all the app's module account addresses.

func NewTestSetup

func NewTestSetup(t testing.TB) (sdk.Context, TestKeepers, TestMsgServers)

NewTestSetup returns initialized instances of all the keepers and message servers of the modules

Types

type ProtocolVersionSetter

type ProtocolVersionSetter struct{}

func (ProtocolVersionSetter) SetProtocolVersion

func (vs ProtocolVersionSetter) SetProtocolVersion(uint64)

type TestKeepers

type TestKeepers struct {
	T             testing.TB
	AccountKeeper authkeeper.AccountKeeper
	BankKeeper    bankkeeper.Keeper
	DistrKeeper   distrkeeper.Keeper
	StakingKeeper *stakingkeeper.Keeper
	ClaimKeeper   *claimkeeper.Keeper
}

TestKeepers holds all keepers used during keeper tests for all modules

type TestMsgServers

type TestMsgServers struct {
	T        testing.TB
	ClaimSrv claimtypes.MsgServer
}

TestMsgServers holds all message servers used during keeper tests for all modules

Jump to

Keyboard shortcuts

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