keeper

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const BLOCK_HEADER_LEN = 32
View Source
const (
	BLOCK_TIME = 30 * time.Second
)

Variables

This section is empty.

Functions

func AdvanceBlock

func AdvanceBlock(ctx context.Context, ks *Keepers, customBlockTime ...time.Duration) context.Context

func AdvanceBlocks

func AdvanceBlocks(ctx context.Context, ks *Keepers, blocks int, customBlockTime ...time.Duration) context.Context

func AdvanceEpoch

func AdvanceEpoch(ctx context.Context, ks *Keepers, customBlockTime ...time.Duration) context.Context

Make sure you save the new context

func AdvanceToBlock

func AdvanceToBlock(ctx context.Context, ks *Keepers, block uint64, customBlockTime ...time.Duration) context.Context

func ConflictKeeper

func ConflictKeeper(t testing.TB) (*keeper.Keeper, sdk.Context)

func EpochstorageKeeper

func EpochstorageKeeper(t testing.TB) (*keeper.Keeper, sdk.Context)

func EpochstorageKeeperWithDB

func EpochstorageKeeperWithDB(t testing.TB) (*keeper.Keeper, storetypes.CommitMultiStore, *tmdb.MemDB)

func InitAllKeepers

func InitAllKeepers(t testing.TB) (*Servers, *Keepers, context.Context)

func NewBlock

func NewBlock(ctx context.Context, ks *Keepers)

Make sure you save the new context

func PairingKeeper

func PairingKeeper(t testing.TB) (*keeper.Keeper, sdk.Context)

func PlanKeeper

func PlanKeeper(t testing.TB) (*keeper.Keeper, sdk.Context)

func ProjectsKeeper

func ProjectsKeeper(t testing.TB) (*keeper.Keeper, sdk.Context)

func ProtocolKeeper

func ProtocolKeeper(t testing.TB) (*keeper.Keeper, sdk.Context)

func SimulateParamChange

func SimulateParamChange(ctx sdk.Context, paramKeeper paramskeeper.Keeper, subspace string, key string, value string) (err error)

func SimulatePlansAddProposal

func SimulatePlansAddProposal(ctx sdk.Context, plansKeeper planskeeper.Keeper, plansToPropose []planstypes.Plan) error

func SimulatePlansDelProposal

func SimulatePlansDelProposal(ctx sdk.Context, plansKeeper planskeeper.Keeper, plansToDelete []string) error

func SpecKeeper

func SpecKeeper(t testing.TB) (*keeper.Keeper, sdk.Context)

func SubscriptionKeeper

func SubscriptionKeeper(t testing.TB) (*keeper.Keeper, sdk.Context)

Types

type KeeperBeginBlocker

type KeeperBeginBlocker interface {
	BeginBlock(ctx sdk.Context)
}

type Keepers

type Keepers struct {
	AccountKeeper mockAccountKeeper
	BankKeeper    mockBankKeeper
	Spec          speckeeper.Keeper
	Epochstorage  epochstoragekeeper.Keeper
	Subscription  subscriptionkeeper.Keeper
	Conflict      conflictkeeper.Keeper
	Pairing       pairingkeeper.Keeper
	Projects      projectskeeper.Keeper
	Plans         planskeeper.Keeper
	Protocol      protocolkeeper.Keeper
	ParamsKeeper  paramskeeper.Keeper
	BlockStore    MockBlockStore
}

NOTE: the order of the keeper fields must follow that of calling app.mm.SetOrderBeginBlockers() in app/app.go

type MockBlockStore

type MockBlockStore struct {
	// contains filtered or unexported fields
}

func (*MockBlockStore) AdvanceBlock

func (b *MockBlockStore) AdvanceBlock(blockTime time.Duration)

func (*MockBlockStore) Base

func (b *MockBlockStore) Base() int64

func (*MockBlockStore) Height

func (b *MockBlockStore) Height() int64

func (*MockBlockStore) LoadBaseMeta

func (b *MockBlockStore) LoadBaseMeta() *tenderminttypes.BlockMeta

func (*MockBlockStore) LoadBlock

func (b *MockBlockStore) LoadBlock(height int64) *tenderminttypes.Block

func (*MockBlockStore) LoadBlockByHash

func (b *MockBlockStore) LoadBlockByHash(hash []byte) *tenderminttypes.Block

func (*MockBlockStore) LoadBlockCommit

func (b *MockBlockStore) LoadBlockCommit(height int64) *tenderminttypes.Commit

func (*MockBlockStore) LoadBlockMeta

func (b *MockBlockStore) LoadBlockMeta(height int64) *tenderminttypes.BlockMeta

func (*MockBlockStore) LoadBlockPart

func (b *MockBlockStore) LoadBlockPart(height int64, index int) *tenderminttypes.Part

func (*MockBlockStore) LoadSeenCommit

func (b *MockBlockStore) LoadSeenCommit(height int64) *tenderminttypes.Commit

func (*MockBlockStore) PruneBlocks

func (b *MockBlockStore) PruneBlocks(height int64) (uint64, error)

func (*MockBlockStore) SaveBlock

func (b *MockBlockStore) SaveBlock(block *tenderminttypes.Block, blockParts *tenderminttypes.PartSet, seenCommit *tenderminttypes.Commit)

func (*MockBlockStore) SetBlockHistoryEntry

func (b *MockBlockStore) SetBlockHistoryEntry(height int64, blockCore *tenderminttypes.Block)

func (*MockBlockStore) SetHeight

func (b *MockBlockStore) SetHeight(height int64)

func (*MockBlockStore) Size

func (b *MockBlockStore) Size() int64

type Servers

type Servers struct {
	EpochServer        epochstoragetypes.MsgServer
	SpecServer         spectypes.MsgServer
	PairingServer      pairingtypes.MsgServer
	ConflictServer     conflicttypes.MsgServer
	ProjectServer      projectstypes.MsgServer
	ProtocolServer     protocoltypes.MsgServer
	SubscriptionServer subscriptiontypes.MsgServer
	PlansServer        planstypes.MsgServer
}

Jump to

Keyboard shortcuts

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