mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-06 16:17:11 +00:00
more explanation to checktx per review feedback
This commit is contained in:
@@ -210,7 +210,6 @@ func (app *KVStoreApplication) validateTx(tx []byte) uint32 {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
And call it from within your `CheckTx` method:
|
||||
|
||||
```go
|
||||
@@ -221,11 +220,15 @@ func (app *KVStoreApplication) CheckTx(req abcitypes.RequestCheckTx) abcitypes.R
|
||||
```
|
||||
|
||||
Any response with a non-zero code will be considered invalid by Tendermint.
|
||||
Our `CheckTx` logic returns `0` to Tendermint when the transaction passes
|
||||
the validation checks. The specific value of the code is meaningless to Tendermint.
|
||||
Our `CheckTx` logic returns `0` to Tendermint when a transaction passes
|
||||
its validation checks. The specific value of the code is meaningless to Tendermint.
|
||||
Non-zero codes are logged by Tendermint so applications can provide more specific
|
||||
information on why the transaction was rejected.
|
||||
|
||||
Note that `CheckTx` _does not execute_ the transaction, it only verifies that that the
|
||||
transaction _could_ be executed. We do not know yet if the rest of the network has
|
||||
agreed to accept this transaction into a block.
|
||||
|
||||
Finally, make sure to add the `bytes` package to the your import stanza
|
||||
at the top of `app.go`:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user