mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-01 21:57:03 +00:00
lint: s/+=1/++, remove else clauses
This commit is contained in:
@@ -64,12 +64,12 @@ func (app *ChainAwareApplication) Query(query []byte) types.Result {
|
||||
}
|
||||
|
||||
func (app *ChainAwareApplication) BeginBlock(hash []byte, header *types.Header) {
|
||||
app.beginCount += 1
|
||||
app.beginCount++
|
||||
return
|
||||
}
|
||||
|
||||
func (app *ChainAwareApplication) EndBlock(height uint64) (resEndBlock types.ResponseEndBlock) {
|
||||
app.endCount += 1
|
||||
app.endCount++
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ func (app *CounterApplication) DeliverTx(tx []byte) types.Result {
|
||||
return types.ErrBadNonce.SetLog(fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue))
|
||||
}
|
||||
}
|
||||
app.txCount += 1
|
||||
app.txCount++
|
||||
return types.OK
|
||||
}
|
||||
|
||||
@@ -60,15 +60,13 @@ func (app *CounterApplication) CheckTx(tx []byte) types.Result {
|
||||
}
|
||||
|
||||
func (app *CounterApplication) Commit() types.Result {
|
||||
app.hashCount += 1
|
||||
|
||||
app.hashCount++
|
||||
if app.txCount == 0 {
|
||||
return types.OK
|
||||
} else {
|
||||
hash := make([]byte, 8)
|
||||
binary.BigEndian.PutUint64(hash, uint64(app.txCount))
|
||||
return types.NewResultOK(hash, "")
|
||||
}
|
||||
hash := make([]byte, 8)
|
||||
binary.BigEndian.PutUint64(hash, uint64(app.txCount))
|
||||
return types.NewResultOK(hash, "")
|
||||
}
|
||||
|
||||
func (app *CounterApplication) Query(query []byte) types.Result {
|
||||
|
||||
@@ -60,7 +60,7 @@ func testStream(t *testing.T, app types.Application) {
|
||||
// Process response
|
||||
switch r := res.Value.(type) {
|
||||
case *types.Response_DeliverTx:
|
||||
counter += 1
|
||||
counter++
|
||||
if r.DeliverTx.Code != types.CodeType_OK {
|
||||
t.Error("DeliverTx failed with ret_code", r.DeliverTx.Code)
|
||||
}
|
||||
@@ -135,7 +135,7 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) {
|
||||
if err != nil {
|
||||
t.Fatalf("Error in GRPC DeliverTx: %v", err.Error())
|
||||
}
|
||||
counter += 1
|
||||
counter++
|
||||
if response.Code != types.CodeType_OK {
|
||||
t.Error("DeliverTx failed with ret_code", response.Code)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user