mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-27 19:51:41 +00:00
Add RetCodeBadNonce and fix response formats
This commit is contained in:
@ -38,7 +38,7 @@ func (app *CounterApplication) AppendTx(tx []byte) ([]types.Event, types.RetCode
|
||||
copy(tx8, tx)
|
||||
txValue := binary.LittleEndian.Uint64(tx8)
|
||||
if txValue != uint64(app.txCount) {
|
||||
return nil, types.RetCodeInternalError
|
||||
return nil, types.RetCodeBadNonce
|
||||
}
|
||||
}
|
||||
app.txCount += 1
|
||||
@ -51,7 +51,7 @@ func (app *CounterApplication) CheckTx(tx []byte) types.RetCode {
|
||||
copy(tx8, tx)
|
||||
txValue := binary.LittleEndian.Uint64(tx8)
|
||||
if txValue < uint64(app.txCount) {
|
||||
return types.RetCodeInternalError
|
||||
return types.RetCodeBadNonce
|
||||
}
|
||||
}
|
||||
return 0
|
||||
|
Reference in New Issue
Block a user