From 85e18085e24262ce10ea520a303fb97752954cb7 Mon Sep 17 00:00:00 2001 From: mconcat Date: Fri, 17 Sep 2021 04:30:26 +0900 Subject: [PATCH] fix lint --- abci/types/application.go | 18 ++++++++++++------ abci/types/result.go | 6 +++--- internal/consensus/mempool_test.go | 2 +- proxy/app_conn.go | 8 ++++++-- test/e2e/app/app.go | 2 +- types/vote.go | 6 +----- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/abci/types/application.go b/abci/types/application.go index ebcec4ec82a..dfbe1bf6e09 100644 --- a/abci/types/application.go +++ b/abci/types/application.go @@ -19,12 +19,18 @@ type Application interface { // Consensus Connection InitChain(RequestInitChain) ResponseInitChain // Initialize blockchain w validators/other info from TendermintCore PrepareProposal(RequestPrepareProposal) ResponsePrepareProposal - BeginBlock(RequestBeginBlock) ResponseBeginBlock // Signals the beginning of a block - DeliverTx(RequestDeliverTx) ResponseDeliverTx // Deliver a tx for full processing - EndBlock(RequestEndBlock) ResponseEndBlock // Signals the end of a block, returns changes to the validator set - Commit() ResponseCommit // Commit the state and return the application Merkle root hash - ExtendVote(RequestExtendVote) ResponseExtendVote // Create application specific vote extension - VerifyVoteExtension(RequestVerifyVoteExtension) ResponseVerifyVoteExtension // Verify application's vote extension data + // Signals the beginning of a block + BeginBlock(RequestBeginBlock) ResponseBeginBlock + // Deliver a tx for full processing + DeliverTx(RequestDeliverTx) ResponseDeliverTx + // Signals the end of a block, returns changes to the validator set + EndBlock(RequestEndBlock) ResponseEndBlock + // Commit the state and return the application Merkle root hash + Commit() ResponseCommit + // Create application specific vote extension + ExtendVote(RequestExtendVote) ResponseExtendVote + // Verify application's vote extension data + VerifyVoteExtension(RequestVerifyVoteExtension) ResponseVerifyVoteExtension // State Sync Connection ListSnapshots(RequestListSnapshots) ResponseListSnapshots // List available snapshots diff --git a/abci/types/result.go b/abci/types/result.go index cce09a7ffaa..a08c3fda574 100644 --- a/abci/types/result.go +++ b/abci/types/result.go @@ -134,11 +134,11 @@ var _ jsonRoundTripper = (*EventAttribute)(nil) // ----------------------------------------------- // construct Result data -func RespondExtendVote(app_data_to_sign, app_data_self_authenticating []byte) ResponseExtendVote { +func RespondExtendVote(appDataToSign, appDataSelfAuthenticating []byte) ResponseExtendVote { return ResponseExtendVote{ VoteExtension: &types.VoteExtension{ - AppDataToSign: app_data_to_sign, - AppDataSelfAuthenticating: app_data_self_authenticating, + AppDataToSign: appDataToSign, + AppDataSelfAuthenticating: appDataSelfAuthenticating, }, } } diff --git a/internal/consensus/mempool_test.go b/internal/consensus/mempool_test.go index f7d690db330..8cbb3b4c487 100644 --- a/internal/consensus/mempool_test.go +++ b/internal/consensus/mempool_test.go @@ -273,5 +273,5 @@ func (app *CounterApplication) Commit() abci.ResponseCommit { func (app *CounterApplication) PrepareProposal( req abci.RequestPrepareProposal) abci.ResponsePrepareProposal { - return abci.ResponsePrepareProposal{BlockData: req.BlockData} //nolint:gosimple + return abci.ResponsePrepareProposal{BlockData: req.BlockData} } diff --git a/proxy/app_conn.go b/proxy/app_conn.go index 34ca30c24fc..405667e50d7 100644 --- a/proxy/app_conn.go +++ b/proxy/app_conn.go @@ -113,11 +113,15 @@ func (app *appConnConsensus) CommitSync(ctx context.Context) (*types.ResponseCom return app.appConn.CommitSync(ctx) } -func (app *appConnConsensus) ExtendVoteSync(ctx context.Context, req types.RequestExtendVote) (*types.ResponseExtendVote, error) { +func (app *appConnConsensus) ExtendVoteSync( + ctx context.Context, req types.RequestExtendVote, +) (*types.ResponseExtendVote, error) { return app.appConn.ExtendVoteSync(ctx, req) } -func (app *appConnConsensus) VerifyVoteExtensionSync(ctx context.Context, req types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) { +func (app *appConnConsensus) VerifyVoteExtensionSync( + ctx context.Context, req types.RequestVerifyVoteExtension, +) (*types.ResponseVerifyVoteExtension, error) { return app.appConn.VerifyVoteExtensionSync(ctx, req) } diff --git a/test/e2e/app/app.go b/test/e2e/app/app.go index 029f7ba2ae1..2409db408c8 100644 --- a/test/e2e/app/app.go +++ b/test/e2e/app/app.go @@ -206,7 +206,7 @@ func (app *Application) ApplySnapshotChunk(req abci.RequestApplySnapshotChunk) a func (app *Application) PrepareProposal( req abci.RequestPrepareProposal) abci.ResponsePrepareProposal { - return abci.ResponsePrepareProposal{BlockData: req.BlockData} //nolint:gosimple + return abci.ResponsePrepareProposal{BlockData: req.BlockData} } // validatorUpdates generates a validator set update. diff --git a/types/vote.go b/types/vote.go index aa466140528..8a55695588a 100644 --- a/types/vote.go +++ b/types/vote.go @@ -71,11 +71,7 @@ func VoteExtensionToSignFromProto(pext *tmproto.VoteExtensionToSign) VoteExtensi } func (ext VoteExtensionToSign) IsEmpty() bool { - if len(ext.AppDataToSign) != 0 { - return false - } - - return true + return len(ext.AppDataToSign) == 0 } // BytesPacked returns a bytes-packed representation for