keeper

package
v3.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 63 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var Randomizer *sigs.ZeroReader

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 DualstakingKeeper

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

func EndBlock

func EndBlock(ctx sdk.Context, ks *Keepers)

Make sure you save the new 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 GetModuleAddress

func GetModuleAddress(moduleName string) sdk.AccAddress

func InitAllKeepers

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

func NewBlock

func NewBlock(ctx sdk.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 RewardsKeeper

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

func SetFixedTime

func SetFixedTime()

func SimulateParamChange

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

func SimulatePlansAddProposal

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

func SimulatePlansDelProposal

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

func SimulateSpecAddProposal

func SimulateSpecAddProposal(ctx sdk.Context, specKeeper speckeeper.Keeper, specsToPropose []spectypes.Spec) error

func SimulateUnstakeProposal

func SimulateUnstakeProposal(ctx sdk.Context, pairingKeeper pairingkeeper.Keeper, providersInfo []pairingtypes.ProviderUnstakeInfo, delegatorsSlashing []pairingtypes.DelegatorSlashing) error

func SubscriptionKeeper

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

func UpdateBlockCtx

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

Types

type KeeperBeginBlocker

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

type KeeperBeginBlockerWithRequest

type KeeperBeginBlockerWithRequest interface {
	BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
}

type KeeperEndBlocker

type KeeperEndBlocker interface {
	EndBlock(ctx sdk.Context)
}

type Keepers

type Keepers struct {
	TimerStoreKeeper    *timerstorekeeper.Keeper
	FixationStoreKeeper *fixationkeeper.Keeper
	AccountKeeper       mockAccountKeeper
	BankKeeper          mockBankKeeper
	StakingKeeper       stakingkeeper.Keeper
	Spec                speckeeper.Keeper
	Epochstorage        epochstoragekeeper.Keeper
	Dualstaking         dualstakingkeeper.Keeper
	Subscription        subscriptionkeeper.Keeper
	Conflict            conflictkeeper.Keeper
	Pairing             pairingkeeper.Keeper
	Projects            projectskeeper.Keeper
	Plans               planskeeper.Keeper
	Protocol            protocolkeeper.Keeper
	ParamsKeeper        paramskeeper.Keeper
	BlockStore          MockBlockStore
	Downtime            downtimekeeper.Keeper
	SlashingKeeper      slashingkeeper.Keeper
	Rewards             rewardskeeper.Keeper
	Distribution        distributionkeeper.Keeper
}

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) DeleteLatestBlock

func (b *MockBlockStore) DeleteLatestBlock() error

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) LoadBlockMetaByHash

func (b *MockBlockStore) LoadBlockMetaByHash(hash []byte) *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 {
	StakingServer      stakingtypes.MsgServer
	EpochServer        epochstoragetypes.MsgServer
	SpecServer         spectypes.MsgServer
	PairingServer      pairingtypes.MsgServer
	ConflictServer     conflicttypes.MsgServer
	ProjectServer      projectstypes.MsgServer
	ProtocolServer     protocoltypes.MsgServer
	SubscriptionServer subscriptiontypes.MsgServer
	DualstakingServer  dualstakingtypes.MsgServer
	PlansServer        planstypes.MsgServer
	SlashingServer     slashingtypes.MsgServer
	RewardsServer      rewardstypes.MsgServer
	DistributionServer distributiontypes.MsgServer
}

Jump to

Keyboard shortcuts

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