chore: lint v2 (#24118)

This commit is contained in:
Alex | Interchain Labs
2025-03-25 15:57:24 +00:00
committed by GitHub
parent 9acd7716dd
commit b7a20b81f6
87 changed files with 298 additions and 288 deletions
+3 -3
View File
@@ -340,11 +340,11 @@ func (app *BaseApp) ApplySnapshotChunk(req *abci.RequestApplySnapshotChunk) (*ab
func (app *BaseApp) CheckTx(req *abci.RequestCheckTx) (*abci.ResponseCheckTx, error) {
var mode execMode
switch {
case req.Type == abci.CheckTxType_New:
switch req.Type {
case abci.CheckTxType_New:
mode = execModeCheck
case req.Type == abci.CheckTxType_Recheck:
case abci.CheckTxType_Recheck:
mode = execModeReCheck
default:
+3 -2
View File
@@ -937,12 +937,13 @@ func (app *BaseApp) runTx(mode execMode, txBytes []byte) (gInfo sdk.GasInfo, res
anteEvents = events.ToABCIEvents()
}
if mode == execModeCheck {
switch mode {
case execModeCheck:
err = app.mempool.Insert(ctx, tx)
if err != nil {
return gInfo, nil, anteEvents, err
}
} else if mode == execModeFinalize {
case execModeFinalize:
err = app.mempool.Remove(tx)
if err != nil && !errors.Is(err, mempool.ErrTxNotFound) {
return gInfo, nil, anteEvents,
+3 -2
View File
@@ -829,11 +829,12 @@ var ctxTypes = []ctxType{QueryCtx, CheckTxCtx}
func (c ctxType) GetCtx(t *testing.T, bapp *baseapp.BaseApp) sdk.Context {
t.Helper()
if c == QueryCtx {
switch c {
case QueryCtx:
ctx, err := bapp.CreateQueryContext(1, false)
require.NoError(t, err)
return ctx
} else if c == CheckTxCtx {
case CheckTxCtx:
return getCheckStateCtx(bapp)
}
// TODO: Not supported yet
+1 -1
View File
@@ -56,7 +56,7 @@ func TestGRPCQueryRouter(t *testing.T) {
func TestGRPCRouterHybridHandlers(t *testing.T) {
assertRouterBehaviour := func(helper *baseapp.QueryServiceTestHelper) {
// test getting the handler by name
handlers := helper.GRPCQueryRouter.HybridHandlerByRequestName("testpb.EchoRequest")
handlers := helper.HybridHandlerByRequestName("testpb.EchoRequest")
require.NotNil(t, handlers)
require.Len(t, handlers, 1)
handler := handlers[0]
+4 -4
View File
@@ -98,7 +98,7 @@ type voteInfoWrapper struct {
var _ comet.VoteInfo = (*voteInfoWrapper)(nil)
func (v voteInfoWrapper) GetBlockIDFlag() comet.BlockIDFlag {
return comet.BlockIDFlag(v.VoteInfo.BlockIdFlag)
return comet.BlockIDFlag(v.BlockIdFlag)
}
func (v voteInfoWrapper) Validator() comet.Validator {
@@ -159,11 +159,11 @@ func (r prepareProposalInfo) GetValidatorsHash() []byte {
}
func (r prepareProposalInfo) GetProposerAddress() []byte {
return r.RequestPrepareProposal.ProposerAddress
return r.ProposerAddress
}
func (r prepareProposalInfo) GetLastCommit() comet.CommitInfo {
return extendedCommitInfoWrapper{r.RequestPrepareProposal.LocalLastCommit}
return extendedCommitInfoWrapper{r.LocalLastCommit}
}
var _ comet.BlockInfo = (*prepareProposalInfo)(nil)
@@ -203,7 +203,7 @@ type extendedVoteInfoWrapper struct {
var _ comet.VoteInfo = (*extendedVoteInfoWrapper)(nil)
func (e extendedVoteInfoWrapper) GetBlockIDFlag() comet.BlockIDFlag {
return comet.BlockIDFlag(e.ExtendedVoteInfo.BlockIdFlag)
return comet.BlockIDFlag(e.BlockIdFlag)
}
func (e extendedVoteInfoWrapper) Validator() comet.Validator {