chore: gofumpt (#11839)
* fumpt using main not master... * be more descriptive * fumpt * fix nits Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
co-authored by
Julien Robert
parent
bc2d553f77
commit
55054282d2
@@ -48,7 +48,7 @@ func (es EventStats) ExportJSON(path string) {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
err = os.WriteFile(path, bz, 0600)
|
||||
err = os.WriteFile(path, bz, 0o600)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@@ -40,7 +40,6 @@ func (lw *StandardLogWriter) PrintLogs() {
|
||||
for i := 0; i < len(lw.OpEntries); i++ {
|
||||
writeEntry := fmt.Sprintf("%s\n", (lw.OpEntries[i]).MustMarshal())
|
||||
_, err := f.WriteString(writeEntry)
|
||||
|
||||
if err != nil {
|
||||
panic("Failed to write logs to file")
|
||||
}
|
||||
|
||||
@@ -86,7 +86,6 @@ func updateValidators(
|
||||
updates []abci.ValidatorUpdate,
|
||||
event func(route, op, evResult string),
|
||||
) map[string]mockValidator {
|
||||
|
||||
for _, update := range updates {
|
||||
str := fmt.Sprintf("%X", update.PubKey.GetEd25519())
|
||||
|
||||
@@ -100,7 +99,6 @@ func updateValidators(
|
||||
} else if _, ok := current[str]; ok {
|
||||
// validator already exists
|
||||
event("end_block", "validator_updates", "updated")
|
||||
|
||||
} else {
|
||||
// Set this new validator
|
||||
current[str] = mockValidator{
|
||||
@@ -119,7 +117,8 @@ func updateValidators(
|
||||
func RandomRequestBeginBlock(r *rand.Rand, params Params,
|
||||
validators mockValidators, pastTimes []time.Time,
|
||||
pastVoteInfos [][]abci.VoteInfo,
|
||||
event func(route, op, evResult string), header tmproto.Header) abci.RequestBeginBlock {
|
||||
event func(route, op, evResult string), header tmproto.Header,
|
||||
) abci.RequestBeginBlock {
|
||||
if len(validators) == 0 {
|
||||
return abci.RequestBeginBlock{
|
||||
Header: header,
|
||||
|
||||
@@ -43,8 +43,7 @@ func TestNewWeightedProposalContent(t *testing.T) {
|
||||
require.Equal(t, content, pContent.ContentSimulatorFn()(nil, ctx, nil))
|
||||
}
|
||||
|
||||
type testContent struct {
|
||||
}
|
||||
type testContent struct{}
|
||||
|
||||
func (t testContent) GetTitle() string { return "" }
|
||||
func (t testContent) GetDescription() string { return "" }
|
||||
|
||||
@@ -31,7 +31,6 @@ func initChain(
|
||||
config simulation.Config,
|
||||
cdc codec.JSONCodec,
|
||||
) (mockValidators, time.Time, []simulation.Account, string) {
|
||||
|
||||
appState, accounts, chainID, genesisTimestamp := appStateFn(r, accounts, config)
|
||||
consensusParams := randomConsensusParams(r, appState, cdc)
|
||||
req := abci.RequestInitChain{
|
||||
@@ -256,8 +255,8 @@ type blockSimFn func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context,
|
||||
func createBlockSimulator(testingMode bool, tb testing.TB, w io.Writer, params Params,
|
||||
event func(route, op, evResult string), ops WeightedOperations,
|
||||
operationQueue OperationQueue, timeOperationQueue []simulation.FutureOperation,
|
||||
logWriter LogWriter, config simulation.Config) blockSimFn {
|
||||
|
||||
logWriter LogWriter, config simulation.Config,
|
||||
) blockSimFn {
|
||||
lastBlockSizeState := 0 // state for [4 * uniform distribution]
|
||||
blocksize := 0
|
||||
selectOp := ops.getSelectOpFn()
|
||||
@@ -324,8 +323,8 @@ Comment: %s`,
|
||||
func runQueuedOperations(queueOps map[int][]simulation.Operation,
|
||||
height int, tb testing.TB, r *rand.Rand, app *baseapp.BaseApp,
|
||||
ctx sdk.Context, accounts []simulation.Account, logWriter LogWriter,
|
||||
event func(route, op, evResult string), lean bool, chainID string) (numOpsRan int, allFutureOps []simulation.FutureOperation) {
|
||||
|
||||
event func(route, op, evResult string), lean bool, chainID string,
|
||||
) (numOpsRan int, allFutureOps []simulation.FutureOperation) {
|
||||
queuedOp, ok := queueOps[height]
|
||||
if !ok {
|
||||
return 0, nil
|
||||
@@ -361,8 +360,8 @@ func runQueuedTimeOperations(queueOps []simulation.FutureOperation,
|
||||
height int, currentTime time.Time, tb testing.TB, r *rand.Rand,
|
||||
app *baseapp.BaseApp, ctx sdk.Context, accounts []simulation.Account,
|
||||
logWriter LogWriter, event func(route, op, evResult string),
|
||||
lean bool, chainID string) (numOpsRan int, allFutureOps []simulation.FutureOperation) {
|
||||
|
||||
lean bool, chainID string,
|
||||
) (numOpsRan int, allFutureOps []simulation.FutureOperation) {
|
||||
// Keep all future operations
|
||||
allFutureOps = make([]simulation.FutureOperation, 0)
|
||||
|
||||
|
||||
@@ -110,7 +110,6 @@ func GenAndDeliverTx(txCtx OperationInput, fees sdk.Coins) (simtypes.OperationMs
|
||||
[]uint64{account.GetSequence()},
|
||||
txCtx.SimAccount.PrivKey,
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "unable to generate mock tx"), nil, err
|
||||
}
|
||||
@@ -121,5 +120,4 @@ func GenAndDeliverTx(txCtx OperationInput, fees sdk.Coins) (simtypes.OperationMs
|
||||
}
|
||||
|
||||
return simtypes.NewOperationMsg(txCtx.Msg, true, "", txCtx.Cdc), nil, nil
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user