helpers

package
v3.0.1-rc.4 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SimAppChainID = "terra-app"
)

SimAppChainID hardcoded chainID for simulation

Variables

View Source
var DefaultConsensusParams = &tmproto.ConsensusParams{
	Block: &tmproto.BlockParams{
		MaxBytes: 200000,
		MaxGas:   2000000,
	},
	Evidence: &tmproto.EvidenceParams{
		MaxAgeNumBlocks: 302400,
		MaxAgeDuration:  504 * time.Hour,
		MaxBytes:        10000,
	},
	Validator: &tmproto.ValidatorParams{
		PubKeyTypes: []string{
			tmtypes.ABCIPubKeyTypeEd25519,
		},
	},
}

DefaultConsensusParams defines the default Tendermint consensus params used in app testing.

Functions

func SetupApp

func SetupApp(t *testing.T, chainId string) *app.TerraApp

func SetupWithGenesisValSet

func SetupWithGenesisValSet(t *testing.T, chainId string, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *app.TerraApp

SetupWithGenesisValSet initializes a new app with a validator set and genesis accounts that also act as delegators. For simplicity, each validator is bonded with a delegation of one consensus engine unit in the default token of the app from first genesis account. A Nop logger is set in app.

Types

type EmptyAppOptions

type EmptyAppOptions struct{}

func (EmptyAppOptions) Get

func (EmptyAppOptions) Get(_ string) interface{}

type EmptyBaseAppOptions

type EmptyBaseAppOptions struct{}

EmptyBaseAppOptions is a stub implementing AppOptions

func (EmptyBaseAppOptions) Get

func (ao EmptyBaseAppOptions) Get(_ string) interface{}

Get implements AppOptions

type KeeperTestHelper

type KeeperTestHelper struct {
	suite.Suite

	App         *app.TerraApp
	Ctx         sdk.Context // ctx is deliver ctx
	CheckCtx    sdk.Context
	QueryHelper *baseapp.QueryServiceTestHelper
	TestAccs    []sdk.AccAddress
}

func (*KeeperTestHelper) Ed25519PubAddr

func (*KeeperTestHelper) FundAcc

func (s *KeeperTestHelper) FundAcc(acc sdk.AccAddress, amounts sdk.Coins)

FundAcc funds target address with specified amount.

func (*KeeperTestHelper) RandomAccountAddresses

func (s *KeeperTestHelper) RandomAccountAddresses(n int) []sdk.AccAddress

func (*KeeperTestHelper) Setup

func (s *KeeperTestHelper) Setup(_ *testing.T, chainID string)

type PV

type PV struct {
	PrivKey cryptotypes.PrivKey
}

PV implements PrivValidator without any safety or persistence. Only use it for testing.

func NewPV

func NewPV() PV

func (PV) GetPubKey

func (pv PV) GetPubKey() (crypto.PubKey, error)

GetPubKey implements PrivValidator interface

func (PV) SignProposal

func (pv PV) SignProposal(chainID string, proposal *tmproto.Proposal) error

SignProposal implements PrivValidator interface

func (PV) SignVote

func (pv PV) SignVote(chainID string, vote *tmproto.Vote) error

SignVote implements PrivValidator interface

Jump to

Keyboard shortcuts

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