dsc

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConsensusParams = &abci.ConsensusParams{
	Block: &abci.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 DSC testing.

Functions

func AddTestAddrs

func AddTestAddrs(bankKeeper bankkeeper.Keeper, stakingKeeper *stakingkeeper.Keeper, coinKeeper *coinkeeper.Keeper, ctx sdk.Context, accNum int, accAmt sdk.Coins) []sdk.AccAddress

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

func AddTestAddrsIncremental

func AddTestAddrsIncremental(bankKeeper bankkeeper.Keeper, stakingKeeper *stakingkeeper.Keeper, coinKeeper *coinkeeper.Keeper, ctx sdk.Context, accNum int, accAmt sdk.Coins) []sdk.AccAddress

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

func ConvertAddrsToValAddrs

func ConvertAddrsToValAddrs(addrs []sdk.AccAddress) []sdk.ValAddress

ConvertAddrsToValAddrs converts the provided addresses to ValAddress.

func CreateAddr

func CreateAddr() sdk.AccAddress

func CreateIncrementalAccounts

func CreateIncrementalAccounts(accNum int) []sdk.AccAddress

CreateIncrementalAccounts is a strategy used by addTestAddrs() in order to generated addresses in ascending order.

func CreateRandomAccounts

func CreateRandomAccounts(accNum int) []sdk.AccAddress

CreateRandomAccounts is a strategy used by addTestAddrs() in order to generated addresses in random order.

func GenesisStateWithValSet

func GenesisStateWithValSet(cdc codec.Codec, genesisState map[string]json.RawMessage,
	valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount,
	balances ...banktypes.Balance,
) (map[string]json.RawMessage, error)

GenesisStateWithValSet returns a new genesis state with the validator set

func GetAddrs

func GetAddrs(bankKeeper bankkeeper.Keeper, stakingKeeper *stakingkeeper.Keeper, coinKeeper *coinkeeper.Keeper, ctx sdk.Context, number int) []sdk.AccAddress

func NewValidatorSet

func NewValidatorSet(t *testing.T, valCount int) *tmtypes.ValidatorSet

func TestAddr

func TestAddr(addr string, bech string) (sdk.AccAddress, error)

Types

type GenerateAccountStrategy

type GenerateAccountStrategy func(int) []sdk.AccAddress

Jump to

Keyboard shortcuts

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