Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mconcat committed Sep 16, 2021
1 parent fc796fa commit 85e1808
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
18 changes: 12 additions & 6 deletions abci/types/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions abci/types/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/consensus/mempool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
8 changes: 6 additions & 2 deletions proxy/app_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 1 addition & 5 deletions types/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 85e1808

Please sign in to comment.