more explanation to checktx per review feedback

This commit is contained in:
William Banfield
2022-01-06 18:35:58 -05:00
parent 28cf6fcf52
commit 3854f3b69c
+6 -3
View File
@@ -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`: