Linter fixes
This commit is contained in:
parent
bf83385155
commit
ad410c1e2e
@ -36,7 +36,7 @@ func SimulateFromSeed(
|
||||
// Setup event stats
|
||||
events := make(map[string]uint)
|
||||
event := func(what string) {
|
||||
events[what] += 1
|
||||
events[what]++
|
||||
}
|
||||
|
||||
app.InitChain(abci.RequestInitChain{AppStateBytes: appStateFn(r, addrs)})
|
||||
|
||||
@ -15,6 +15,7 @@ const (
|
||||
letterIdxMax = 63 / letterIdxBits // # of letter indices fitting in 63 bits
|
||||
)
|
||||
|
||||
// Generate a random string of a particular length
|
||||
func RandStringOfLength(r *rand.Rand, n int) string {
|
||||
b := make([]byte, n)
|
||||
// A src.Int63() generates 63 random bits, enough for letterIdxMax characters!
|
||||
@ -32,6 +33,7 @@ func RandStringOfLength(r *rand.Rand, n int) string {
|
||||
return string(b)
|
||||
}
|
||||
|
||||
// Pretty-print events as a table
|
||||
func DisplayEvents(events map[string]uint) {
|
||||
// TODO
|
||||
fmt.Printf("Events: %v\n", events)
|
||||
|
||||
@ -231,8 +231,8 @@ func SimulateMsgCompleteRedelegate(k stake.Keeper) simulation.TestAndRunTx {
|
||||
}
|
||||
}
|
||||
|
||||
// SimulationSetup
|
||||
func SimulationSetup(mapp *mock.App, k stake.Keeper) simulation.RandSetup {
|
||||
// Setup
|
||||
func Setup(mapp *mock.App, k stake.Keeper) simulation.RandSetup {
|
||||
return func(r *rand.Rand, privKeys []crypto.PrivKey) {
|
||||
ctx := mapp.NewContext(false, abci.Header{})
|
||||
stake.InitGenesis(ctx, k, stake.DefaultGenesisState())
|
||||
|
||||
@ -51,7 +51,7 @@ func TestStakeWithRandomMessages(t *testing.T) {
|
||||
SimulateMsgBeginRedelegate(mapper, stakeKeeper),
|
||||
SimulateMsgCompleteRedelegate(stakeKeeper),
|
||||
}, []simulation.RandSetup{
|
||||
SimulationSetup(mapp, stakeKeeper),
|
||||
Setup(mapp, stakeKeeper),
|
||||
}, []simulation.Invariant{
|
||||
AllInvariants(coinKeeper, stakeKeeper, mapp.AccountMapper),
|
||||
}, 10, 100, 100,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user