testckpt

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ZeroCommission

func ZeroCommission() stakingtypes.CommissionRates

ZeroCommission constructs a commission rates with all zeros.

Types

type Helper

type Helper struct {
	Ctx                 sdk.Context
	App                 *app.BabylonApp
	CheckpointingKeeper *keeper.Keeper
	MsgSrvr             types.MsgServer
	QueryClient         types.QueryClient
	StakingKeeper       *stakingkeeper.Keeper
	EpochingKeeper      *epochingkeeper.Keeper

	GenAccs []authtypes.GenesisAccount
	// contains filtered or unexported fields
}

Helper is a structure which wraps the entire app and exposes functionalities for testing the epoching module

func NewHelper

func NewHelper(t *testing.T, n int) *Helper

NewHelper creates the helper for testing the epoching module

func (*Helper) CreateValidator

func (h *Helper) CreateValidator(addr sdk.ValAddress, pk cryptotypes.PubKey, blsPK *bls12381.PublicKey, pop *types.ProofOfPossession, stakeAmount math.Int, ok bool)

CreateValidator calls handler to create a new staking validator

func (*Helper) CreateValidatorMsg

func (h *Helper) CreateValidatorMsg(addr sdk.ValAddress, pk cryptotypes.PubKey, blsPK *bls12381.PublicKey, pop *types.ProofOfPossession, stakeAmount math.Int) *types.MsgWrappedCreateValidator

CreateValidatorMsg returns a message used to create validator in this service.

func (*Helper) CreateValidatorWithValPower

func (h *Helper) CreateValidatorWithValPower(addr sdk.ValAddress, pk cryptotypes.PubKey, blsPK *bls12381.PublicKey, pop *types.ProofOfPossession, valPower int64, ok bool) math.Int

CreateValidatorWithValPower calls handler to create a new staking validator with zero commission

func (*Helper) Handle

func (h *Helper) Handle(action func(sdk.Context) (proto.Message, error)) *sdk.Result

Handle executes an action function with the Helper's context, wraps the result into an SDK service result, and performs two assertions before returning it

Jump to

Keyboard shortcuts

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