utils

package
v1.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OperatorPrivKey = secp256k1.GenPrivKey()
	ConsPrivKey     = ed25519.GenPrivKey()
	Proposer, _     = stakingtypes.NewValidator(sdk.ValAddress(OperatorPrivKey.PubKey().Address()), ConsPrivKey.PubKey(), stakingtypes.Description{})
)
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 OperatorAcc added in v1.8.0

func OperatorAcc() sdk.AccAddress

func ProposerCons added in v1.8.0

func ProposerCons() sdk.ConsAddress

func ProposerTMCons added in v1.8.0

func ProposerTMCons() tmprotocrypto.PublicKey

func Setup

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

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 SetupWithGenesisBridge added in v1.8.0

func SetupWithGenesisBridge(t *testing.T, gbFunds sdk.Coin, genAcct []hubgenesistypes.GenesisAccount) *app.App

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

func SetupWithNoNativeDenom added in v1.8.0

func SetupWithNoNativeDenom(t *testing.T) *app.App

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