utils

package
v1.6.0-rc02 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProposerPK       = simapp.CreateTestPubKeys(1)[0]
	ProposerConsAddr = sdk.ConsAddress(ProposerPK.Address())

	OperatorPK = secp256k1.GenPrivKey().PubKey()
)
View Source
var DefaultConsensusParams = &abci.ConsensusParams{
	Block: &abci.BlockParams{
		MaxBytes: 200000,
		MaxGas:   -1,
	},
	Evidence: &tmproto.EvidenceParams{
		MaxAgeNumBlocks: 302400,
		MaxAgeDuration:  504 * time.Hour,
		MaxBytes:        10000,
	},
	Validator: &tmproto.ValidatorParams{
		PubKeyTypes: []string{
			tmtypes.ABCIPubKeyTypeEd25519,
		},
	},
}

Functions

func AccAddress

func AccAddress() sdk.AccAddress
--------------------------------------------------------------------------
                                   utils
--------------------------------------------------------------------------

AccAddress returns a sample account address

func AddTestAddrs

func AddTestAddrs(app *app.App, ctx sdk.Context, accNum int, accAmt math.Int) []sdk.AccAddress

AddTestAddrs constructs and returns accNum amount of accounts with an initial balance of accAmt in random order

func CreateTestPubKeys

func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey

CreateTestPubKeys returns a total of numPubKeys public keys in ascending order.

func FundModuleAccount

func FundModuleAccount(app *app.App, ctx sdk.Context, moduleName string, coins sdk.Coins)

func InitAccountWithCoins

func InitAccountWithCoins(app *app.App, ctx sdk.Context, addr sdk.AccAddress, coins sdk.Coins)

func NewPubKeyFromHex

func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey)

NewPubKeyFromHex returns a PubKey from a hex string.

func Setup

func Setup(t *testing.T, isCheckTx bool) *app.App

Setup initializes a new Rollapp. A Nop logger is set in Rollapp.

func SetupChain

func SetupChain(t *testing.T, coord *ibctesting.Coordinator, chainID, rollAppDenom string) *ibctesting.TestChain

TODO: tech debt - this is almost exactly like the code in github.com/cosmos/ibc-go/v6/testing/chain.go the only difference is the different way the app is setup

func SetupWithGenesisValSet

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

TODO: tech debt - this is almost the same as in github.com/cosmos/ibc-go/v6/testing/app.go but unlike the other one, this one adds the sequencer to the genesis state on InitChain

Types

type EmptyAppOptions

type EmptyAppOptions struct{}

EmptyAppOptions is a stub implementing AppOptions

func (EmptyAppOptions) Get

func (ao EmptyAppOptions) Get(o string) interface{}

Get implements AppOptions

Jump to

Keyboard shortcuts

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