Documentation ¶
Index ¶
- Constants
- Variables
- func AddTestAddrs(app *app.PstakeApp, ctx sdk.Context, accNum int, accAmt math.Int) []sdk.AccAddress
- func AddTestAddrsFromPubKeys(app *app.PstakeApp, ctx sdk.Context, pubKeys []cryptotypes.PubKey, ...)
- func AddTestAddrsIncremental(app *app.PstakeApp, ctx sdk.Context, accNum int, accAmt math.Int) []sdk.AccAddress
- func CheckBalance(t *testing.T, app *app.PstakeApp, addr sdk.AccAddress, balances sdk.Coins)
- func ConvertAddrsToValAddrs(addrs []sdk.AccAddress) []sdk.ValAddress
- func CreateTestApp(t *testing.T) (*codec.LegacyAmino, app.PstakeApp, sdk.Context)
- func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey
- func InitAccountWithCoins(app *app.PstakeApp, ctx sdk.Context, addr sdk.AccAddress, coins sdk.Coins)
- func NewAppConstructor(encodingCfg appparams.EncodingConfig, db *dbm.MemDB) network.AppConstructor
- func NewConfig(dbm *dbm.MemDB) network.Config
- func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey)
- func PP(data interface{})
- func ParseTime(s string) time.Time
- func Setup(t *testing.T, isCheckTx bool, invCheckPeriod uint) *app.PstakeApp
- func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage)
- func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, ...) *app.PstakeApp
- func TestAddr(addr string, bech string) (sdk.AccAddress, error)
- type EmptyAppOptions
- type GenerateAccountStrategy
Constants ¶
const (
SimAppChainID = "pstake-app"
)
SimAppChainID hardcoded chainID for simulation
Variables ¶
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, }, }, }
Functions ¶
func AddTestAddrs ¶ added in v2.2.0
func AddTestAddrs(app *app.PstakeApp, 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 AddTestAddrsFromPubKeys ¶ added in v2.2.0
func AddTestAddrsFromPubKeys(app *app.PstakeApp, ctx sdk.Context, pubKeys []cryptotypes.PubKey, accAmt math.Int)
AddTestAddrsFromPubKeys adds the addresses into the App providing only the public keys.
func AddTestAddrsIncremental ¶ added in v2.2.0
func AddTestAddrsIncremental(app *app.PstakeApp, 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 CheckBalance ¶ added in v2.2.0
CheckBalance checks the balance of an account.
func ConvertAddrsToValAddrs ¶ added in v2.2.0
func ConvertAddrsToValAddrs(addrs []sdk.AccAddress) []sdk.ValAddress
ConvertAddrsToValAddrs converts the provided addresses to ValAddress.
func CreateTestApp ¶
func CreateTestPubKeys ¶ added in v2.2.0
func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey
CreateTestPubKeys returns a total of numPubKeys public keys in ascending order.
func InitAccountWithCoins ¶ added in v2.2.0
func NewAppConstructor ¶ added in v2.2.0
func NewAppConstructor(encodingCfg appparams.EncodingConfig, db *dbm.MemDB) network.AppConstructor
NewAppConstructor returns a new network AppConstructor.
func NewConfig ¶ added in v2.2.0
NewConfig returns config that defines the necessary testing requirements used to bootstrap and start an in-process local testing network.
func NewPubKeyFromHex ¶ added in v2.2.0
func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey)
NewPubKeyFromHex returns a PubKey from a hex string.
func SetupTestingApp ¶
func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage)
SetupTestingApp initializes the IBC-go testing application
func SetupWithGenesisValSet ¶ added in v2.2.0
func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *app.PstakeApp
SetupWithGenesisValSet initializes a new SimApp 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 simapp from first genesis account. A Nop logger is set in SimApp.
Types ¶
type EmptyAppOptions ¶
type EmptyAppOptions struct{}
func (EmptyAppOptions) Get ¶
func (EmptyAppOptions) Get(o string) interface{}
type GenerateAccountStrategy ¶ added in v2.2.0
type GenerateAccountStrategy func(int) []sdk.AccAddress